Class ConflictUtil
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.util.ConflictUtil
-
public final class ConflictUtil extends 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 class
ConflictUtil.ConflictPlans
Holds the tactical plans of a driver considering conflicts.
-
Field Summary
Fields Modifier and Type Field Description static ParameterTypeAcceleration
B
Comfortable deceleration.static ParameterTypeAcceleration
BCRIT
Critical deceleration.static ParameterTypeDuration
MIN_GAP
Minimum time gap between events.static ParameterTypeLength
S0
Stopping distance.static ParameterTypeLength
S0_CONF
Stopping distance at conflicts.static ParameterTypeLength
STOP_AREA
Area before stop line where one is considered arrived at the intersection.static ParameterTypeDuration
TI
Parameter of how much time before departure a bus indicates its departure to get priority.static ParameterTypeDouble
TIME_FACTOR
Multiplication factor on time for conservative assessment.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Acceleration
approachConflicts(Parameters parameters, 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 boolean
stopForAllStopConflict(HeadwayConflict conflict, ConflictUtil.ConflictPlans conflictPlans)
Approach an all-stop conflict.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)
Approach a give-way conflict.static boolean
stopForPriorityConflict(HeadwayConflict conflict, PerceptionCollectable<HeadwayGTU,LaneBasedGTU> leaders, Speed speed, Length vehicleLength, Parameters parameters, Length prevEnd)
Approach a priority conflict.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)
Approach a stop conflict.
-
-
-
Field Detail
-
MIN_GAP
public static final ParameterTypeDuration MIN_GAP
Minimum time gap between events.
-
B
public static final ParameterTypeAcceleration B
Comfortable deceleration.
-
BCRIT
public static final ParameterTypeAcceleration BCRIT
Critical deceleration.
-
S0
public static final ParameterTypeLength S0
Stopping distance.
-
S0_CONF
public static final ParameterTypeLength S0_CONF
Stopping distance at conflicts.
-
TIME_FACTOR
public static final ParameterTypeDouble TIME_FACTOR
Multiplication factor on time for conservative assessment.
-
STOP_AREA
public static final ParameterTypeLength STOP_AREA
Area before stop line where one is considered arrived at the intersection.
-
TI
public static final ParameterTypeDuration TI
Parameter of how much time before departure a bus indicates its departure to get priority.
-
-
Method Detail
-
approachConflicts
public static Acceleration approachConflicts(Parameters parameters, 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, ParameterException
Approach 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 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 ParameterException
Approach 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:
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 ParameterException
Approach 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:
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 ParameterException
Approach 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:
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
-
-