Interface TrafficLightController

  • All Superinterfaces:
    org.opentrafficsim.base.Identifiable
    All Known Implementing Classes:
    AbstractTrafficLightController, TrafficLightControllerFixedDuration

    public interface TrafficLightController
    extends org.opentrafficsim.base.Identifiable
    Interface for a controller for a number of traffic lights. The controller knows of groups of traffic lights that belong to the same "phase".

    Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Oct 4, 2016
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Method Detail

      • getId

        String getId()
        Specified by:
        getId in interface org.opentrafficsim.base.Identifiable
        Returns:
        the controller id.
      • getNumberOfPhases

        int getNumberOfPhases()
        Returns:
        the number of phases.
      • getCurrentPhase

        int getCurrentPhase()
        Returns:
        the phase id.
      • getClearanceDurationToNextPhase

        Duration getClearanceDurationToNextPhase()
        Returns:
        the time between phases.
      • addTrafficLightToPhase

        void addTrafficLightToPhase​(int phaseId,
                                    TrafficLight trafficLight)
                             throws TrafficLightException
        Add a traffic light to a phase.
        Parameters:
        phaseId - int; the id of the phase.
        trafficLight - TrafficLight; the traffic light to add
        Throws:
        TrafficLightException - when the phase was not created