public class Approx4PhasesTrafficSignalRequestHandler extends Object implements TrafficSignalRequestHandler
| Constructor and Description |
|---|
Approx4PhasesTrafficSignalRequestHandler(double greenLightDuration,
double yellowLightDuration)
Create the approximate 4-Phases traffic signal request handler.
|
| 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 |
setGreenLightDuration(double greenLightDuration)
Set the green signals duration.
|
void |
setYellowLightDuration(double yellowLightDuration)
Set the yellow signals duration.
|
public Approx4PhasesTrafficSignalRequestHandler(double greenLightDuration,
double yellowLightDuration)
greenLightDuration - the duration of green signalsyellowLightDuration - the duration of yellow signalspublic void setGreenLightDuration(double greenLightDuration)
greenLightDuration - the green signal durationpublic void setYellowLightDuration(double yellowLightDuration)
yellowLightDuration - the yellow signal durationpublic void setBasePolicyCallback(BasePolicyCallback basePolicy)
setBasePolicyCallback in interface RequestHandlerbasePolicy - the base policy's call-backpublic void act(double timeStep)
act in interface RequestHandlertimeStep - the time periodpublic void processRequestMsg(Request msg)
processRequestMsg in interface RequestHandlermsg - the request messagepublic StatCollector<?> getStatCollector()
getStatCollector in interface RequestHandlerpublic TrafficSignal getSignal(int laneId)
getSignal in interface TrafficSignalRequestHandlerlaneId - the land IDCopyright © 2013. All rights reserved.