Class HeadwayConflict

    • Constructor Detail

      • HeadwayConflict

        public HeadwayConflict​(ConflictType conflictType,
                               ConflictPriority conflictPriority,
                               Class<? extends ConflictRule> conflictRuleType,
                               String id,
                               Length distance,
                               Length length,
                               Length conflictingLength,
                               PerceptionCollectable<HeadwayGTU,​LaneBasedGTU> upstreamConflictingGTUs,
                               PerceptionCollectable<HeadwayGTU,​LaneBasedGTU> downstreamConflictingGTUs,
                               Length conflictingVisibility,
                               Speed conflictingSpeedLimit,
                               CrossSectionLink conflictingLink,
                               HeadwayConflict.Width width,
                               HeadwayStopLine stopLine,
                               HeadwayStopLine conflictingStopLine,
                               Lane lane)
                        throws GTUException
        Constructor.
        Parameters:
        conflictType - ConflictType; conflict type
        conflictPriority - ConflictPriority; conflict priority
        conflictRuleType - Class<? extends ConflictRule>; conflict rule type
        id - String; id
        distance - Length; distance
        length - Length; length of the conflict
        conflictingLength - Length; length of the conflict on the conflicting lane
        upstreamConflictingGTUs - PerceptionCollectable<HeadwayGTU,LaneBasedGTU>; conflicting GTU's upstream of the <i>start</i> of the conflict
        downstreamConflictingGTUs - PerceptionCollectable<HeadwayGTU,LaneBasedGTU>; conflicting GTU's downstream of the <i>start</i> of the conflict
        conflictingVisibility - Length; visibility on the conflicting lane within which conflicting vehicles are visible
        conflictingSpeedLimit - Speed; speed limit on the conflicting lane
        conflictingLink - CrossSectionLink; conflicting link
        width - Width; width progression of conflict
        stopLine - HeadwayStopLine; stop line on the own lane
        conflictingStopLine - HeadwayStopLine; stop line on the conflicting lane
        lane - Lane; the lane
        Throws:
        GTUException - when id is null, or parameters are inconsistent
      • HeadwayConflict

        public HeadwayConflict​(ConflictType conflictType,
                               ConflictPriority conflictPriority,
                               Class<? extends ConflictRule> conflictRuleType,
                               String id,
                               Length distance,
                               Length length,
                               Length conflictingLength,
                               PerceptionCollectable<HeadwayGTU,​LaneBasedGTU> upstreamConflictingGTUs,
                               PerceptionCollectable<HeadwayGTU,​LaneBasedGTU> downstreamConflictingGTUs,
                               Length conflictingVisibility,
                               Speed conflictingSpeedLimit,
                               CrossSectionLink conflictingLink,
                               HeadwayConflict.Width width,
                               Lane lane)
                        throws GTUException
        Constructor without stop lines.
        Parameters:
        conflictType - ConflictType; conflict type
        conflictPriority - ConflictPriority; conflict priority
        conflictRuleType - Class<? extends ConflictRule>; conflict rule type
        id - String; id
        distance - Length; distance
        length - Length; length of the conflict
        conflictingLength - Length; length of the conflict on the conflicting lane
        upstreamConflictingGTUs - PerceptionCollectable<HeadwayGTU,LaneBasedGTU>; conflicting GTU's upstream of the <i>start</i> of the conflict
        downstreamConflictingGTUs - PerceptionCollectable<HeadwayGTU,LaneBasedGTU>; conflicting GTU's downstream of the <i>start</i> of the conflict
        conflictingVisibility - Length; visibility on the conflicting lane within which conflicting vehicles are visible
        conflictingSpeedLimit - Speed; speed limit on the conflicting lane
        conflictingLink - CrossSectionLink; conflicting link
        width - Width; width progression of conflict
        lane - Lane; the lane
        Throws:
        GTUException - when id is null, or parameters are inconsistent
    • Method Detail

      • getConflictType

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

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

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

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

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

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

        public final PerceptionCollectable<HeadwayGTU,​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

        public final PerceptionCollectable<HeadwayGTU,​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

        public final 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

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

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

        public final HeadwayStopLine getStopLine()
        Returns the stop line.
        Returns:
        stop line
      • getConflictingStopLine

        public final HeadwayStopLine getConflictingStopLine()
        Returns the stop line on the conflicting lane.
        Returns:
        stop line
      • getConflictRuleType

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

        public final 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, or null if no traffic light
      • isPermitted

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

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

        public final Length getWidthAtFraction​(double fraction)
        Returns the width at the given fraction.
        Parameters:
        fraction - double; fraction from 0 to 1
        Returns:
        Length; width at the given fraction