View Javadoc
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   * <p>
20   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
21   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
22   * </p>
23   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
24   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
25   * @author <a href="https://github.com/wjschakel">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 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      /** {@inheritDoc} */
42      @Override
43      public final String toString()
44      {
45          return "AccelerationSpeedLimitTransition";
46      }
47  
48  }