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