Interface TrafficLightController

    • Method Detail

      • 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