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.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Oct 4, 2016
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addTrafficLightToPhase(int phaseId, TrafficLight trafficLight)
Add a traffic light to a phase.Duration
getClearanceDurationToNextPhase()
int
getCurrentPhase()
String
getId()
int
getNumberOfPhases()
-
-
-
Method Detail
-
getId
String getId()
- Specified by:
getId
in 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
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
-
-