Class BusStop
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.opentrafficsim.core.object.StaticObject
-
- org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
-
- org.opentrafficsim.road.network.lane.object.BusStop
-
- All Implemented Interfaces:
Serializable
,Locatable
,EventProducerInterface
,Identifiable
,Drawable
,ObjectInterface
,LaneBasedObject
public class BusStop extends AbstractLaneBasedObject
A bus stop is a location on a lane. The stop has a name, and a set of lines. At a single stop in reality, there may be different locations where busses stop for different lines. ABusStop
pertains to only one such location. The bus stop in reality is represented by a shared name over a fewBusStop
's, with different lines. As lines may also be set dynamically, the name and lines are insufficient to identify a specificBusStop
. Hence there is a fixed unique id perBusStop
.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 24 jan. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.djutils.event.EventProducer
eventProducerImpl
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractLaneBasedObject
clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator)
Clone the LaneBasedObject for e.g., copying a network.boolean
equals(Object obj)
Set<Conflict>
getConflicts()
Returns the downstream conflicts of the bus stop.ImmutableSet<String>
getLines()
Returns the lines set.int
hashCode()
void
setLines(Set<String> lines)
Sets the lines.String
toString()
-
Methods inherited from class org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition, init
-
Methods inherited from class org.opentrafficsim.core.object.StaticObject
create, create, getBounds, getGeometry, getHeight, getId, getSourceId
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, getSourceId, hasListeners, numberOfListeners, removeListener
-
Methods inherited from interface org.opentrafficsim.base.Identifiable
getId
-
Methods inherited from interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
getBounds
-
Methods inherited from interface org.opentrafficsim.core.object.ObjectInterface
getGeometry, getHeight
-
-
-
-
Constructor Detail
-
BusStop
public BusStop(String id, Lane lane, Length longitudinalPosition, String name, SimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
- Parameters:
id
- String; idlane
- Lane; lanelongitudinalPosition
- Length; positionname
- String; name of stopsimulator
- SimulatorInterface.TimeDoubleUnit; the simulator to schedule on- Throws:
NetworkException
- when the position on the lane is out of bounds
-
-
Method Detail
-
setLines
public final void setLines(Set<String> lines)
Sets the lines.- Parameters:
lines
- Set<String>; lines that stop at this location
-
getLines
public final ImmutableSet<String> getLines()
Returns the lines set.- Returns:
- whether the lines belongs to this stop
-
getConflicts
public final Set<Conflict> getConflicts()
Returns the downstream conflicts of the bus stop. Search is only performed over links with BUS_STOP priority.- Returns:
- downstream conflicts of the given conflict
-
toString
public final String toString()
- Overrides:
toString
in classAbstractLaneBasedObject
-
clone
public final AbstractLaneBasedObject clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
Clone the LaneBasedObject for e.g., copying a network.- Specified by:
clone
in classAbstractLaneBasedObject
- Parameters:
newCSE
- CrossSectionElement; the new cross section element to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this network- Returns:
- AbstractLaneBasedObject; a clone of this object
- Throws:
NetworkException
- in case the cloning fails
-
-