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