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
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 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 AccelerationapproachConflicts(Parameters parameters, Iterable<PerceivedConflict> conflicts, PerceptionCollectable<PerceivedGtu, 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(PerceivedConflict conflict, ConflictUtil.ConflictPlans conflictPlans) Approach an all-stop conflict.static booleanstopForGiveWayConflict(PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, LaneBasedGtu> leaders, Speed speed, Acceleration acceleration, Length vehicleLength, Parameters parameters, SpeedLimitInfo speedLimitInfo, CarFollowingModel carFollowingModel, ParameterTypeAcceleration bType, Length prevEnd) Approach a give-way conflict.static booleanstopForStopConflict(PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, 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, Iterable<PerceivedConflict> conflicts, PerceptionCollectable<PerceivedGtu, 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 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:
parameters- parametersconflicts- set of conflicts to approachleaders- leading vehiclescarFollowingModel- car-following modelvehicleLength- length of vehiclevehicleWidth- width of vehiclespeed- current speedacceleration- current accelerationspeedLimitInfo- speed limit infoconflictPlans- set of plans for conflictgtu- gtulane- 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
-
stopForGiveWayConflict
public static boolean stopForGiveWayConflict(PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, 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- conflictleaders- leadersspeed- current speedacceleration- current accelerationvehicleLength- vehicle lengthparameters- parametersspeedLimitInfo- speed limit infocarFollowingModel- car-following modelbType- 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(PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu, 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- conflictleaders- leadersspeed- current speedacceleration- current accelerationvehicleLength- vehicle lengthparameters- parametersspeedLimitInfo- speed limit infocarFollowingModel- car-following modelbType- 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
-