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