Interface PerceivedConflict
- All Superinterfaces:
Comparable<PerceivedObject>,Identifiable,PerceivedLaneBasedObject,PerceivedObject
- All Known Implementing Classes:
PerceivedConflictFull
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.perception.object.PerceivedObject
PerceivedObject.Kinematics, PerceivedObject.ObjectType -
Method Summary
Modifier and TypeMethodDescriptionReturns the length of the conflict on the conflicting lane.Returns the conflicting link.Returns the speed limit on the conflicting lane.Returns the stop line on the conflicting lane.Returns the distance of a traffic light upstream on the conflicting lane.Returns the visibility on the conflicting lane within which conflicting vehicles are visible.Returns the conflict priority.Class<? extends ConflictRule>Returns the conflict rule type.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.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.getWidthAtFraction(double fraction) Returns the width at the given fraction.booleanReturns whether this is a crossing conflict.booleanisMerge()Returns whether this is a merge conflict.booleanWhether the conflict is permitted by the traffic light.booleanisSplit()Returns whether this is a split conflict.static PerceivedConflictof(LaneBasedGtu perceivingGtu, Conflict conflict, PerceivedGtuType perceivedGtuType, Length distance, Length conflictingVisibility) Returns a standard implementation of this interface that wraps aConflictand uses a given perceived GTU type to perceive the upstream and downstream GTUs.Methods inherited from interface org.djutils.base.Identifiable
getIdMethods inherited from interface org.opentrafficsim.road.gtu.lane.perception.object.PerceivedLaneBasedObject
getLaneMethods inherited from interface org.opentrafficsim.road.gtu.lane.perception.object.PerceivedObject
compareTo, getAcceleration, getDistance, getKinematics, getLength, getObjectType, getSpeed
-
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
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
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 aConflictand uses a given perceived GTU type to perceive the upstream and downstream GTUs.- Parameters:
perceivingGtu- perceiving GTUconflict- conflict to perceiveperceivedGtuType- perceived GTU typedistance- distance from perceiving GTU to conflictconflictingVisibility- visibility range at other conflict- Returns:
- perceived conflict
-