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
32 @Override
33 public double weight(final double c, final double dx, final double dt)
34 {
35 return Math.exp(-Math.abs(dx) / this.sigma - Math.abs(dt - dx / c) / this.tau);
36 }
37
38
39 @Override
40 public String toString()
41 {
42 return "ExpKernelShape [sigma=" + this.sigma + ", tau=" + this.tau + "]";
43 }
44
45 }