aim4.im.v2i.policy
Class TimeoutPolicy

java.lang.Object
  extended by aim4.im.v2i.policy.TimeoutPolicy
All Implemented Interfaces:
Policy, V2IManagerCallback

public class TimeoutPolicy
extends Object
implements Policy, V2IManagerCallback

The timeout policy.


Nested Class Summary
static class TimeoutPolicy.TimeoutPolicyType
          How the V2IManager treats vehicles that communicate before their timeout is over.
 
Constructor Summary
TimeoutPolicy(V2IManager im, Policy policy)
          Create a timeout policy
 
Method Summary
 void act(double timeStep)
          Give the policy a chance to do any processing it might need to do in order to respond to requests, if it hasn't responded to them already.
 AdmissionControlZone getACZ(int laneId)
          Get the Admission Control Zone of a given lane.
 AczManager getAczManager(int laneId)
          Get the manager of an ACZ
 double getCurrentTime()
          Get the current time
 int getId()
          Get the id of the intersection manager.
 Intersection getIntersection()
          Get the intersection managed by this intersection manager.
 ReservationGrid getReservationGrid()
          Get the reservation grid.
 ReservationGridManager getReservationGridManager()
          Get the manager of the reservation grid
 StatCollector<?> getStatCollector()
          Get the statistic collector.
 TrackModel getTrackModel()
          
 void processV2IMessage(V2IMessage msg)
          Process a V2I message
 void sendI2VMessage(I2VMessage msg)
          A callback method for sending a I2V message.
 void setV2IManagerCallback(V2IManagerCallback im)
          Set the V2I manager call-back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeoutPolicy

public TimeoutPolicy(V2IManager im,
                     Policy policy)
Create a timeout policy

Parameters:
im - the intersection manager
policy - the underlying policy
Method Detail

setV2IManagerCallback

public void setV2IManagerCallback(V2IManagerCallback im)
Set the V2I manager call-back.

Specified by:
setV2IManagerCallback in interface Policy
Parameters:
im - the V2I manager's call-back

sendI2VMessage

public void sendI2VMessage(I2VMessage msg)
A callback method for sending a I2V message.

Specified by:
sendI2VMessage in interface V2IManagerCallback
Parameters:
msg - a I2V message

getId

public int getId()
Get the id of the intersection manager.

Specified by:
getId in interface V2IManagerCallback
Returns:
the id of the intersection manager.

getCurrentTime

public double getCurrentTime()
Get the current time

Specified by:
getCurrentTime in interface V2IManagerCallback
Returns:
the current time

getIntersection

public Intersection getIntersection()
Get the intersection managed by this intersection manager.

Specified by:
getIntersection in interface V2IManagerCallback
Returns:
the intersection managed by this intersection manager

getReservationGrid

public ReservationGrid getReservationGrid()
Get the reservation grid.

Specified by:
getReservationGrid in interface V2IManagerCallback
Returns:
the reservation grid

getReservationGridManager

public ReservationGridManager getReservationGridManager()
Get the manager of the reservation grid

Specified by:
getReservationGridManager in interface V2IManagerCallback
Returns:
the manager of the reservation grid

getACZ

public AdmissionControlZone getACZ(int laneId)
Get the Admission Control Zone of a given lane.

Specified by:
getACZ in interface V2IManagerCallback
Parameters:
laneId - the id of the lane
Returns:
the admission control zone of the lane.

getAczManager

public AczManager getAczManager(int laneId)
Get the manager of an ACZ

Specified by:
getAczManager in interface V2IManagerCallback

act

public void act(double timeStep)
Give the policy a chance to do any processing it might need to do in order to respond to requests, if it hasn't responded to them already. Only used for policies that don't respond immediately to requests.

Specified by:
act in interface Policy
Parameters:
timeStep - the size of the time step to simulate, in seconds

processV2IMessage

public void processV2IMessage(V2IMessage msg)
Process a V2I message

Specified by:
processV2IMessage in interface Policy
Parameters:
msg - the V2I message

getStatCollector

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

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

getTrackModel

public TrackModel getTrackModel()

Specified by:
getTrackModel in interface V2IManagerCallback


Copyright © 2011. All Rights Reserved.