aim4.im.v2i.RequestHandler

## Class ApproxNPhasesTrafficSignalRequestHandler

- java.lang.Object
- - aim4.im.v2i.RequestHandler.ApproxNPhasesTrafficSignalRequestHandler

- All Implemented Interfaces:
    RequestHandler, TrafficSignalRequestHandler

      public class ApproxNPhasesTrafficSignalRequestHandler
      extends Object
      implements TrafficSignalRequestHandler

  The approximate N-Phases traffic signal request handler.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ApproxNPhasesTrafficSignalRequestHandler.CyclicSignalController` The cyclic signal controller.
    `static interface` | `ApproxNPhasesTrafficSignalRequestHandler.SignalController` The interface of signal controllers.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ApproxNPhasesTrafficSignalRequestHandler()` Create the approximate N-Phases traffic signal request handler.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `act(double timeStep)` Let the request handler to act for a given time period.
    `TrafficSignal` | `getSignal(int laneId)` Get the traffic signal of a lane.
    `StatCollector<?>` | `getStatCollector()` Get the statistic collector.
    `void` | `processRequestMsg(Request msg)` Process the request message.
    `void` | `setBasePolicyCallback(BasePolicyCallback basePolicy)` Set the base policy call-back.
    `void` | `setSignalControllers(int laneId, ApproxNPhasesTrafficSignalRequestHandler.SignalController signalController)` Set the traffic signal controller of a lane

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ApproxNPhasesTrafficSignalRequestHandler

          public ApproxNPhasesTrafficSignalRequestHandler()

      Create the approximate N-Phases traffic signal request handler.

  - ### Method Detail

    - #### act

          public void act(double timeStep)

      Let the request handler to act for a given time period.
      Specified by:
        `act` in interface `RequestHandler`
      Parameters:
        `timeStep` - the time period

    - #### setBasePolicyCallback

          public void setBasePolicyCallback(BasePolicyCallback basePolicy)

      Set the base policy call-back.
      Specified by:
        `setBasePolicyCallback` in interface `RequestHandler`
      Parameters:
        `basePolicy` - the base policy's call-back

    - #### setSignalControllers

          public void setSignalControllers(int laneId,
                                  ApproxNPhasesTrafficSignalRequestHandler.SignalController signalController)

      Set the traffic signal controller of a lane
      Parameters:
        `laneId` - the lane ID
        `signalController` - the signal controller

    - #### processRequestMsg

          public void processRequestMsg(Request msg)

      Process the request message.
      Specified by:
        `processRequestMsg` in interface `RequestHandler`
      Parameters:
        `msg` - the request message

    - #### getSignal

          public TrafficSignal getSignal(int laneId)

      Get the traffic signal of a lane.
      Specified by:
        `getSignal` in interface `TrafficSignalRequestHandler`
      Parameters:
        `laneId` - the land ID
      Returns:
        traffic signal

    - #### getStatCollector

          public StatCollector<?> getStatCollector()

      Get the statistic collector.
      Specified by:
        `getStatCollector` in interface `RequestHandler`
      Returns:
        the statistic collector

Copyright © 2013. All rights reserved.