Class PerceivedConflictFull
java.lang.Object
org.opentrafficsim.road.gtu.lane.perception.object.PerceivedObjectBase
org.opentrafficsim.road.gtu.lane.perception.object.PerceivedLaneBasedObjectBase
org.opentrafficsim.road.gtu.lane.perception.object.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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classWidth progression of conflict.Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.lane.perception.object.PerceivedObject
PerceivedObject.Kinematics, PerceivedObject.ObjectType -
Constructor Summary
ConstructorsConstructorDescriptionPerceivedConflictFull(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. -
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.voidsetConflictingTrafficLight(Length trafficLightDistance, boolean permittedConflict) Set the distance of a traffic light upstream on the conflicting lane.final StringtoString()Methods inherited from class org.opentrafficsim.road.gtu.lane.perception.object.PerceivedLaneBasedObjectBase
equals, getLane, hashCodeMethods inherited from class org.opentrafficsim.road.gtu.lane.perception.object.PerceivedObjectBase
getId, getKinematics, getLength, getObjectTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
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- iddistance- distance to conflictlength- length of the conflictconflictType- conflict typeconflictPriority- conflict priorityconflictRuleType- conflict rule typeconflictingLength- length of the conflict on the conflicting laneupstreamConflictingGTUs- conflicting GTU's upstream of the <i>start</i> of the conflictdownstreamConflictingGTUs- conflicting GTU's downstream of the <i>start</i> of the conflictconflictingVisibility- visibility on the conflicting lane within which conflicting vehicles are visibleconflictingSpeedLimit- speed limit on the conflicting laneconflictingLink- conflicting linkwidth- width progression of conflictstopLine- stop line on the own laneconflictingStopLine- stop line on the conflicting lanelane- the lane
-
-
Method Details
-
getConflictType
Returns the conflict type.- Specified by:
getConflictTypein interfacePerceivedConflict- Returns:
- conflict type
-
isCrossing
public boolean isCrossing()Returns whether this is a crossing conflict.- Specified by:
isCrossingin interfacePerceivedConflict- Returns:
- whether this is a crossing conflict
-
isMerge
public boolean isMerge()Returns whether this is a merge conflict.- Specified by:
isMergein interfacePerceivedConflict- Returns:
- whether this is a merge conflict
-
isSplit
public boolean isSplit()Returns whether this is a split conflict.- Specified by:
isSplitin interfacePerceivedConflict- Returns:
- whether this is a split conflict
-
getConflictPriority
Returns the conflict priority.- Specified by:
getConflictPriorityin interfacePerceivedConflict- Returns:
- conflict priority
-
getConflictingLength
Returns the length of the conflict on the conflicting lane.- Specified by:
getConflictingLengthin interfacePerceivedConflict- 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.- Specified by:
getUpstreamConflictingGTUsin interfacePerceivedConflict- 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.- Specified by:
getDownstreamConflictingGTUsin interfacePerceivedConflict- Returns:
- set of conflicting GTU's downstream of the start of the conflict ordered close to far from the conflict
-
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:
getConflictingVisibilityin interfacePerceivedConflict- Returns:
- visibility on the conflicting lane within which conflicting vehicles are visible
-
getConflictingSpeedLimit
Returns the speed limit on the conflicting lane.- Specified by:
getConflictingSpeedLimitin interfacePerceivedConflict- Returns:
- speed limit on the conflicting lane
-
getConflictingLink
Returns the conflicting link.- Specified by:
getConflictingLinkin interfacePerceivedConflict- Returns:
- the conflicting link
-
getStopLine
Returns the stop line.- Specified by:
getStopLinein interfacePerceivedConflict- Returns:
- stop line
-
getConflictingStopLine
Returns the stop line on the conflicting lane.- Specified by:
getConflictingStopLinein interfacePerceivedConflict- Returns:
- stop line
-
getConflictRuleType
Returns the conflict rule type.- Specified by:
getConflictRuleTypein interfacePerceivedConflict- Returns:
- conflict rule type
-
getConflictingTrafficLightDistance
Returns the distance of a traffic light upstream on the conflicting lane.- Specified by:
getConflictingTrafficLightDistancein interfacePerceivedConflict- 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:
isPermittedin interfacePerceivedConflict- Returns:
- whether the conflict is permitted by the traffic light
-
setConflictingTrafficLight
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
Returns the width at the given fraction.- Specified by:
getWidthAtFractionin interfacePerceivedConflict- Parameters:
fraction- fraction from 0 to 1- Returns:
- width at the given fraction
-
toString
Description copied from class:PerceivedLaneBasedObjectBase- Overrides:
toStringin classPerceivedLaneBasedObjectBase
-