Class ConflictUtil
java.lang.Object
org.opentrafficsim.road.gtu.tactical.util.ConflictUtil
This class implements default behavior for intersection conflicts for use in tactical planners.
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
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHolds the tactical plans of a driver considering conflicts. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterTypeAccelerationComfortable deceleration.static final ParameterTypeAccelerationCritical deceleration.static final ParameterTypeBooleanParameter to deviate laterally at splits.static final ParameterTypeDurationMinimum time gap between events.static final ParameterTypeLengthStopping distance.static final ParameterTypeLengthStopping distance at conflicts.static final ParameterTypeLengthArea before stop line where one is considered arrived at the intersection.static final ParameterTypeDurationParameter of how much time before departure a bus indicates its departure to get priority.static final ParameterTypeDoubleMultiplication factor on time for conservative assessment. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.djunits.value.vdouble.scalar.AccelerationapproachConflicts(TacticalContextEgo context, ConflictUtil.ConflictPlans conflictPlans, RelativeLane lane, org.djunits.value.vdouble.scalar.Length mergeDistance, boolean onRoute) Approach conflicts by applying appropriate acceleration (or deceleration).static booleanstopForAllStopConflict(PerceivedConflict conflict, ConflictUtil.ConflictPlans conflictPlans) Approach an all-stop conflict.static booleanstopForGiveWayConflict(TacticalContext context, PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) Approach a give-way conflict.static booleanstopForStopConflict(TacticalContext context, PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) Approach a stop conflict.
-
Field Details
-
MIN_GAP
Minimum time gap between events. -
B
Comfortable deceleration. -
BCRIT
Critical deceleration. -
S0
Stopping distance. -
S0_CONF
Stopping distance at conflicts. -
TIME_FACTOR
Multiplication factor on time for conservative assessment. -
STOP_AREA
Area before stop line where one is considered arrived at the intersection. -
TI
Parameter of how much time before departure a bus indicates its departure to get priority. -
DEV_SPLIT
Parameter to deviate laterally at splits.
-
-
Method Details
-
approachConflicts
public static org.djunits.value.vdouble.scalar.Acceleration approachConflicts(TacticalContextEgo context, ConflictUtil.ConflictPlans conflictPlans, RelativeLane lane, org.djunits.value.vdouble.scalar.Length mergeDistance, boolean onRoute) throws GtuException, ParameterException Approach conflicts by applying appropriate acceleration (or deceleration). The model may yield for a vehicle even while having priority. Such a plan is remembered inConflictUtil.ConflictPlans. By forwarding the sameConflictPlansfor a GTU consistency of such plans is provided. If any conflict is not accepted to pass, stopping before a more upstream conflict is applied if there is not sufficient stopping length in between conflicts.- Parameters:
context- tactical information such as parameters and car-following modelconflictPlans- set of plans for conflictlane- lanemergeDistance- distance along which no lane changes can be performed towards the laneonRoute- filter conflicts to only include conflict on the route- Returns:
- acceleration appropriate for approaching the conflicts
- Throws:
GtuException- in case of an unsupported conflict ruleParameterException- if a parameter is not defined or out of bounds
-
stopForGiveWayConflict
public static boolean stopForGiveWayConflict(TacticalContext context, PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) throws ParameterExceptionApproach a give-way conflict.- Parameters:
context- tactical information such as parameters and car-following modelconflict- conflictleaders- leadersbType- parameter type for considered decelerationprevEnd- distance to end of previous conflict that should not be blocked,nullif none- Returns:
- whether to stop for this conflict
- Throws:
ParameterException- if a parameter is not defined
-
stopForStopConflict
public static boolean stopForStopConflict(TacticalContext context, PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) throws ParameterExceptionApproach a stop conflict. Currently this is equal to approaching a give-way conflict.- Parameters:
context- tactical information such as parameters and car-following modelconflict- conflictleaders- leadersbType- parameter type for considered decelerationprevEnd- distance to end of previous conflict that should not be blocked,nullif none- Returns:
- whether to stop for this conflict
- Throws:
ParameterException- if a parameter is not defined
-
stopForAllStopConflict
public static boolean stopForAllStopConflict(PerceivedConflict conflict, ConflictUtil.ConflictPlans conflictPlans) Approach an all-stop conflict.- Parameters:
conflict- conflict to approachconflictPlans- set of plans for conflict- Returns:
- whether to stop for this conflict
-