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