public class V2IManager extends IntersectionManager implements V2IManagerCallback
Policy.| Modifier and Type | Field and Description |
|---|---|
static double |
MAXIMUM_FUTURE_RESERVATION_TIME
The maximum amount of time, in seconds, in the future, for which the
policy will accept reservation requests.
|
currentTime, id| Constructor and Description |
|---|
V2IManager(Intersection intersection,
TrackModel trackModel,
double currentTime,
ReservationGridManager.Config config,
Registry<IntersectionManager> registry)
Construct a new V2IManager given the structure of Lanes in the
intersection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
act(double timeStep)
Give the V2IManager a chance to respond to messages from vehicles, change
policies, and so forth.
|
void |
clearInbox()
Clear out the inbox.
|
void |
clearOutbox()
Clear out the outbox.
|
AdmissionControlZone |
getACZ(int laneId)
Get the Admission Control Zone of a given lane.
|
AczManager |
getAczManager(int laneId)
Get the manager of an ACZ
|
int |
getBitsReceived()
Get the number of bits this IntersectionManager has received.
|
int |
getBitsTransmitted()
Get the number of bits this IntersectionManager has transmitted.
|
List<? extends Shape> |
getDebugShapes()
Get any shapes to display for debugging purposes.
|
Policy |
getPolicy()
Get the policy.
|
ReservationGrid |
getReservationGrid()
Get the reservation grid.
|
ReservationGridManager |
getReservationGridManager()
Get the manager of the reservation grid
|
double |
getTransmissionPower()
Get the IntersectionManager's transmission power.
|
Iterator<V2IMessage> |
inboxIterator()
Get an iterator for the messages waiting to be read.
|
Iterator<I2VMessage> |
outboxIterator()
Get an iterator for the messages waiting to be delivered from this
IntersectionManager.
|
void |
printData(String outFileName)
Print the collected data to a file.
|
void |
receive(V2IMessage msg)
Adds a message to the incoming queue of messages delivered to this
IntersectionManager.
|
void |
sendI2VMessage(I2VMessage msg)
Adds a message to the outgoing queue of messages to be delivered to a
Vehicle.
|
void |
setPolicy(Policy policy)
set the policy.
|
checkCurrentTime, contains, getCurrentTime, getId, getIntersection, getSortedDepartureLanes, getTrackModel, intersects, manages, manages, traversalDistance, traversalDistance, traversalDistanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCurrentTime, getId, getIntersection, getTrackModelpublic static final double MAXIMUM_FUTURE_RESERVATION_TIME
public V2IManager(Intersection intersection, TrackModel trackModel, double currentTime, ReservationGridManager.Config config, Registry<IntersectionManager> registry)
intersection - an intersectiontrackModel - a path model of the intersectioncurrentTime - the current timeregistry - an intersection manager registrypublic Policy getPolicy()
public void setPolicy(Policy policy)
policy - the policypublic void act(double timeStep)
act in class IntersectionManagertimeStep - the size of the time step to simulate, in secondspublic double getTransmissionPower()
public Iterator<V2IMessage> inboxIterator()
public void clearInbox()
public Iterator<I2VMessage> outboxIterator()
public void clearOutbox()
public void receive(V2IMessage msg)
msg - the message to be receivedpublic int getBitsReceived()
public int getBitsTransmitted()
public ReservationGrid getReservationGrid()
getReservationGrid in interface V2IManagerCallbackpublic ReservationGridManager getReservationGridManager()
getReservationGridManager in interface V2IManagerCallbackpublic AdmissionControlZone getACZ(int laneId)
getACZ in interface V2IManagerCallbacklaneId - the id of the lanepublic AczManager getAczManager(int laneId)
getAczManager in interface V2IManagerCallbackpublic void sendI2VMessage(I2VMessage msg)
sendI2VMessage in interface V2IManagerCallbackmsg - the message to send to a Vehiclepublic void printData(String outFileName)
printData in class IntersectionManageroutFileName - the name of the file to which the data are outputted.public List<? extends Shape> getDebugShapes()
getDebugShapes in class IntersectionManagerCopyright © 2013. All rights reserved.