Interface TrafficLightController
- All Superinterfaces:
Identifiable
- All Known Implementing Classes:
AbstractTrafficLightController,TrafficLightControllerFixedDuration
public interface TrafficLightController extends 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-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Method Summary
Modifier and Type Method Description voidaddTrafficLightToPhase(int phaseId, TrafficLight trafficLight)Add a traffic light to a phase.DurationgetClearanceDurationToNextPhase()intgetCurrentPhase()java.lang.StringgetId()intgetNumberOfPhases()
-
Method Details
-
getId
java.lang.String getId()- Specified by:
getIdin interfaceIdentifiable- 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
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
-