public abstract class AbstractLaneBasedObject extends StaticObject implements LaneBasedObject
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.
listeners
FIRST_POSITION, LAST_POSITION
Constructor and Description |
---|
AbstractLaneBasedObject(String id,
Lane lane,
Length longitudinalPosition,
OTSLine3D geometry)
Construct a new LaneBasedObject with the required fields.
|
AbstractLaneBasedObject(String id,
Lane lane,
Length longitudinalPosition,
OTSLine3D geometry,
Length height)
Construct a new AbstractLanebasedObject with the required fields.
|
AbstractLaneBasedObject(String id,
Lane lane,
LongitudinalDirectionality direction,
Length longitudinalPosition,
OTSLine3D geometry)
Construct a new LaneBasedObject with the required fields.
|
AbstractLaneBasedObject(String id,
Lane lane,
LongitudinalDirectionality direction,
Length longitudinalPosition,
OTSLine3D geometry,
Length height)
Construct a new AbstractLanebasedObject with the required fields.
|
Modifier and Type | Method and Description |
---|---|
abstract AbstractLaneBasedObject |
clone(CrossSectionElement newCSE,
SimulatorInterface.TimeDoubleUnit newSimulator,
boolean animation)
Clone the LaneBasedObject for e.g., copying a network.
|
StaticObject |
clone(Network newNetwork,
SimulatorInterface.TimeDoubleUnit newSimulator,
boolean animation) |
LongitudinalDirectionality |
getDirection() |
String |
getFullId() |
Lane |
getLane() |
DirectedPoint |
getLocation()
Return the location without throwing a RemoteException.
|
Length |
getLongitudinalPosition() |
String |
toString() |
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 AbstractLaneBasedObject(String id, Lane lane, LongitudinalDirectionality direction, Length longitudinalPosition, OTSLine3D geometry, Length height) throws NetworkException
id
- String; the id of the new objectlane
- Lane; The lane on which the new object resides. If the new object is a Sensor; it is automatically registered
on the lanedirection
- LongitudinalDirectionality; the directionality in which this is valid.longitudinalPosition
- Length; The position (between 0.0 and the length of the Lane) of the sensor on the design
line of the lanegeometry
- OTSLine3D; the geometry of the object, which provides its location and bounds as wellheight
- Length; the height of the object, in case it is a 3D objectNetworkException
- when the position on the lane is out of boundspublic AbstractLaneBasedObject(String id, Lane lane, Length longitudinalPosition, OTSLine3D geometry, Length height) throws NetworkException
id
- String; the id of the new objectlane
- Lane; The lane on which the new object resides. If the new object is a Sensor; it is automatically registered
on the lanelongitudinalPosition
- Length; The position (between 0.0 and the length of the Lane) of the sensor on the design
line of the lanegeometry
- OTSLine3D; the geometry of the object, which provides its location and bounds as wellheight
- Length; the height of the object, in case it is a 3D objectNetworkException
- when the position on the lane is out of boundspublic AbstractLaneBasedObject(String id, Lane lane, LongitudinalDirectionality direction, Length longitudinalPosition, OTSLine3D geometry) throws NetworkException
id
- String; the id of the new AbstractLaneBasedObjectlane
- Lane; The lane for which this is a sensordirection
- LongitudinalDirectionality; the directionality in which this is valid.longitudinalPosition
- Length; The position (between 0.0 and the length of the Lane) of the sensor on the design
line of the lanegeometry
- OTSLine3D; the geometry of the object, which provides its location and bounds as wellNetworkException
- when the position on the lane is out of boundspublic AbstractLaneBasedObject(String id, Lane lane, Length longitudinalPosition, OTSLine3D geometry) throws NetworkException
id
- String; the id of the new AbstractLaneBasedObjectlane
- Lane; The lane for which this is a sensorlongitudinalPosition
- Length; The position (between 0.0 and the length of the Lane) of the sensor on the design
line of the lanegeometry
- OTSLine3D; the geometry of the object, which provides its location and bounds as wellNetworkException
- when the position on the lane is out of boundspublic final String getFullId()
getFullId
in interface ObjectInterface
getFullId
in class StaticObject
public final Lane getLane()
getLane
in interface LaneBasedObject
public final LongitudinalDirectionality getDirection()
getDirection
in interface LaneBasedObject
public final Length getLongitudinalPosition()
getLongitudinalPosition
in interface LaneBasedObject
public DirectedPoint getLocation()
getLocation
in interface Locatable
getLocation
in interface LaneBasedObject
getLocation
in class StaticObject
public final StaticObject clone(Network newNetwork, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation) throws NetworkException
clone
in class StaticObject
NetworkException
public String toString()
toString
in class StaticObject
public abstract AbstractLaneBasedObject clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator, boolean animation) throws NetworkException
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.