public class CycleTimeLightController extends Object implements RampMeteringLightController
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.
Constructor and Description |
---|
CycleTimeLightController(OTSSimulatorInterface simulator,
List<TrafficLight> trafficLights,
Compatible compatible) |
Modifier and Type | Method and Description |
---|---|
void |
disable()
Disables the traffic lights.
|
void |
enable(Duration cycleTime)
Starts the cycle.
|
protected void |
setGreen(TrafficLight trafficLight)
Sets the traffic light to green.
|
protected void |
setRed(TrafficLight trafficLight)
Sets the traffic light to red.
|
public CycleTimeLightController(OTSSimulatorInterface simulator, List<TrafficLight> trafficLights, Compatible compatible)
simulator
- OTSSimulatorInterface; simulatortrafficLights
- List<TrafficLight>; traffic lightscompatible
- Compatible; GTU types that trigger the detector, and hence the light to redpublic void disable()
disable
in interface RampMeteringLightController
public void enable(Duration cycleTime)
enable
in interface RampMeteringLightController
cycleTime
- Duration; cycle timeprotected void setRed(TrafficLight trafficLight)
trafficLight
- TrafficLight; traffic lightprotected void setGreen(TrafficLight trafficLight)
trafficLight
- TrafficLight; traffic lightCopyright © 2014–2019 Delft University of Technology. All rights reserved.