View Javadoc
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   * <p>
19   * Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
20   * BSD-style license. See <a href="http://opentrafficsim.org/node/13">OpenTrafficSim License</a>.
21   * <p>
22   * @version $Revision$, $LastChangedDate$, by $Author$, initial version 27 jan. 2017 <br>
23   * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
24   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
25   * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
26   */
27  public class AccelerationSpeedLimitTransition implements AccelerationIncentive
28  {
29  
30      /** {@inheritDoc} */
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      /** {@inheritDoc} */
41      @Override
42      public final String toString()
43      {
44          return "AccelerationSpeedLimitTransition";
45      }
46  
47  }