1 package org.opentrafficsim.road.gtu.lane.tactical.lmrs;
2
3 import org.djunits.value.vdouble.scalar.Length;
4 import org.djunits.value.vdouble.scalar.Speed;
5 import org.opentrafficsim.base.parameters.ParameterException;
6 import org.opentrafficsim.base.parameters.Parameters;
7 import org.opentrafficsim.core.gtu.plan.operational.OperationalPlanException;
8 import org.opentrafficsim.road.gtu.lane.LaneBasedGtu;
9 import org.opentrafficsim.road.gtu.lane.perception.LanePerception;
10 import org.opentrafficsim.road.gtu.lane.perception.RelativeLane;
11 import org.opentrafficsim.road.gtu.lane.perception.categories.InfrastructurePerception;
12 import org.opentrafficsim.road.gtu.lane.plan.operational.SimpleOperationalPlan;
13 import org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel;
14 import org.opentrafficsim.road.gtu.lane.tactical.util.SpeedLimitUtil;
15 import org.opentrafficsim.road.network.speed.SpeedLimitInfo;
16 import org.opentrafficsim.road.network.speed.SpeedLimitProspect;
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 Length mergeDistance,
33 final LaneBasedGtu gtu, final LanePerception perception, final CarFollowingModel carFollowingModel,
34 final Speed speed, final Parameters params, final SpeedLimitInfo speedLimitInfo)
35 throws OperationalPlanException, ParameterException
36 {
37 SpeedLimitProspect slp = perception.getPerceptionCategory(InfrastructurePerception.class).getSpeedLimitProspect(lane);
38 simplePlan.minimizeAcceleration(SpeedLimitUtil.considerSpeedLimitTransitions(params, speed, slp, carFollowingModel));
39 }
40
41
42 @Override
43 public final String toString()
44 {
45 return "AccelerationSpeedLimitTransition";
46 }
47
48 }