Class PerceivedConflictFull

All Implemented Interfaces:
Comparable<PerceivedObject>, Identifiable, PerceivedConflict, PerceivedLaneBasedObject, PerceivedObject

public class PerceivedConflictFull extends PerceivedLaneBasedObjectBase implements PerceivedConflict
Perceived intersection conflict with given input values.

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
  • Constructor Details

    • PerceivedConflictFull

      public PerceivedConflictFull(String id, Length distance, Length length, ConflictType conflictType, ConflictPriority conflictPriority, Class<? extends ConflictRule> conflictRuleType, Length conflictingLength, PerceptionCollectable<PerceivedGtu,LaneBasedGtu> upstreamConflictingGTUs, PerceptionCollectable<PerceivedGtu,LaneBasedGtu> downstreamConflictingGTUs, Length conflictingVisibility, Speed conflictingSpeedLimit, CrossSectionLink conflictingLink, PerceivedConflictFull.Width width, PerceivedObject stopLine, PerceivedObject conflictingStopLine, Lane lane)
      Constructor.
      Parameters:
      id - id
      distance - distance to conflict
      length - length of the conflict
      conflictType - conflict type
      conflictPriority - conflict priority
      conflictRuleType - conflict rule type
      conflictingLength - length of the conflict on the conflicting lane
      upstreamConflictingGTUs - conflicting GTU's upstream of the <i>start</i> of the conflict
      downstreamConflictingGTUs - conflicting GTU's downstream of the <i>start</i> of the conflict
      conflictingVisibility - visibility on the conflicting lane within which conflicting vehicles are visible
      conflictingSpeedLimit - speed limit on the conflicting lane
      conflictingLink - conflicting link
      width - width progression of conflict
      stopLine - stop line on the own lane
      conflictingStopLine - stop line on the conflicting lane
      lane - the lane
  • Method Details

    • getConflictType

      public ConflictType getConflictType()
      Returns the conflict type.
      Specified by:
      getConflictType in interface PerceivedConflict
      Returns:
      conflict type
    • isCrossing

      public boolean isCrossing()
      Returns whether this is a crossing conflict.
      Specified by:
      isCrossing in interface PerceivedConflict
      Returns:
      whether this is a crossing conflict
    • isMerge

      public boolean isMerge()
      Returns whether this is a merge conflict.
      Specified by:
      isMerge in interface PerceivedConflict
      Returns:
      whether this is a merge conflict
    • isSplit

      public boolean isSplit()
      Returns whether this is a split conflict.
      Specified by:
      isSplit in interface PerceivedConflict
      Returns:
      whether this is a split conflict
    • getConflictPriority

      public ConflictPriority getConflictPriority()
      Returns the conflict priority.
      Specified by:
      getConflictPriority in interface PerceivedConflict
      Returns:
      conflict priority
    • getConflictingLength

      public Length getConflictingLength()
      Returns the length of the conflict on the conflicting lane.
      Specified by:
      getConflictingLength in interface PerceivedConflict
      Returns:
      length of the conflict on the conflicting lane
    • getUpstreamConflictingGTUs

      public 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.
      Specified by:
      getUpstreamConflictingGTUs in interface PerceivedConflict
      Returns:
      set of conflicting GTU's upstream of the start of the conflict ordered close to far from the conflict
    • getDownstreamConflictingGTUs

      public 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.
      Specified by:
      getDownstreamConflictingGTUs in interface PerceivedConflict
      Returns:
      set of conflicting GTU's downstream of the start of the conflict ordered close to far from the conflict
    • getConflictingVisibility

      public 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.
      Specified by:
      getConflictingVisibility in interface PerceivedConflict
      Returns:
      visibility on the conflicting lane within which conflicting vehicles are visible
    • getConflictingSpeedLimit

      public Speed getConflictingSpeedLimit()
      Returns the speed limit on the conflicting lane.
      Specified by:
      getConflictingSpeedLimit in interface PerceivedConflict
      Returns:
      speed limit on the conflicting lane
    • getConflictingLink

      public CrossSectionLink getConflictingLink()
      Returns the conflicting link.
      Specified by:
      getConflictingLink in interface PerceivedConflict
      Returns:
      the conflicting link
    • getStopLine

      public PerceivedObject getStopLine()
      Returns the stop line.
      Specified by:
      getStopLine in interface PerceivedConflict
      Returns:
      stop line
    • getConflictingStopLine

      public PerceivedObject getConflictingStopLine()
      Returns the stop line on the conflicting lane.
      Specified by:
      getConflictingStopLine in interface PerceivedConflict
      Returns:
      stop line
    • getConflictRuleType

      public Class<? extends ConflictRule> getConflictRuleType()
      Returns the conflict rule type.
      Specified by:
      getConflictRuleType in interface PerceivedConflict
      Returns:
      conflict rule type
    • getConflictingTrafficLightDistance

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

      public boolean isPermitted()
      Whether the conflict is permitted by the traffic light.
      Specified by:
      isPermitted in interface PerceivedConflict
      Returns:
      whether the conflict is permitted by the traffic light
    • setConflictingTrafficLight

      public void setConflictingTrafficLight(Length trafficLightDistance, boolean permittedConflict)
      Set the distance of a traffic light upstream on the conflicting lane.
      Parameters:
      trafficLightDistance - distance of a traffic light upstream on the conflicting lane.
      permittedConflict - whether the conflict is permitted by the traffic light
    • getWidthAtFraction

      public Length getWidthAtFraction(double fraction)
      Returns the width at the given fraction.
      Specified by:
      getWidthAtFraction in interface PerceivedConflict
      Parameters:
      fraction - fraction from 0 to 1
      Returns:
      width at the given fraction
    • toString

      public final String toString()
      Description copied from class: PerceivedLaneBasedObjectBase
      Overrides:
      toString in class PerceivedLaneBasedObjectBase