|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.im.IntersectionManager aim4.im.v2i.V2IManager
public class V2IManager
An intersection manager that takes requests from vehicles and coordinates
their traversals of the intersection to ensure that there are no
collisions. The V2IManager makes its decisions using an intersection
control Policy
.
Field Summary | |
---|---|
static double |
MAXIMUM_FUTURE_RESERVATION_TIME
The maximum amount of time, in seconds, in the future, for which the policy will accept reservation requests. |
Fields inherited from class aim4.im.IntersectionManager |
---|
currentTime, id |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class aim4.im.IntersectionManager |
---|
checkCurrentTime, contains, getCurrentTime, getId, getIntersection, getSortedDepartureLanes, getTrackModel, intersects, manages, manages, traversalDistance, traversalDistance, traversalDistance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface aim4.im.v2i.V2IManagerCallback |
---|
getCurrentTime, getId, getIntersection, getTrackModel |
Field Detail |
---|
public static final double MAXIMUM_FUTURE_RESERVATION_TIME
Constructor Detail |
---|
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 registryMethod Detail |
---|
public Policy getPolicy()
public void setPolicy(Policy policy)
policy
- the policypublic void act(double timeStep)
act
in class IntersectionManager
timeStep
- 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 V2IManagerCallback
public ReservationGridManager getReservationGridManager()
getReservationGridManager
in interface V2IManagerCallback
public AdmissionControlZone getACZ(int laneId)
getACZ
in interface V2IManagerCallback
laneId
- the id of the lane
public AczManager getAczManager(int laneId)
getAczManager
in interface V2IManagerCallback
public void sendI2VMessage(I2VMessage msg)
sendI2VMessage
in interface V2IManagerCallback
msg
- the message to send to a Vehiclepublic void printData(String outFileName)
printData
in class IntersectionManager
outFileName
- the name of the file to which the data are outputted.public List<? extends Shape> getDebugShapes()
getDebugShapes
in class IntersectionManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |