aim4.im.v2i.RequestHandler
Class ApproxSimpleTrafficSignalRequestHandler

java.lang.Object
  extended by aim4.im.v2i.RequestHandler.ApproxSimpleTrafficSignalRequestHandler
All Implemented Interfaces:
RequestHandler, TrafficSignalRequestHandler

public class ApproxSimpleTrafficSignalRequestHandler
extends Object
implements TrafficSignalRequestHandler

The approximate traffic signal request handler.


Constructor Summary
ApproxSimpleTrafficSignalRequestHandler(double greenLightDuration, double yellowLightDuration)
           
 
Method Summary
 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 setGreenLightDuration(double greenLightDuration)
          Get the duration of the green light signal.
 void setYellowLightDuration(double yellowLightDuration)
          Get the duration of the yellow light signal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApproxSimpleTrafficSignalRequestHandler

public ApproxSimpleTrafficSignalRequestHandler(double greenLightDuration,
                                               double yellowLightDuration)
Method Detail

setGreenLightDuration

public void setGreenLightDuration(double greenLightDuration)
Get the duration of the green light signal.

Parameters:
greenLightDuration - the duration of the green light signal

setYellowLightDuration

public void setYellowLightDuration(double yellowLightDuration)
Get the duration of the yellow light signal.

Parameters:
yellowLightDuration - the duration of the yellow light signal

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

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

processRequestMsg

public void processRequestMsg(Request msg)
Process the request message.

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

getStatCollector

public StatCollector<?> getStatCollector()
Get the statistic collector.

Specified by:
getStatCollector in interface RequestHandler
Returns:
the statistic collector

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


Copyright © 2011. All Rights Reserved.