Class CycleTimeLightController

java.lang.Object
org.opentrafficsim.road.network.control.rampmetering.CycleTimeLightController
All Implemented Interfaces:
RampMeteringLightController

public class CycleTimeLightController
extends java.lang.Object
implements RampMeteringLightController
Controller using a cycle time.

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.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version 12 jun. 2019
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Summary

    Constructors 
    Constructor Description
    CycleTimeLightController​(OTSSimulatorInterface simulator, java.util.List<TrafficLight> trafficLights, Compatible compatible)  
  • Method Summary

    Modifier and Type Method 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CycleTimeLightController

      public CycleTimeLightController​(OTSSimulatorInterface simulator, java.util.List<TrafficLight> trafficLights, Compatible compatible)
      Parameters:
      simulator - OTSSimulatorInterface; simulator
      trafficLights - List<TrafficLight>; traffic lights
      compatible - Compatible; GTU types that trigger the detector, and hence the light to red
  • Method Details

    • disable

      public void disable()
      Disables the traffic lights.
      Specified by:
      disable in interface RampMeteringLightController
    • enable

      public void enable​(Duration cycleTime)
      Starts the cycle.
      Specified by:
      enable in interface RampMeteringLightController
      Parameters:
      cycleTime - Duration; cycle time
    • setRed

      protected void setRed​(TrafficLight trafficLight)
      Sets the traffic light to red. Can be scheduled.
      Parameters:
      trafficLight - TrafficLight; traffic light
    • setGreen

      protected void setGreen​(TrafficLight trafficLight)
      Sets the traffic light to green. Can be scheduled and remembers the green time.
      Parameters:
      trafficLight - TrafficLight; traffic light