public class TrafficLight extends AbstractTrafficLightNew
Copyright (c) 2013-2015 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 |
---|---|
static class |
TrafficLight.TrafficLightColor
The GTU colors for a normal traffic light.
|
Constructor and Description |
---|
TrafficLight(org.opentrafficsim.core.geometry.OTSLine3D geometry,
org.djunits.value.vdouble.scalar.Length.Rel height,
TrafficLight.TrafficLightColor initialColor) |
Modifier and Type | Method and Description |
---|---|
static TrafficLight |
createTrafficLight(CrossSectionElement cse,
org.djunits.value.vdouble.scalar.Length.Rel position,
TrafficLight.TrafficLightColor initialColor) |
TrafficLight.TrafficLightColor |
getTrafficLightColor() |
void |
setTrafficLightColor(TrafficLight.TrafficLightColor trafficLightColor) |
createRectangleNextToCSE, createRectangleOnCSE
public TrafficLight(org.opentrafficsim.core.geometry.OTSLine3D geometry, org.djunits.value.vdouble.scalar.Length.Rel height, TrafficLight.TrafficLightColor initialColor)
geometry
- the geometry of the objectheight
- the height of the objectinitialColor
- the initial color of the traffic lightpublic final TrafficLight.TrafficLightColor getTrafficLightColor()
public final void setTrafficLightColor(TrafficLight.TrafficLightColor trafficLightColor)
trafficLightColor
- set the trafficLightColorpublic static TrafficLight createTrafficLight(CrossSectionElement cse, org.djunits.value.vdouble.scalar.Length.Rel position, TrafficLight.TrafficLightColor initialColor) throws org.opentrafficsim.core.geometry.OTSGeometryException
cse
- the cross section element, e.g. lane, where the traffic light is locatedposition
- the relative position on the design line of the link for this traffic lightinitialColor
- the initial color of the traffic lightorg.opentrafficsim.core.geometry.OTSGeometryException
- in case the position is outside the CSECopyright © 2014–2016 Delft University of Technology. All rights reserved.