Class HeadwayConflict
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadway
org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayCopy
org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayLaneBasedObject
org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayConflict
- All Implemented Interfaces:
Serializable
,Comparable<Headway>
,org.djutils.base.Identifiable
,PerceivedObject
,Headway
,HeadwayLaneBasedObject
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Width progression of conflict.Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.perception.headway.Headway
Headway.ObjectType
-
Constructor Summary
ConstructorDescriptionHeadwayConflict
(ConflictType conflictType, ConflictPriority conflictPriority, Class<? extends ConflictRule> conflictRuleType, String id, org.djunits.value.vdouble.scalar.Length distance, org.djunits.value.vdouble.scalar.Length length, org.djunits.value.vdouble.scalar.Length conflictingLength, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> upstreamConflictingGTUs, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> downstreamConflictingGTUs, org.djunits.value.vdouble.scalar.Length conflictingVisibility, org.djunits.value.vdouble.scalar.Speed conflictingSpeedLimit, CrossSectionLink conflictingLink, HeadwayConflict.Width width, HeadwayStopLine stopLine, HeadwayStopLine conflictingStopLine, Lane lane) Constructor.HeadwayConflict
(ConflictType conflictType, ConflictPriority conflictPriority, Class<? extends ConflictRule> conflictRuleType, String id, org.djunits.value.vdouble.scalar.Length distance, org.djunits.value.vdouble.scalar.Length length, org.djunits.value.vdouble.scalar.Length conflictingLength, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> upstreamConflictingGTUs, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> downstreamConflictingGTUs, org.djunits.value.vdouble.scalar.Length conflictingVisibility, org.djunits.value.vdouble.scalar.Speed conflictingSpeedLimit, CrossSectionLink conflictingLink, HeadwayConflict.Width width, Lane lane) Constructor without stop lines. -
Method Summary
Modifier and TypeMethodDescriptionfinal org.djunits.value.vdouble.scalar.Length
Returns the length of the conflict on the conflicting lane.final CrossSectionLink
Returns the conflicting link.final org.djunits.value.vdouble.scalar.Speed
Returns the speed limit on the conflicting lane.final HeadwayStopLine
Returns the stop line on the conflicting lane.final org.djunits.value.vdouble.scalar.Length
Returns the distance of a traffic light upstream on the conflicting lane.final org.djunits.value.vdouble.scalar.Length
Returns the visibility on the conflicting lane within which conflicting vehicles are visible.final ConflictPriority
Returns the conflict priority.final Class<? extends ConflictRule>
Returns the conflict rule type.final ConflictType
Returns the conflict type.Returns a set of conflicting GTU's downstream of the start of the conflict ordered close to far from the conflict.final HeadwayStopLine
Returns the stop line.Returns a set of conflicting GTU's upstream of the start of the conflict ordered close to far from the conflict.final org.djunits.value.vdouble.scalar.Length
getWidthAtFraction
(double fraction) Returns the width at the given fraction.final boolean
Returns whether this is a crossing conflict.final boolean
isMerge()
Returns whether this is a merge conflict.final boolean
Whether the conflict is permitted by the traffic light.final boolean
isSplit()
Returns whether this is a split conflict.final void
setConflictingTrafficLight
(org.djunits.value.vdouble.scalar.Length trafficLightDistance, boolean permittedConflict) Set the distance of a traffic light upstream on the conflicting lane.final String
toString()
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayLaneBasedObject
getLane
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadwayCopy
equals, getAcceleration, getId, getLength, getObjectType, getSpeed, hashCode
Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.headway.AbstractHeadway
getDistance, getOverlap, getOverlapFront, getOverlapRear, isAhead, isBehind, isParallel
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opentrafficsim.road.gtu.lane.perception.headway.Headway
compareTo, getAcceleration, getDistance, getId, getLength, getObjectType, getOverlap, getOverlapFront, getOverlapRear, getSpeed, isAhead, isBehind, isParallel
-
Constructor Details
-
HeadwayConflict
public HeadwayConflict(ConflictType conflictType, ConflictPriority conflictPriority, Class<? extends ConflictRule> conflictRuleType, String id, org.djunits.value.vdouble.scalar.Length distance, org.djunits.value.vdouble.scalar.Length length, org.djunits.value.vdouble.scalar.Length conflictingLength, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> upstreamConflictingGTUs, PerceptionCollectable<HeadwayGtu, throws GtuExceptionLaneBasedGtu> downstreamConflictingGTUs, org.djunits.value.vdouble.scalar.Length conflictingVisibility, org.djunits.value.vdouble.scalar.Speed conflictingSpeedLimit, CrossSectionLink conflictingLink, HeadwayConflict.Width width, HeadwayStopLine stopLine, HeadwayStopLine conflictingStopLine, Lane lane) Constructor.- Parameters:
conflictType
- ConflictType; conflict typeconflictPriority
- ConflictPriority; conflict priorityconflictRuleType
- Class<? extends ConflictRule>; conflict rule typeid
- String; iddistance
- Length; distancelength
- Length; length of the conflictconflictingLength
- Length; length of the conflict on the conflicting laneupstreamConflictingGTUs
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; conflicting GTU's upstream of the <i>start</i> of the conflictdownstreamConflictingGTUs
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; conflicting GTU's downstream of the <i>start</i> of the conflictconflictingVisibility
- Length; visibility on the conflicting lane within which conflicting vehicles are visibleconflictingSpeedLimit
- Speed; speed limit on the conflicting laneconflictingLink
- CrossSectionLink; conflicting linkwidth
- Width; width progression of conflictstopLine
- HeadwayStopLine; stop line on the own laneconflictingStopLine
- HeadwayStopLine; stop line on the conflicting lanelane
- 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, org.djunits.value.vdouble.scalar.Length distance, org.djunits.value.vdouble.scalar.Length length, org.djunits.value.vdouble.scalar.Length conflictingLength, PerceptionCollectable<HeadwayGtu, LaneBasedGtu> upstreamConflictingGTUs, PerceptionCollectable<HeadwayGtu, throws GtuExceptionLaneBasedGtu> downstreamConflictingGTUs, org.djunits.value.vdouble.scalar.Length conflictingVisibility, org.djunits.value.vdouble.scalar.Speed conflictingSpeedLimit, CrossSectionLink conflictingLink, HeadwayConflict.Width width, Lane lane) Constructor without stop lines.- Parameters:
conflictType
- ConflictType; conflict typeconflictPriority
- ConflictPriority; conflict priorityconflictRuleType
- Class<? extends ConflictRule>; conflict rule typeid
- String; iddistance
- Length; distancelength
- Length; length of the conflictconflictingLength
- Length; length of the conflict on the conflicting laneupstreamConflictingGTUs
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; conflicting GTU's upstream of the <i>start</i> of the conflictdownstreamConflictingGTUs
- PerceptionCollectable<HeadwayGtu,LaneBasedGtu>; conflicting GTU's downstream of the <i>start</i> of the conflictconflictingVisibility
- Length; visibility on the conflicting lane within which conflicting vehicles are visibleconflictingSpeedLimit
- Speed; speed limit on the conflicting laneconflictingLink
- CrossSectionLink; conflicting linkwidth
- Width; width progression of conflictlane
- Lane; the lane- Throws:
GtuException
- when id is null, or parameters are inconsistent
-
-
Method Details
-
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
Returns the conflict priority.- Returns:
- conflict priority
-
getConflictingLength
public final org.djunits.value.vdouble.scalar.Length getConflictingLength()Returns the length of the conflict on the conflicting lane.- Returns:
- length of the conflict on the conflicting lane
-
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
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 org.djunits.value.vdouble.scalar.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 org.djunits.value.vdouble.scalar.Speed getConflictingSpeedLimit()Returns the speed limit on the conflicting lane.- Returns:
- speed limit on the conflicting lane
-
getConflictingLink
Returns the conflicting link.- Returns:
- the conflicting link
-
getStopLine
Returns the stop line.- Returns:
- stop line
-
getConflictingStopLine
Returns the stop line on the conflicting lane.- Returns:
- stop line
-
getConflictRuleType
Returns the conflict rule type.- Returns:
- conflict rule type
-
getConflictingTrafficLightDistance
public final org.djunits.value.vdouble.scalar.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(org.djunits.value.vdouble.scalar.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 org.djunits.value.vdouble.scalar.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
-
toString
- Overrides:
toString
in classAbstractHeadway
-