Interface PerceivedConflict

All Superinterfaces:
Comparable<PerceivedObject>, Identifiable, PerceivedLaneBasedObject, PerceivedObject
All Known Implementing Classes:
PerceivedConflictFull

public interface PerceivedConflict extends PerceivedLaneBasedObject
Interface for perceived Conflict objects. A standard implementation is provided under of(...) which wraps a Conflict and returns most values as is.

Copyright (c) 2024-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, Wouter Schakel
  • Method Details

    • getConflictType

      ConflictType getConflictType()
      Returns the conflict type.
      Returns:
      conflict type
    • isCrossing

      boolean isCrossing()
      Returns whether this is a crossing conflict.
      Returns:
      whether this is a crossing conflict
    • isMerge

      boolean isMerge()
      Returns whether this is a merge conflict.
      Returns:
      whether this is a merge conflict
    • isSplit

      boolean isSplit()
      Returns whether this is a split conflict.
      Returns:
      whether this is a split conflict
    • getConflictPriority

      ConflictPriority getConflictPriority()
      Returns the conflict priority.
      Returns:
      conflict priority
    • getConflictingLength

      Length getConflictingLength()
      Returns the length of the conflict on the conflicting lane.
      Returns:
      length of the conflict on the conflicting lane
    • getUpstreamConflictingGTUs

      PerceptionCollectable<PerceivedGtu,LaneBasedGtu> getUpstreamConflictingGTUs()
      Returns a set of conflicting GTU's upstream of the start of the conflict ordered close to far from the conflict.
      Returns:
      set of conflicting GTU's upstream of the start of the conflict ordered close to far from the conflict
    • getDownstreamConflictingGTUs

      PerceptionCollectable<PerceivedGtu,LaneBasedGtu> getDownstreamConflictingGTUs()
      Returns a set of conflicting GTU's downstream of the start of the conflict ordered close to far from the conflict. Distance is given relative to the end of the conflict, or null for conflicting vehicles on the conflict. In the latter case the overlap is used.
      Returns:
      set of conflicting GTU's downstream of the start of the conflict ordered close to far from the conflict
    • getConflictingVisibility

      Length getConflictingVisibility()
      Returns the visibility on the conflicting lane within which conflicting vehicles are visible. All upstream conflicting GTUs have a distance smaller than the visibility. Depending on a limited visibility, a certain (lower) speed may be required while approaching the conflict.
      Returns:
      visibility on the conflicting lane within which conflicting vehicles are visible
    • getConflictingSpeedLimit

      Speed getConflictingSpeedLimit()
      Returns the speed limit on the conflicting lane.
      Returns:
      speed limit on the conflicting lane
    • getConflictingLink

      CrossSectionLink getConflictingLink()
      Returns the conflicting link.
      Returns:
      the conflicting link
    • getStopLine

      PerceivedObject getStopLine()
      Returns the stop line.
      Returns:
      stop line
    • getConflictingStopLine

      PerceivedObject getConflictingStopLine()
      Returns the stop line on the conflicting lane.
      Returns:
      stop line
    • getConflictRuleType

      Class<? extends ConflictRule> getConflictRuleType()
      Returns the conflict rule type.
      Returns:
      conflict rule type
    • getConflictingTrafficLightDistance

      Optional<Length> getConflictingTrafficLightDistance()
      Returns the distance of a traffic light upstream on the conflicting lane.
      Returns:
      distance of a traffic light upstream on the conflicting lane, empty if no traffic light
    • isPermitted

      boolean isPermitted()
      Whether the conflict is permitted by the traffic light.
      Returns:
      whether the conflict is permitted by the traffic light
    • getWidthAtFraction

      Length getWidthAtFraction(double fraction)
      Returns the width at the given fraction.
      Parameters:
      fraction - fraction from 0 to 1
      Returns:
      width at the given fraction
    • of

      static PerceivedConflict of(LaneBasedGtu perceivingGtu, Conflict conflict, PerceivedGtuType perceivedGtuType, Length distance, Length conflictingVisibility)
      Returns a standard implementation of this interface that wraps a Conflict and uses a given perceived GTU type to perceive the upstream and downstream GTUs.
      Parameters:
      perceivingGtu - perceiving GTU
      conflict - conflict to perceive
      perceivedGtuType - perceived GTU type
      distance - distance from perceiving GTU to conflict
      conflictingVisibility - visibility range at other conflict
      Returns:
      perceived conflict