1 package org.opentrafficsim.road.gtu.lane.control;
2
3 import org.djunits.value.vdouble.scalar.Acceleration;
4 import org.opentrafficsim.base.parameters.ParameterException;
5 import org.opentrafficsim.base.parameters.ParameterTypeDouble;
6 import org.opentrafficsim.base.parameters.Parameters;
7 import org.opentrafficsim.base.parameters.constraint.NumericConstraint;
8 import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
9 import org.opentrafficsim.road.gtu.lane.perception.PerceptionCollectable;
10 import org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayGtu;
11
12
13
14
15
16
17
18
19
20
21 public class PloegAcc extends LinearAcc
22 {
23
24
25 public static final ParameterTypeDouble KD =
26 new ParameterTypeDouble("kd", "Gap error derivative gain", 0.7, NumericConstraint.POSITIVE);
27
28
29
30
31
32 public PloegAcc(final DelayedActuation delayedActuation)
33 {
34 super(delayedActuation);
35 }
36
37
38 @Override
39 public Acceleration getFollowingAcceleration(final LaneBasedGtu gtu,
40 final PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, final Parameters settings) throws ParameterException
41 {
42 HeadwayGtu leader = leaders.first();
43 double es =
44 leader.getDistance().si - gtu.getSpeed().si * settings.getParameter(TDACC).si - settings.getParameter(X0).si;
45 double esd = leader.getSpeed().si - gtu.getSpeed().si - gtu.getAcceleration().si * settings.getParameter(TDACC).si;
46 return Acceleration.instantiateSI(settings.getParameter(KS) * es + settings.getParameter(KD) * esd);
47 }
48
49 }