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 Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
Clean any yield plan that was no longer kept active in the last evaluation of conflicts.(package private) org.djunits.value.vdouble.scalar.Time
Returns the estimated arrival time of given GTU.org.djunits.value.vdouble.scalar.Length
boolean
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, org.djunits.value.vdouble.scalar.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, org.djunits.value.vdouble.scalar.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.toString()
-
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
Sets the estimated arrival time of a GTU.- Parameters:
gtu
- AbstractHeadwayGtu; GTUtime
- Time; estimated arrival time
-
getArrivalTime
Returns the estimated arrival time of given GTU.- Parameters:
gtu
- AbstractHeadwayGtu; GTU- Returns:
- estimated arrival time of given GTU
-
setStopPhaseApproach
Sets the current phase to 'approach' for the given stop line.- Parameters:
stopLine
- HeadwayStopLine; stop line
-
setStopPhaseYield
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
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
- Parameters:
stopLine
- HeadwayStopLine; stop line- Returns:
- whether the current phase is 'approach' for the given stop line
-
isStopPhaseYield
- Parameters:
stopLine
- HeadwayStopLine; stop line- Returns:
- whether the current phase is 'yield' for the given stop line
-
isStopPhaseRun
- Parameters:
stopLine
- HeadwayStopLine; stop line- Returns:
- whether the current phase is 'run' for the given stop line
-
toString
-
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 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
-