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-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Jun 7, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConflictPlans()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
cleanPlans()
Clean any yield plan that was no longer kept active in the last evaluation of conflicts.(package private) Time
getArrivalTime(AbstractHeadwayGTU gtu)
Returns the estimated arrival time of given GTU.TurnIndicatorIntent
getIndicatorIntent()
Length
getIndicatorObjectDistance()
boolean
isBlocking()
Returns whether the GTU is blocking conflicts.(package private) boolean
isStopPhaseApproach(HeadwayStopLine stopLine)
(package private) boolean
isStopPhaseRun(HeadwayStopLine stopLine)
(package private) boolean
isStopPhaseYield(HeadwayStopLine stopLine)
(package private) void
setArrivalTime(AbstractHeadwayGTU gtu, Time time)
Sets the estimated arrival time of a GTU.void
setBlocking(boolean blocking)
Sets the GTU as blocking conflicts or not.void
setIndicatorIntent(TurnIndicatorIntent intent, Length distance)
(package private) void
setStopPhaseApproach(HeadwayStopLine stopLine)
Sets the current phase to 'approach' for the given stop line.(package private) void
setStopPhaseRun(HeadwayStopLine stopLine)
Sets the current phase to 'run' for the given stop line.(package private) void
setStopPhaseYield(HeadwayStopLine stopLine)
Sets the current phase to 'yield' for the given stop line.String
toString()
-
-
-
Method Detail
-
cleanPlans
void cleanPlans()
Clean any yield plan that was no longer kept active in the last evaluation of conflicts.
-
setArrivalTime
void setArrivalTime(AbstractHeadwayGTU gtu, Time time)
Sets the estimated arrival time of a GTU.- Parameters:
gtu
- AbstractHeadwayGTU; GTUtime
- Time; estimated arrival time
-
getArrivalTime
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
-
getIndicatorIntent
public TurnIndicatorIntent getIndicatorIntent()
- Returns:
- indicatorIntent.
-
getIndicatorObjectDistance
public Length getIndicatorObjectDistance()
- Returns:
- indicatorObjectDistance.
-
setIndicatorIntent
public void setIndicatorIntent(TurnIndicatorIntent intent, Length distance)
- Parameters:
intent
- TurnIndicatorIntent; indicator intentdistance
- 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 interfaceBlockable
- 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
-
-