Class ConflictUtil
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.ConflictUtil
This class implements default behavior for intersection conflicts for use in tactical planners.
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Holds the tactical plans of a driver considering conflicts. -
Field Summary
Modifier and TypeFieldDescriptionstatic final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Comfortable deceleration.static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Critical deceleration.static final org.opentrafficsim.base.parameters.ParameterTypeDuration
Minimum time gap between events.static final org.opentrafficsim.base.parameters.ParameterTypeLength
Stopping distance.static final org.opentrafficsim.base.parameters.ParameterTypeLength
Stopping distance at conflicts.static final org.opentrafficsim.base.parameters.ParameterTypeLength
Area before stop line where one is considered arrived at the intersection.static final org.opentrafficsim.base.parameters.ParameterTypeDuration
Parameter of how much time before departure a bus indicates its departure to get priority.static final org.opentrafficsim.base.parameters.ParameterTypeDouble
Multiplication factor on time for conservative assessment. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.djunits.value.vdouble.scalar.Acceleration
approachConflicts
(org.opentrafficsim.base.parameters.Parameters parameters, Iterable<HeadwayConflict> conflicts, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, CarFollowingModel carFollowingModel, org.djunits.value.vdouble.scalar.Length vehicleLength, org.djunits.value.vdouble.scalar.Length vehicleWidth, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, SpeedLimitInfo speedLimitInfo, ConflictUtil.ConflictPlans conflictPlans, LaneBasedGtu gtu, RelativeLane lane) Approach conflicts by applying appropriate acceleration (or deceleration).static boolean
stopForAllStopConflict
(HeadwayConflict conflict, ConflictUtil.ConflictPlans conflictPlans) Approach an all-stop conflict.static boolean
stopForGiveWayConflict
(HeadwayConflict conflict, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Length vehicleLength, org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, org.opentrafficsim.base.parameters.ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) Approach a give-way conflict.static boolean
stopForPriorityConflict
(HeadwayConflict conflict, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Length vehicleLength, org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Length prevEnd) Approach a priority conflict.static boolean
stopForStopConflict
(HeadwayConflict conflict, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Length vehicleLength, org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, org.opentrafficsim.base.parameters.ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) Approach a stop conflict.
-
Field Details
-
MIN_GAP
public static final org.opentrafficsim.base.parameters.ParameterTypeDuration MIN_GAPMinimum time gap between events. -
B
public static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BComfortable deceleration. -
BCRIT
public static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BCRITCritical deceleration. -
S0
public static final org.opentrafficsim.base.parameters.ParameterTypeLength S0Stopping distance. -
S0_CONF
public static final org.opentrafficsim.base.parameters.ParameterTypeLength S0_CONFStopping distance at conflicts. -
TIME_FACTOR
public static final org.opentrafficsim.base.parameters.ParameterTypeDouble TIME_FACTORMultiplication factor on time for conservative assessment. -
STOP_AREA
public static final org.opentrafficsim.base.parameters.ParameterTypeLength STOP_AREAArea before stop line where one is considered arrived at the intersection. -
TI
public static final org.opentrafficsim.base.parameters.ParameterTypeDuration TIParameter of how much time before departure a bus indicates its departure to get priority.
-
-
Method Details
-
approachConflicts
public static org.djunits.value.vdouble.scalar.Acceleration approachConflicts(org.opentrafficsim.base.parameters.Parameters parameters, Iterable<HeadwayConflict> conflicts, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, CarFollowingModel carFollowingModel, org.djunits.value.vdouble.scalar.Length vehicleLength, org.djunits.value.vdouble.scalar.Length vehicleWidth, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, SpeedLimitInfo speedLimitInfo, ConflictUtil.ConflictPlans conflictPlans, LaneBasedGtu gtu, RelativeLane lane) throws GtuException, org.opentrafficsim.base.parameters.ParameterExceptionApproach conflicts by applying appropriate acceleration (or deceleration). The model may yield for a vehicle even while having priority. Such a 'yield plan' is remembered inYieldPlans
. By forwarding the sameYieldPlans
for 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:
parameters
- Parameters; parametersconflicts
- PerceptionCollectable<HeadwayConflict,Conflict>; set of conflicts to approachleaders
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leading vehiclescarFollowingModel
- CarFollowingModel; car-following modelvehicleLength
- Length; length of vehiclevehicleWidth
- Length; width of vehiclespeed
- Speed; current speedacceleration
- Acceleration; current accelerationspeedLimitInfo
- SpeedLimitInfo; speed limit infoconflictPlans
- ConflictPlans; set of plans for conflictgtu
- LaneBasedGtu; gtulane
- RelativeLane; lane- Returns:
- acceleration appropriate for approaching the conflicts
- Throws:
GtuException
- in case of an unsupported conflict ruleorg.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined or out of bounds
-
stopForPriorityConflict
public static boolean stopForPriorityConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Length vehicleLength, org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Length prevEnd) throws org.opentrafficsim.base.parameters.ParameterExceptionApproach a priority conflict. Stopping is applied to give way to conflicting traffic in case congestion is present on the own lane. This is courtesy yielding.- Parameters:
conflict
- HeadwayConflict; conflict to approachleaders
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leading vehicles in own lanespeed
- Speed; current speedvehicleLength
- Length; vehicle lengthparameters
- Parameters; parametersprevEnd
- Length; distance to end of previous conflict that should not be blocked,null
if none- Returns:
- whether to stop for this conflict
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- if parameter B is not defined
-
stopForGiveWayConflict
public static boolean stopForGiveWayConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Length vehicleLength, org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, org.opentrafficsim.base.parameters.ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) throws org.opentrafficsim.base.parameters.ParameterExceptionApproach a give-way conflict.- Parameters:
conflict
- HeadwayConflict; conflictleaders
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leadersspeed
- Speed; current speedacceleration
- Acceleration; current accelerationvehicleLength
- Length; vehicle lengthparameters
- Parameters; parametersspeedLimitInfo
- SpeedLimitInfo; speed limit infocarFollowingModel
- CarFollowingModel; car-following modelbType
- ParameterTypeAcceleration; parameter type for considered decelerationprevEnd
- Length; distance to end of previous conflict that should not be blocked,null
if none- Returns:
- whether to stop for this conflict
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined
-
stopForStopConflict
public static boolean stopForStopConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> leaders, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Length vehicleLength, org.opentrafficsim.base.parameters.Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, org.opentrafficsim.base.parameters.ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) throws org.opentrafficsim.base.parameters.ParameterExceptionApproach a stop conflict. Currently this is equal to approaching a give-way conflict.- Parameters:
conflict
- HeadwayConflict; conflictleaders
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leadersspeed
- Speed; current speedacceleration
- Acceleration; current accelerationvehicleLength
- Length; vehicle lengthparameters
- Parameters; parametersspeedLimitInfo
- SpeedLimitInfo; speed limit infocarFollowingModel
- CarFollowingModel; car-following modelbType
- ParameterTypeAcceleration; parameter type for considered decelerationprevEnd
- Length; distance to end of previous conflict that should not be blocked,null
if none- Returns:
- whether to stop for this conflict
- Throws:
org.opentrafficsim.base.parameters.ParameterException
- if a parameter is not defined
-
stopForAllStopConflict
public static boolean stopForAllStopConflict(HeadwayConflict conflict, ConflictUtil.ConflictPlans conflictPlans) Approach an all-stop conflict.- Parameters:
conflict
- HeadwayConflict; conflict to approachconflictPlans
- ConflictPlans; set of plans for conflict- Returns:
- whether to stop for this conflict
-