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-2024 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 Classes
    Modifier and Type
    Class
    Description
    static final class 
    Holds the tactical plans of a driver considering conflicts.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 Type
    Method
    Description
    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)
    Approach conflicts by applying appropriate acceleration (or deceleration).
    static boolean
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_GAP

      public static final org.opentrafficsim.base.parameters.ParameterTypeDuration MIN_GAP
      Minimum time gap between events.
    • B

      public static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration B
      Comfortable deceleration.
    • BCRIT

      public static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BCRIT
      Critical deceleration.
    • S0

      public static final org.opentrafficsim.base.parameters.ParameterTypeLength S0
      Stopping distance.
    • S0_CONF

      public static final org.opentrafficsim.base.parameters.ParameterTypeLength S0_CONF
      Stopping distance at conflicts.
    • TIME_FACTOR

      public static final org.opentrafficsim.base.parameters.ParameterTypeDouble TIME_FACTOR
      Multiplication factor on time for conservative assessment.
    • STOP_AREA

      public static final org.opentrafficsim.base.parameters.ParameterTypeLength STOP_AREA
      Area before stop line where one is considered arrived at the intersection.
    • TI

      public static final org.opentrafficsim.base.parameters.ParameterTypeDuration TI
      Parameter 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.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 in YieldPlans. By forwarding the same YieldPlans 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; parameters
      conflicts - PerceptionCollectable<HeadwayConflict,Conflict>; set of conflicts to approach
      leaders - PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leading vehicles
      carFollowingModel - CarFollowingModel; car-following model
      vehicleLength - Length; length of vehicle
      vehicleWidth - Length; width of vehicle
      speed - Speed; current speed
      acceleration - Acceleration; current acceleration
      speedLimitInfo - SpeedLimitInfo; speed limit info
      conflictPlans - ConflictPlans; set of plans for conflict
      gtu - LaneBasedGtu; gtu
      lane - RelativeLane; lane
      Returns:
      acceleration appropriate for approaching the conflicts
      Throws:
      GtuException - in case of an unsupported conflict rule
      org.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.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 approach
      leaders - PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leading vehicles in own lane
      speed - Speed; current speed
      vehicleLength - Length; vehicle length
      parameters - Parameters; parameters
      prevEnd - 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.ParameterException
      Approach a give-way conflict.
      Parameters:
      conflict - HeadwayConflict; conflict
      leaders - PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leaders
      speed - Speed; current speed
      acceleration - Acceleration; current acceleration
      vehicleLength - Length; vehicle length
      parameters - Parameters; parameters
      speedLimitInfo - SpeedLimitInfo; speed limit info
      carFollowingModel - CarFollowingModel; car-following model
      bType - ParameterTypeAcceleration; parameter type for considered deceleration
      prevEnd - 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.ParameterException
      Approach a stop conflict. Currently this is equal to approaching a give-way conflict.
      Parameters:
      conflict - HeadwayConflict; conflict
      leaders - PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; leaders
      speed - Speed; current speed
      acceleration - Acceleration; current acceleration
      vehicleLength - Length; vehicle length
      parameters - Parameters; parameters
      speedLimitInfo - SpeedLimitInfo; speed limit info
      carFollowingModel - CarFollowingModel; car-following model
      bType - ParameterTypeAcceleration; parameter type for considered deceleration
      prevEnd - 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 approach
      conflictPlans - ConflictPlans; set of plans for conflict
      Returns:
      whether to stop for this conflict