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 @Override
35 public void check(final Double value, final Parameters params) throws ParameterException
36 {
37
38 Double dSync = params.getParameterOrNull(DSYNC);
39 Throw.when(dSync != null && value >= dSync, ParameterException.class,
40 "Value of dFree is above or equal to dSync.");
41
42 Double dCoop = params.getParameterOrNull(DCOOP);
43 Throw.when(dCoop != null && value >= dCoop, ParameterException.class,
44 "Value of dFree is above or equal to dCoop.");
45 }
46 };
47
48
49
50 ParameterTypeDouble DSYNC = new ParameterTypeDouble("dSync", "Synchronized lane change desire threshold", 0.577,
51 ConstraintInterface.UNITINTERVAL)
52 {
53
54 private static final long serialVersionUID = 20160413L;
55
56 @Override
57 public void check(final Double value, final Parameters params) throws ParameterException
58 {
59
60 Double dFree = params.getParameterOrNull(DFREE);
61 Throw.when(dFree != null && value <= dFree, ParameterException.class, "Value of dSync is below or equal to dFree.");
62
63 Double dCoop = params.getParameterOrNull(DCOOP);
64 Throw.when(dCoop != null && value >= dCoop, ParameterException.class, "Value of dSync is above or equal to dCoop.");
65 }
66 };
67
68
69 ParameterTypeDouble DCOOP = new ParameterTypeDouble("dCoop", "Cooperative lane change desire threshold", 0.788,
70 ConstraintInterface.UNITINTERVAL)
71 {
72
73 private static final long serialVersionUID = 20160413L;
74
75 @Override
76 public void check(final Double value, final Parameters params) throws ParameterException
77 {
78 Double dFree = params.getParameterOrNull(DFREE);
79 Throw.when(dFree != null && value <= dFree, ParameterException.class, "Value of dCoop is below or equal to dFree.");
80 Double dSync = params.getParameterOrNull(DSYNC);
81 Throw.when(dSync != null && value <= dSync, ParameterException.class, "Value of dCoop is below or equal to dSync.");
82 }
83 };
84
85
86 ParameterTypeDouble DLEFT = new ParameterTypeDouble("dLeft", "Left lane change desire", 0.0);
87
88
89 ParameterTypeDouble DRIGHT = new ParameterTypeDouble("dRight", "Right lane change desire", 0.0);
90
91
92 ParameterTypeDouble DLC = new ParameterTypeDouble("dLaneChange", "Desire of current lane change", 0.0);
93
94
95 ParameterTypeSpeed VGAIN = new ParameterTypeSpeed("vGain", "Anticipation speed difference at full lane change desire",
96 new Speed(69.6, SpeedUnit.KM_PER_HOUR), ConstraintInterface.POSITIVE);
97
98
99 ParameterTypeDouble SOCIO =
100 new ParameterTypeDouble("socio", "Sensitivity level for speed of others", 1.0, ConstraintInterface.UNITINTERVAL);
101
102 }