1 package org.opentrafficsim.road.gtu.lane.tactical.util.lmrs;
2
3 import org.djunits.unit.SpeedUnit;
4 import org.djunits.value.vdouble.scalar.Speed;
5 import org.djutils.exceptions.Throw;
6 import org.opentrafficsim.base.parameters.ParameterException;
7 import org.opentrafficsim.base.parameters.ParameterTypeDouble;
8 import org.opentrafficsim.base.parameters.ParameterTypeSpeed;
9 import org.opentrafficsim.base.parameters.Parameters;
10 import org.opentrafficsim.base.parameters.constraint.ConstraintInterface;
11
12
13
14
15
16
17
18
19
20
21
22 @SuppressWarnings("checkstyle:interfaceistype")
23 public interface LmrsParameters
24 {
25
26
27
28 ParameterTypeDouble DFREE =
29 new ParameterTypeDouble("dFree", "Free lane change desire threshold", 0.365, ConstraintInterface.UNITINTERVAL)
30 {
31
32 private static final long serialVersionUID = 20160413L;
33
34
35 @Override
36 public void check(final Double value, final Parameters params) throws ParameterException
37 {
38
39 Double dSync = params.getParameterOrNull(DSYNC);
40 Throw.when(dSync != null && value >= dSync, ParameterException.class,
41 "Value of dFree is above or equal to dSync.");
42
43 Double dCoop = params.getParameterOrNull(DCOOP);
44 Throw.when(dCoop != null && value >= dCoop, ParameterException.class,
45 "Value of dFree is above or equal to dCoop.");
46 }
47 };
48
49
50
51 ParameterTypeDouble DSYNC = new ParameterTypeDouble("dSync", "Synchronized lane change desire threshold", 0.577,
52 ConstraintInterface.UNITINTERVAL)
53 {
54
55 private static final long serialVersionUID = 20160413L;
56
57
58 @Override
59 public void check(final Double value, final Parameters params) throws ParameterException
60 {
61
62 Double dFree = params.getParameterOrNull(DFREE);
63 Throw.when(dFree != null && value <= dFree, ParameterException.class, "Value of dSync is below or equal to dFree.");
64
65 Double dCoop = params.getParameterOrNull(DCOOP);
66 Throw.when(dCoop != null && value >= dCoop, ParameterException.class, "Value of dSync is above or equal to dCoop.");
67 }
68 };
69
70
71 ParameterTypeDouble DCOOP = new ParameterTypeDouble("dCoop", "Cooperative lane change desire threshold", 0.788,
72 ConstraintInterface.UNITINTERVAL)
73 {
74
75 private static final long serialVersionUID = 20160413L;
76
77
78 @Override
79 public void check(final Double value, final Parameters params) throws ParameterException
80 {
81 Double dFree = params.getParameterOrNull(DFREE);
82 Throw.when(dFree != null && value <= dFree, ParameterException.class, "Value of dCoop is below or equal to dFree.");
83 Double dSync = params.getParameterOrNull(DSYNC);
84 Throw.when(dSync != null && value <= dSync, ParameterException.class, "Value of dCoop is below or equal to dSync.");
85 }
86 };
87
88
89 ParameterTypeDouble DLEFT = new ParameterTypeDouble("dLeft", "Left lane change desire", 0.0);
90
91
92 ParameterTypeDouble DRIGHT = new ParameterTypeDouble("dRight", "Right lane change desire", 0.0);
93
94
95 ParameterTypeDouble DLC = new ParameterTypeDouble("dLaneChange", "Desire of current lane change", 0.0);
96
97
98 ParameterTypeSpeed VGAIN = new ParameterTypeSpeed("vGain", "Anticipation speed difference at full lane change desire",
99 new Speed(69.6, SpeedUnit.KM_PER_HOUR), ConstraintInterface.POSITIVE);
100
101
102 ParameterTypeDouble SOCIO =
103 new ParameterTypeDouble("socio", "Sensitivity level for speed of others", 1.0, ConstraintInterface.UNITINTERVAL);
104
105 }