Class ConflictUtil.ConflictPlans

java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.ConflictUtil.ConflictPlans
All Implemented Interfaces:
Serializable, Blockable
Enclosing class:
ConflictUtil

public static final class ConflictUtil.ConflictPlans extends Object implements Blockable, Serializable
Holds the tactical plans of a driver considering conflicts. These are remembered for consistency. For instance, if the decision is made to yield as current deceleration suggests it's safe to do so, but the trajectory for stopping in front of the conflict results in deceleration slightly above what is considered safe deceleration, the plan should not be abandoned. Decelerations above what is considered safe deceleration may result due to numerical overshoot or other factor coming into play in car-following models. Many other examples exist where a driver sticks to a certain plan.

Copyright (c) 2013-2024 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
See Also:
  • Constructor Details

    • ConflictPlans

      public ConflictPlans()
  • Method Details

    • cleanPlans

      void cleanPlans()
      Clean any yield plan that was no longer kept active in the last evaluation of conflicts.
    • setArrivalTime

      void setArrivalTime(AbstractHeadwayGtu gtu, org.djunits.value.vdouble.scalar.Time time)
      Sets the estimated arrival time of a GTU.
      Parameters:
      gtu - AbstractHeadwayGtu; GTU
      time - Time; estimated arrival time
    • getArrivalTime

      org.djunits.value.vdouble.scalar.Time getArrivalTime(AbstractHeadwayGtu gtu)
      Returns the estimated arrival time of given GTU.
      Parameters:
      gtu - AbstractHeadwayGtu; GTU
      Returns:
      estimated arrival time of given GTU
    • setStopPhaseApproach

      void setStopPhaseApproach(HeadwayStopLine stopLine)
      Sets the current phase to 'approach' for the given stop line.
      Parameters:
      stopLine - HeadwayStopLine; stop line
    • setStopPhaseYield

      void setStopPhaseYield(HeadwayStopLine stopLine)
      Sets the current phase to 'yield' for the given stop line.
      Parameters:
      stopLine - HeadwayStopLine; stop line
      Throws:
      RuntimeException - if the phase was not set to approach before
    • setStopPhaseRun

      void setStopPhaseRun(HeadwayStopLine stopLine)
      Sets the current phase to 'run' for the given stop line.
      Parameters:
      stopLine - HeadwayStopLine; stop line
      Throws:
      RuntimeException - if the phase was not set to approach before
    • isStopPhaseApproach

      boolean isStopPhaseApproach(HeadwayStopLine stopLine)
      Parameters:
      stopLine - HeadwayStopLine; stop line
      Returns:
      whether the current phase is 'approach' for the given stop line
    • isStopPhaseYield

      boolean isStopPhaseYield(HeadwayStopLine stopLine)
      Parameters:
      stopLine - HeadwayStopLine; stop line
      Returns:
      whether the current phase is 'yield' for the given stop line
    • isStopPhaseRun

      boolean isStopPhaseRun(HeadwayStopLine stopLine)
      Parameters:
      stopLine - HeadwayStopLine; stop line
      Returns:
      whether the current phase is 'run' for the given stop line
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getIndicatorIntent

      public TurnIndicatorIntent getIndicatorIntent()
      Returns:
      indicatorIntent.
    • getIndicatorObjectDistance

      public org.djunits.value.vdouble.scalar.Length getIndicatorObjectDistance()
      Returns:
      indicatorObjectDistance.
    • setIndicatorIntent

      public void setIndicatorIntent(TurnIndicatorIntent intent, org.djunits.value.vdouble.scalar.Length distance)
      Parameters:
      intent - TurnIndicatorIntent; indicator intent
      distance - Length; distance to object pertaining to the turn indicator intent
    • isBlocking

      public boolean isBlocking()
      Returns whether the GTU is blocking conflicts.
      Specified by:
      isBlocking in interface Blockable
      Returns:
      boolean; whether the GTU is blocking conflicts
    • setBlocking

      public void setBlocking(boolean blocking)
      Sets the GTU as blocking conflicts or not.
      Parameters:
      blocking - boolean; whether the GTU is blocking conflicts