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:
  • Field Details

  • 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, ParameterException
      Approach conflicts by applying appropriate acceleration (or deceleration). The model may yield for a vehicle even while having priority. Such a plan is remembered in ConflictUtil.ConflictPlans. By forwarding the same ConflictPlans 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
      conflicts - set of conflicts to approach
      leaders - leading vehicles
      carFollowingModel - car-following model
      vehicleLength - length of vehicle
      vehicleWidth - width of vehicle
      speed - current speed
      acceleration - current acceleration
      speedLimitInfo - speed limit info
      conflictPlans - set of plans for conflict
      gtu - gtu
      lane - lane
      Returns:
      acceleration appropriate for approaching the conflicts
      Throws:
      GtuException - in case of an unsupported conflict rule
      ParameterException - 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 ParameterException
      Approach a give-way conflict.
      Parameters:
      conflict - conflict
      leaders - leaders
      speed - current speed
      acceleration - current acceleration
      vehicleLength - vehicle length
      parameters - parameters
      speedLimitInfo - speed limit info
      carFollowingModel - car-following model
      bType - parameter type for considered deceleration
      prevEnd - 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(PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu,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 - conflict
      leaders - leaders
      speed - current speed
      acceleration - current acceleration
      vehicleLength - vehicle length
      parameters - parameters
      speedLimitInfo - speed limit info
      carFollowingModel - car-following model
      bType - parameter type for considered deceleration
      prevEnd - 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(PerceivedConflict conflict, ConflictUtil.ConflictPlans conflictPlans)
      Approach an all-stop conflict.
      Parameters:
      conflict - conflict to approach
      conflictPlans - set of plans for conflict
      Returns:
      whether to stop for this conflict