Class TrafCOD

All Implemented Interfaces:
Serializable, EventListener, EventListenerInterface, EventProducerInterface, Identifiable, Drawable, InvisibleObjectInterface, ActuatedTrafficController, TrafficController

public class TrafCOD
extends AbstractTrafficController
implements ActuatedTrafficController, EventListenerInterface
TrafCOD evaluator. TrafCOD is a language for writing traffic control programs. A TrafCOD program consists of a set of rules that must be evaluated repeatedly (until no more changes occurr) every time step. The time step size is 0.1 seconds.

Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version Oct 5, 2016
Author:
Wouter Schakel
See Also:
Serialized Form
  • Constructor Details

    • TrafCOD

      public TrafCOD​(String controllerName, URL trafCodURL, OTSSimulatorInterface simulator, Container display, BufferedImage displayBackground, List<String> displayObjectLocations) throws TrafficControlException, SimRuntimeException, IOException
      Construct a new TrafCOD traffic light controller.
      Parameters:
      controllerName - String; name of this TrafCOD traffic light controller
      trafCodURL - URL; the URL of the TrafCOD rules
      simulator - OTSSimulatorInterface; the simulation engine
      display - Container; if non-null, a controller display is constructed and shown in the supplied container
      displayBackground - BufferedImage; background for controller display image
      displayObjectLocations - List<String>; list of sensors and traffic lights and their locations on the displayBackGround
      Throws:
      TrafficControlException - when a rule cannot be parsed
      SimRuntimeException - when scheduling the first evaluation event fails
      IOException - when loading the TrafCOD rules from the URL fails
    • TrafCOD

      public TrafCOD​(String controllerName, List<String> trafCODRules, OTSSimulatorInterface simulator, Container display, BufferedImage displayBackground, List<String> displayObjectLocations) throws TrafficControlException, SimRuntimeException
      Construct a new TrafCOD traffic light controller.
      Parameters:
      controllerName - String; name of this TrafCOD traffic light controller
      trafCODRules - List<String>; the TrafCOD rules
      simulator - OTSSimulatorInterface; the simulation engine
      display - Container; if non-null, a controller display is constructed and shown in the supplied container
      displayBackground - BufferedImage; background for controller display image
      displayObjectLocations - List<String>; list of sensors and traffic lights and their locations on the displayBackGround
      Throws:
      TrafficControlException - when a rule cannot be parsed
      SimRuntimeException - when scheduling the first evaluation event fails
  • Method Details