Class ConflictUtil

java.lang.Object
org.opentrafficsim.road.gtu.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-2026 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 org.djunits.value.vdouble.scalar.Acceleration approachConflicts(TacticalContextEgo context, ConflictUtil.ConflictPlans conflictPlans, RelativeLane lane, org.djunits.value.vdouble.scalar.Length mergeDistance, boolean onRoute) 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:
      context - tactical information such as parameters and car-following model
      conflictPlans - set of plans for conflict
      lane - lane
      mergeDistance - distance along which no lane changes can be performed towards the lane
      onRoute - filter conflicts to only include conflict on the route
      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(TacticalContext context, PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu,LaneBasedGtu> leaders, ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) throws ParameterException
      Approach a give-way conflict.
      Parameters:
      context - tactical information such as parameters and car-following model
      conflict - conflict
      leaders - leaders
      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(TacticalContext context, PerceivedConflict conflict, PerceptionCollectable<PerceivedGtu,LaneBasedGtu> leaders, ParameterTypeAcceleration bType, org.djunits.value.vdouble.scalar.Length prevEnd) throws ParameterException
      Approach a stop conflict. Currently this is equal to approaching a give-way conflict.
      Parameters:
      context - tactical information such as parameters and car-following model
      conflict - conflict
      leaders - leaders
      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