|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.im.v2i.reservation.AdmissionControlZone
public class AdmissionControlZone
This is a data structure to manage the admission control zone, the area after an intersection in one lane. It essentially holds a limited length's worth of vehicles and will only admit vehicles if there is enough room.
Constructor Summary | |
---|---|
AdmissionControlZone(double maxSize)
Construct a new AdmissionControlZone with the given maximum length. |
Method Summary | |
---|---|
void |
admit(int vin,
double vehicleLength,
double stoppingDistance)
Reserve space for a vehicle to enter this admission control zone. |
void |
away(int vin)
Indicates that the vehicle with the given ID number has left the admission control zone by driving out of it within the lane. |
void |
cancel(int vin)
Indicates that the vehicle with the given ID number no longer wants to enter this AdmissionControlZone. |
double |
getCurrentSize()
Get the current size of the admission control zone. |
double |
getMaxSize()
Get the maximum length's worth of vehicles allowed in this admission control zone at one time. |
boolean |
isAdmissible(int vin,
double vehicleLength,
double stoppingDistance)
Check to see if the vehicle can reserve space to enter this admission control zone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdmissionControlZone(double maxSize)
maxSize
- the maximum length's worth of cars that the zone
will holdMethod Detail |
---|
public double getMaxSize()
public double getCurrentSize()
public boolean isAdmissible(int vin, double vehicleLength, double stoppingDistance)
vin
- the VIN number of the vehicle to try to addvehicleLength
- the length of the vehicle to try to addstoppingDistance
- the distance it will take the vehicle to
stop if it begins decelerating as soon as
it enters the admission control zone
public void admit(int vin, double vehicleLength, double stoppingDistance)
vin
- the VIN number of the vehicle to try to addvehicleLength
- the length of the vehicle to try to addstoppingDistance
- the distance it will take the vehicle to
stop if it begins decelerating as soon as
it enters the admission control zonepublic void cancel(int vin)
vin
- the ID number of the vehicle cancelingpublic void away(int vin)
vin
- the ID number of the vehicle to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |