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