public abstract class AbstractTrafficLight extends AbstractLaneBasedObject implements TrafficLight
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
static Length |
DEFAULT_TRAFFICLIGHT_ELEVATION
Default elevation of a traffic light (above zero; don't use this for lanes at non-zero elevation).
|
listeners
TRAFFICLIGHT_CHANGE_EVENT
FIRST_POSITION, LAST_POSITION
Constructor and Description |
---|
AbstractTrafficLight(String id,
Lane lane,
Length longitudinalPosition,
DEVSSimulatorInterface.TimeDoubleUnit simulator)
Construct an AbstractTrafficLight at default elevation (use only on roads at elevation 0).
|
AbstractTrafficLight(String id,
Lane lane,
Length longitudinalPosition,
DEVSSimulatorInterface.TimeDoubleUnit simulator,
Length height)
Construct an AbstractTrafficLight with specified elevation.
|
Modifier and Type | Method and Description |
---|---|
TrafficLightColor |
getTrafficLightColor() |
void |
setTrafficLightColor(TrafficLightColor trafficLightColor)
Set the new traffic light color.
|
clone, clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition, 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, getDirection, getLane, getLocation, getLongitudinalPosition, makeGeometry
getFullId, getGeometry, getHeight
getId
addListener, addListener, addListener, addListener, removeListener
public static final Length DEFAULT_TRAFFICLIGHT_ELEVATION
public AbstractTrafficLight(String id, Lane lane, Length longitudinalPosition, DEVSSimulatorInterface.TimeDoubleUnit simulator, Length height) throws NetworkException
id
- String; traffic light idlane
- Lane; lane where the traffic light is locatedlongitudinalPosition
- Length; position of the traffic light on the lane, in the design directionsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; the simulator for animation and timed eventsheight
- Length; the elevation of the traffic lightNetworkException
- on failure to place the objectpublic AbstractTrafficLight(String id, Lane lane, Length longitudinalPosition, DEVSSimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
id
- String; traffic light idlane
- Lane; lane where the traffic light is locatedlongitudinalPosition
- Length; position of the traffic light on the lane, in the design directionsimulator
- DEVSSimulatorInterface.TimeDoubleUnit; the simulator for animation and timed eventsNetworkException
- on failure to place the objectpublic final TrafficLightColor getTrafficLightColor()
getTrafficLightColor
in interface TrafficLight
public final void setTrafficLightColor(TrafficLightColor trafficLightColor)
setTrafficLightColor
in interface TrafficLight
trafficLightColor
- TrafficLightColor; set the trafficLightColorCopyright © 2014–2019 Delft University of Technology. All rights reserved.