Class TestFixedTimeController

java.lang.Object
trafficcontrol.TestFixedTimeController

public class TestFixedTimeController extends Object
Test the fixed time traffic controller class.

Copyright (c) 2013-2024 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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkState(org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, FixedTimeController ftc, boolean stopSimulatorOnError)
    Check that the current state of a fixed time traffic light controller matches the design.
    org.opentrafficsim.core.dsol.OtsModelInterface
    Create a mocked OtsModelInterface.
    org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight
    createTrafficLightMock(String id, String networkId, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator)
    Mock a traffic light.
    void
    Test the constructors and initializers of the signal group and fixed time controller classes.
    void
    Test detection of non-disjoint sets of traffic lights.
    void
    Test timing of fixed time controller.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TestFixedTimeController

      public TestFixedTimeController()
  • Method Details

    • testConstructors

      public void testConstructors() throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, org.opentrafficsim.core.network.NetworkException
      Test the constructors and initializers of the signal group and fixed time controller classes.
      Throws:
      nl.tudelft.simulation.dsol.SimRuntimeException - if that happens uncaught; this test has failed
      NamingException - if that happens uncaught; this test has failed
      org.opentrafficsim.core.network.NetworkException - on exception
    • testDisjoint

      public void testDisjoint() throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, org.opentrafficsim.core.network.NetworkException
      Test detection of non-disjoint sets of traffic lights.
      Throws:
      NamingException - on exception
      nl.tudelft.simulation.dsol.SimRuntimeException - on exception
      org.opentrafficsim.core.network.NetworkException - on exception
    • testTimings

      public void testTimings() throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException, org.opentrafficsim.core.network.NetworkException
      Test timing of fixed time controller.
      Throws:
      nl.tudelft.simulation.dsol.SimRuntimeException - if that happens uncaught; this test has failed
      NamingException - if that happens uncaught; this test has failed
      org.opentrafficsim.core.network.NetworkException - on exception
    • checkState

      public void checkState(org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, FixedTimeController ftc, boolean stopSimulatorOnError)
      Check that the current state of a fixed time traffic light controller matches the design.
      Parameters:
      simulator - OtsSimulatorInterface; the simulator
      ftc - FixedTimeController; the fixed time traffic light controller
      stopSimulatorOnError - boolean; if true; stop the simulator on error; if false; execute the failing assert on error
    • createModelMock

      public org.opentrafficsim.core.dsol.OtsModelInterface createModelMock()
      Create a mocked OtsModelInterface.
      Returns:
      OtsModelInterface
    • createTrafficLightMock

      public org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight createTrafficLightMock(String id, String networkId, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator)
      Mock a traffic light.
      Parameters:
      id - String; value that will be returned by the getId method
      networkId - String; name of network (prepended to id for result of getFullId method)
      simulator - TODO
      Returns:
      TrafficLight