Class ConflictUtil
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.ConflictUtil
public final class ConflictUtil
extends java.lang.Object
This class implements default behavior for intersection conflicts for use in tactical planners.
Copyright (c) 2013-2020 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 3, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConflictUtil.ConflictPlansHolds the tactical plans of a driver considering conflicts. -
Field Summary
Fields Modifier and Type Field Description static ParameterTypeAccelerationBComfortable deceleration.static ParameterTypeAccelerationBCRITCritical deceleration.static ParameterTypeDurationMIN_GAPMinimum time gap between events.static ParameterTypeLengthS0Stopping distance.static ParameterTypeLengthS0_CONFStopping distance at conflicts.static ParameterTypeLengthSTOP_AREAArea before stop line where one is considered arrived at the intersection.static ParameterTypeDurationTIParameter of how much time before departure a bus indicates its departure to get priority.static ParameterTypeDoubleTIME_FACTORMultiplication factor on time for conservative assessment. -
Method Summary
Modifier and Type Method Description static AccelerationapproachConflicts(Parameters parameters, java.lang.Iterable<HeadwayConflict> conflicts, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, CarFollowingModel carFollowingModel, Length vehicleLength, Length vehicleWidth, Speed speed, Acceleration acceleration, SpeedLimitInfo speedLimitInfo, ConflictUtil.ConflictPlans conflictPlans, LaneBasedGTU gtu, RelativeLane lane)Approach conflicts by applying appropriate acceleration (or deceleration).static booleanstopForAllStopConflict(HeadwayConflict conflict, ConflictUtil.ConflictPlans conflictPlans)Approach an all-stop conflict.static booleanstopForGiveWayConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Acceleration acceleration, Length vehicleLength, Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, ParameterTypeAcceleration bType, Length prevEnd)Approach a give-way conflict.static booleanstopForPriorityConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Length vehicleLength, Parameters parameters, Length prevEnd)Approach a priority conflict.static booleanstopForStopConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Acceleration acceleration, Length vehicleLength, Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, ParameterTypeAcceleration bType, 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.
-
-
Method Details
-
approachConflicts
public static Acceleration approachConflicts(Parameters parameters, java.lang.Iterable<HeadwayConflict> conflicts, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, CarFollowingModel carFollowingModel, Length vehicleLength, Length vehicleWidth, Speed speed, Acceleration acceleration, SpeedLimitInfo speedLimitInfo, ConflictUtil.ConflictPlans conflictPlans, LaneBasedGTU gtu, RelativeLane lane) throws GTUException, 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 sameYieldPlansfor 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 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 ruleParameterException- if a parameter is not defined or out of bounds
-
stopForPriorityConflict
public static boolean stopForPriorityConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Length vehicleLength, Parameters parameters, Length prevEnd) throws 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,nullif none- Returns:
- whether to stop for this conflict
- Throws:
ParameterException- if parameter B is not defined
-
stopForGiveWayConflict
public static boolean stopForGiveWayConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Acceleration acceleration, Length vehicleLength, Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, ParameterTypeAcceleration bType, Length prevEnd) throws 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,nullif none- Returns:
- whether to stop for this conflict
- Throws:
ParameterException- if a parameter is not defined
-
stopForStopConflict
public static boolean stopForStopConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Acceleration acceleration, Length vehicleLength, Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, ParameterTypeAcceleration bType, Length prevEnd) throws 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,nullif none- Returns:
- whether to stop for this conflict
- Throws:
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
-