Class AbstractIncentivesTacticalPlanner

java.lang.Object
org.opentrafficsim.road.gtu.tactical.AbstractLaneBasedTacticalPlanner
org.opentrafficsim.road.gtu.tactical.lmrs.AbstractIncentivesTacticalPlanner
All Implemented Interfaces:
TacticalPlanner<LaneBasedGtu,LanePerception>, LaneBasedTacticalPlanner, AccelerationBased, DesireBased
Direct Known Subclasses:
Lmrs

public abstract class AbstractIncentivesTacticalPlanner extends AbstractLaneBasedTacticalPlanner implements DesireBased, AccelerationBased
Tactical planner with mandatory lane change incentives, voluntary lane change incentives, and acceleration incentives. The order in which the incentives are given is relevant. A later incentive can request the result from an earlier incentive at the same time instance. Otherwise, it can only obtain the value of another incentive from the previous time step.

Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Details

    • AbstractIncentivesTacticalPlanner

      public AbstractIncentivesTacticalPlanner(CarFollowingModel carFollowingModel, LaneBasedGtu gtu, LanePerception lanePerception)
      Constructor.
      Parameters:
      carFollowingModel - Car-following model.
      gtu - GTU
      lanePerception - perception
  • Method Details

    • addMandatoryIncentive

      public void addMandatoryIncentive(MandatoryIncentive incentive)
      Adds a mandatory incentive. Ignores null.
      Parameters:
      incentive - Incentive to add.
    • addVoluntaryIncentive

      public void addVoluntaryIncentive(VoluntaryIncentive incentive)
      Adds a voluntary incentive. Ignores null.
      Parameters:
      incentive - Incentive to add.
    • addAccelerationIncentive

      public void addAccelerationIncentive(AccelerationIncentive incentive)
      Adds an acceleration incentive. Ignores null.
      Parameters:
      incentive - Incentive to add.
    • getMandatoryIncentives

      public ImmutableSet<MandatoryIncentive> getMandatoryIncentives()
      Returns the mandatory incentives.
      Returns:
      mandatory incentives
    • getVoluntaryIncentives

      public ImmutableSet<VoluntaryIncentive> getVoluntaryIncentives()
      Returns the voluntary incentives.
      Returns:
      voluntary incentives
    • getAccelerationIncentives

      public ImmutableSet<AccelerationIncentive> getAccelerationIncentives()
      Returns the acceleration incentives.
      Returns:
      acceleration incentives
    • getMandatoryDesire

      public Desire getMandatoryDesire(TacticalContextEgo context) throws OperationalPlanException, ParameterException
      Determines level of lane change desire for mandatory lane change incentives.
      Parameters:
      context - tactical information such as parameters and car-following model
      Returns:
      level of lane change desire for this incentive
      Throws:
      ParameterException - if a parameter is not given or out of bounds
      OperationalPlanException - in case of a perception exception
    • getVoluntaryDesire

      public Desire getVoluntaryDesire(TacticalContextEgo context) throws OperationalPlanException, ParameterException
      Determines level of lane change desire for voluntary lane change incentives.
      Parameters:
      context - tactical information such as parameters and car-following model
      Returns:
      level of lane change desire for this incentive
      Throws:
      ParameterException - if a parameter is not given or out of bounds
      OperationalPlanException - in case of a perception exception
    • getLatestMandatoryDesire

      public Desire getLatestMandatoryDesire()
      Returns the latest total mandatory desire.
      Returns:
      latest total mandatory desire
    • getLatestVoluntaryDesire

      public Desire getLatestVoluntaryDesire()
      Returns the latest total voluntary desire.
      Returns:
      latest total voluntary desire
    • getLatestDesire

      public Optional<Desire> getLatestDesire(Class<? extends Incentive> incentive)
      Description copied from interface: DesireBased
      Returns the latest desire from the specified incentive.
      Specified by:
      getLatestDesire in interface DesireBased
      Parameters:
      incentive - incentive class
      Returns:
      latest desire from the specified incentive, empty if this incentive is not active
    • getAcceleration

      public org.djunits.value.vdouble.scalar.Acceleration getAcceleration(TacticalContextEgo context, RelativeLane lane, org.djunits.value.vdouble.scalar.Length mergeDistance) throws ParameterException, GtuException
      Determine acceleration.
      Parameters:
      context - tactical information such as parameters and car-following model
      lane - lane on which to consider the acceleration
      mergeDistance - distance over which a lane change is impossible towards the lane, zero if current lane
      Returns:
      acceleration
      Throws:
      ParameterException - on missing parameter
      GtuException - when there is a problem with the state of the GTU when planning a path
    • getLatestAcceleration

      public Optional<org.djunits.value.vdouble.scalar.Acceleration> getLatestAcceleration(Class<? extends AccelerationIncentive> incentiveClass)
      Description copied from interface: AccelerationBased
      Return latest acceleration of incentive class.
      Specified by:
      getLatestAcceleration in interface AccelerationBased
      Parameters:
      incentiveClass - incentive class
      Returns:
      latest acceleration, or empty if incentive does not apply