Class SimpleTrafficLight
- 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.trafficlight.AbstractTrafficLight
-
- org.opentrafficsim.road.network.lane.object.trafficlight.SimpleTrafficLight
-
- All Implemented Interfaces:
Serializable
,Locatable
,EventProducerInterface
,Identifiable
,Drawable
,ObjectInterface
,LaneBasedObject
,TrafficLight
public class SimpleTrafficLight extends AbstractTrafficLight
Standard implementation of a traffic light.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 30, 2015
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.road.network.lane.object.trafficlight.AbstractTrafficLight
DEFAULT_TRAFFICLIGHT_ELEVATION
-
Fields inherited from class org.djutils.event.EventProducer
eventProducerImpl
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
Fields inherited from interface org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight
TRAFFICLIGHT_CHANGE_EVENT
-
-
Constructor Summary
Constructors Constructor Description SimpleTrafficLight(String id, Lane lane, Length longitudinalPosition, DEVSSimulatorInterface.TimeDoubleUnit simulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleTrafficLight
clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator)
Clone the LaneBasedObject for e.g., copying a network.String
toString()
-
Methods inherited from class org.opentrafficsim.road.network.lane.object.trafficlight.AbstractTrafficLight
getTrafficLightColor, setTrafficLightColor
-
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, equals, finalize, getClass, hashCode, 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, getDirection, getLane, getLocation, getLongitudinalPosition
-
Methods inherited from interface org.opentrafficsim.core.object.ObjectInterface
getFullId, getGeometry, getHeight
-
-
-
-
Constructor Detail
-
SimpleTrafficLight
public SimpleTrafficLight(String id, Lane lane, Length longitudinalPosition, DEVSSimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
- Parameters:
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 events- Throws:
NetworkException
- on failure to place the object
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classAbstractLaneBasedObject
-
clone
public SimpleTrafficLight 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
-
-