1 package org.opentrafficsim.road.gtu.lane.tactical.lmrs;
2
3 import org.djunits.value.vdouble.scalar.Speed;
4 import org.opentrafficsim.base.parameters.ParameterException;
5 import org.opentrafficsim.base.parameters.Parameters;
6 import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
7 import org.opentrafficsim.road.gtu.lane.LaneBasedGTU;
8 import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
9 import org.opentrafficsim.road.gtu.lane.perception.RelativeLane;
10 import org.opentrafficsim.road.gtu.lane.perception.categories.InfrastructurePerception;
11 import org.opentrafficsim.road.gtu.lane.plan.operational.SimpleOperationalPlan;
12 import org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel;
13 import org.opentrafficsim.road.gtu.lane.tactical.util.SpeedLimitUtil;
14 import org.opentrafficsim.road.network.speed.SpeedLimitInfo;
15 import org.opentrafficsim.road.network.speed.SpeedLimitProspect;
16
17
18
19
20
21
22
23
24
25
26
27 public class AccelerationSpeedLimitTransition implements AccelerationIncentive
28 {
29
30
31 @Override
32 public final void accelerate(final SimpleOperationalPlan simplePlan, final RelativeLane lane, final LaneBasedGTU gtu,
33 final LanePerception perception, final CarFollowingModel carFollowingModel, final Speed speed,
34 final Parameters params, final SpeedLimitInfo speedLimitInfo) throws OperationalPlanException, ParameterException
35 {
36 SpeedLimitProspect slp = perception.getPerceptionCategory(InfrastructurePerception.class).getSpeedLimitProspect(lane);
37 simplePlan.minimizeAcceleration(SpeedLimitUtil.considerSpeedLimitTransitions(params, speed, slp, carFollowingModel));
38 }
39
40
41 @Override
42 public final String toString()
43 {
44 return "AccelerationSpeedLimitTransition";
45 }
46
47 }