public final class Conflict extends AbstractLaneBasedObject
Conflict
represents the one-sided consideration of a conflicting situation. I.e., what is
considered a single conflict in traffic theory, is represented by two Conflict
s, one on each of the
conflicting Lane
s.PerceptionIterable
s using methods
getUpstreamGtus
and getDownstreamGtus
. These methods are efficient in that they reuse underlying data
structures if the GTUs are requested at the same time by another GTU.
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Class and Description |
---|---|
class |
Conflict.ConflictEnd
Light-weight lane based object to indicate the end of a conflict.
|
listeners
FIRST_POSITION, LAST_POSITION
Modifier and Type | Method and Description |
---|---|
Conflict |
clone(CrossSectionElement newCSE,
SimulatorInterface.TimeDoubleUnit newSimulator,
boolean animation)
Clone the LaneBasedObject for e.g., copying a network.
|
ConflictPriority |
conflictPriority() |
static void |
generateConflictPair(ConflictType conflictType,
ConflictRule conflictRule,
boolean permitted,
Lane lane1,
Length longitudinalPosition1,
Length length1,
GTUDirectionality direction1,
OTSLine3D geometry1,
GTUType gtuType1,
Lane lane2,
Length longitudinalPosition2,
Length length2,
GTUDirectionality direction2,
OTSLine3D geometry2,
GTUType gtuType2,
DEVSSimulatorInterface.TimeDoubleUnit simulator)
Creates a pair of conflicts.
|
ConflictRule |
getConflictRule() |
ConflictType |
getConflictType() |
PerceptionCollectable<HeadwayGTU,LaneBasedGTU> |
getDownstreamGtus(LaneBasedGTU perceivingGtu,
HeadwayGtuType headwayGtuType,
Length visibility)
Provides the downstream GTUs.
|
GTUType |
getGtuType() |
Length |
getLength() |
Conflict |
getOtherConflict() |
PerceptionCollectable<HeadwayGTU,LaneBasedGTU> |
getUpstreamGtus(LaneBasedGTU perceivingGtu,
HeadwayGtuType headwayGtuType,
Length visibility)
Provides the upstream GTUs.
|
boolean |
isPermitted()
If permitted, traffic upstream of traffic lights may not be ignored, as these can have green light.
|
String |
toString() |
clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition
getBounds, getGeometry, getHeight, getId
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBounds, makeGeometry
getGeometry, getHeight
getId
addListener, addListener, addListener, addListener, removeListener
public PerceptionCollectable<HeadwayGTU,LaneBasedGTU> getUpstreamGtus(LaneBasedGTU perceivingGtu, HeadwayGtuType headwayGtuType, Length visibility)
perceivingGtu
- LaneBasedGTU; perceiving GTUheadwayGtuType
- HeadwayGtuType; headway GTU type to usevisibility
- Length; distance over which GTU's are providedpublic PerceptionCollectable<HeadwayGTU,LaneBasedGTU> getDownstreamGtus(LaneBasedGTU perceivingGtu, HeadwayGtuType headwayGtuType, Length visibility)
perceivingGtu
- LaneBasedGTU; perceiving GTUheadwayGtuType
- HeadwayGtuType; headway GTU type to usevisibility
- Length; distance over which GTU's are providedpublic ConflictType getConflictType()
public ConflictRule getConflictRule()
public ConflictPriority conflictPriority()
public Length getLength()
public Conflict getOtherConflict()
public GTUType getGtuType()
public boolean isPermitted()
public static void generateConflictPair(ConflictType conflictType, ConflictRule conflictRule, boolean permitted, Lane lane1, Length longitudinalPosition1, Length length1, GTUDirectionality direction1, OTSLine3D geometry1, GTUType gtuType1, Lane lane2, Length longitudinalPosition2, Length length2, GTUDirectionality direction2, OTSLine3D geometry2, GTUType gtuType2, DEVSSimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
conflictType
- conflict type, i.e. crossing, merge or splitconflictRule
- conflict rulepermitted
- whether the conflict is permitted in traffic light controllane1
- lane of conflict 1longitudinalPosition1
- longitudinal position of conflict 1length1
- Length
of conflict 1direction1
- GTU direction of conflict 1geometry1
- geometry of conflict 1gtuType1
- gtu type of conflict 1lane2
- lane of conflict 2longitudinalPosition2
- longitudinal position of conflict 2length2
- Length
of conflict 2direction2
- GTU direction of conflict 2geometry2
- geometry of conflict 2gtuType2
- gtu type of conflict 2simulator
- the simulator for animation and timed eventsNetworkException
- if the combination of conflict type and both conflict rules is not correctpublic String toString()
toString
in class AbstractLaneBasedObject
public Conflict clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation) throws NetworkException
clone
in class AbstractLaneBasedObject
newCSE
- CrossSectionElement; the new cross section element to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkanimation
- boolean; whether to (re)create animation or notNetworkException
- in case the cloning failsCopyright © 2014–2018 Delft University of Technology. All rights reserved.