1 package org.opentrafficsim.road.gtu.lane.tactical.following;
2
3 import java.io.Serializable;
4 import java.util.SortedMap;
5
6 import org.djunits.unit.AccelerationUnit;
7 import org.djunits.value.vdouble.scalar.Acceleration;
8 import org.djunits.value.vdouble.scalar.Duration;
9 import org.djunits.value.vdouble.scalar.Length;
10 import org.djunits.value.vdouble.scalar.Speed;
11 import org.opentrafficsim.core.gtu.behavioralcharacteristics.BehavioralCharacteristics;
12 import org.opentrafficsim.core.gtu.behavioralcharacteristics.ParameterException;
13 import org.opentrafficsim.road.network.speed.SpeedLimitInfo;
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 public class FixedAccelerationModel extends AbstractGTUFollowingModelMobil implements Serializable
29 {
30
31 private static final long serialVersionUID = 20150206L;
32
33
34 private Acceleration acceleration;
35
36
37 private Duration duration;
38
39
40
41
42
43
44 public FixedAccelerationModel(final Acceleration acceleration, final Duration duration)
45 {
46 this.acceleration = acceleration;
47 this.duration = duration;
48 }
49
50
51
52
53
54 public final Duration getDuration()
55 {
56 return this.duration;
57 }
58
59
60
61
62
63 public final Acceleration getAcceleration()
64 {
65 return this.acceleration;
66 }
67
68
69 @Override
70 public final Acceleration computeAcceleration(final Speed followerSpeed, final Speed followerMaximumSpeed,
71 final Speed leaderSpeed, final Length headway, final Speed speedLimit, final Duration stepSize)
72 {
73 return this.acceleration;
74 }
75
76
77 @Override
78 public final Acceleration computeAcceleration(final Speed followerSpeed, final Speed followerMaximumSpeed,
79 final Speed leaderSpeed, final Length headway, final Speed speedLimit)
80 {
81 return this.acceleration;
82 }
83
84
85 @Override
86 public final Acceleration getMaximumSafeDeceleration()
87 {
88
89 return new Acceleration(2, AccelerationUnit.METER_PER_SECOND_2);
90 }
91
92
93 @Override
94 public final Duration getStepSize()
95 {
96 return this.duration;
97 }
98
99
100 @Override
101 public final String getName()
102 {
103 return "Fixed";
104 }
105
106
107 @Override
108 public final String getLongName()
109 {
110 return "Fixed GTU following model";
111 }
112
113
114 public final String toString()
115 {
116 return "FixedAccelerationModel " + this.duration + ", " + this.acceleration;
117 }
118
119
120
121
122 @Override
123 public final Speed desiredSpeed(final BehavioralCharacteristics behavioralCharacteristics, final SpeedLimitInfo speedInfo)
124 throws ParameterException
125 {
126 return null;
127 }
128
129
130 @Override
131 public final Length desiredHeadway(final BehavioralCharacteristics behavioralCharacteristics, final Speed speed)
132 throws ParameterException
133 {
134 return null;
135 }
136
137
138 @Override
139 public final Acceleration followingAcceleration(final BehavioralCharacteristics behavioralCharacteristics,
140 final Speed speed, final SpeedLimitInfo speedInfo, final SortedMap<Length, Speed> leaders) throws ParameterException
141 {
142 return null;
143 }
144
145 }