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