1 package org.opentrafficsim.draw.egtf;
2
3
4
5
6
7
8
9
10
11 public class ExpKernelShape implements KernelShape
12 {
13
14
15 private final double sigma;
16
17
18 private final double tau;
19
20
21
22
23
24
25 ExpKernelShape(final double sigma, final double tau)
26 {
27 this.sigma = sigma;
28 this.tau = tau;
29 }
30
31 @Override
32 public double weight(final double c, final double dx, final double dt)
33 {
34 return Math.exp(-Math.abs(dx) / this.sigma - Math.abs(dt - dx / c) / this.tau);
35 }
36
37 @Override
38 public String toString()
39 {
40 return "ExpKernelShape [sigma=" + this.sigma + ", tau=" + this.tau + "]";
41 }
42
43 }