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.IntersectionPerception;
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.TrafficLightUtil;
14 import org.opentrafficsim.road.network.speed.SpeedLimitInfo;
15
16
17
18
19
20
21
22
23
24
25
26 public class AccelerationTrafficLights implements AccelerationIncentive
27 {
28
29
30 @Override
31 public final void accelerate(final SimpleOperationalPlan simplePlan, final RelativeLane lane, final LaneBasedGTU gtu,
32 final LanePerception perception, final CarFollowingModel carFollowingModel, final Speed speed,
33 final Parameters params, final SpeedLimitInfo speedLimitInfo) throws ParameterException, OperationalPlanException
34 {
35 simplePlan.minimizeAcceleration(TrafficLightUtil.respondToTrafficLights(params,
36 perception.getPerceptionCategory(IntersectionPerception.class).getTrafficLights(lane), carFollowingModel, speed,
37 speedLimitInfo));
38 }
39
40
41 @Override
42 public final String toString()
43 {
44 return "AccelerationTrafficLights";
45 }
46
47 }