1 package org.opentrafficsim.road.network.lane.object.trafficlight;
2
3 import org.djunits.value.vdouble.scalar.Duration;
4
5 /**
6 * Interface for a controller for a number of traffic lights. The controller knows of groups of traffic lights that belong
7 * to the same "phase".
8 * <p>
9 * Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
10 * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
11 * </p>
12 * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
13 * initial version Oct 4, 2016 <br>
14 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
15 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
16 * @author <a href="http://www.transport.citg.tudelft.nl">Wouter Schakel</a>
17 */
18 public interface TrafficLightController
19 {
20 /** @return the controller id. */
21 String getId();
22
23 /** @return the number of phases. */
24 int getNumberOfPhases();
25
26 /** @return the phase id. */
27 int getCurrentPhase();
28
29 /** @return the time between phases. */
30 Duration getClearanceDurationToNextPhase();
31
32 /**
33 * Add a traffic light to a phase.
34 * @param phaseId int; the id of the phase.
35 * @param trafficLight TrafficLight; the traffic light to add
36 * @throws TrafficLightException when the phase was not created
37 */
38 void addTrafficLightToPhase(int phaseId, TrafficLight trafficLight) throws TrafficLightException;
39
40 }
41