| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectaim4.im.v2i.reservation.ReservationArray
public class ReservationArray
The Reservation Array.
| Nested Class Summary | |
|---|---|
static class | 
ReservationArray.TimeTile
The smallest unit of space-time in the FCFS policy.  | 
| Constructor Summary | |
|---|---|
ReservationArray(int numOfTiles)
Create a new reservation system.  | 
|
| Method Summary | |
|---|---|
 boolean | 
cancel(int rid)
Cancel a reservation  | 
 void | 
cleanUp(int dt)
Remove all reservations before a given discrete time.  | 
 int | 
getLastReservedDiscreteTime()
Get the last time at which any time-tile has been reserved.  | 
 int | 
getLastReservedDiscreteTime(int rid)
Get the last discrete time of a particular reservation ID.  | 
 int | 
getNumberOfTiles()
Get the number of tiles  | 
 int | 
getReservationId(int dt,
                 int tid)
Get the reservation ID that reserved the given time-tile.  | 
 List<Integer> | 
getReservedTilesAtTime(int dt)
Get the set of all reserved tiles at a given discrete time.  | 
 Set<Integer> | 
getVinOfReservedTilesAtTime(int dt)
Get the VINs of all reserved tiles at a given discrete time.  | 
 boolean | 
hasReservation(int rid)
Check whether a given reservation ID exists  | 
 boolean | 
isReserved(int dt,
           int tid)
Whether the time-tile has been reserved.  | 
 boolean | 
reserve(int rid,
        Collection<? extends ReservationArray.TimeTile> workingList)
Make the reservation of a set of time-tiles with a given reservation id.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ReservationArray(int numOfTiles)
numOfTiles - The number of tiles in the intersection| Method Detail | 
|---|
public int getNumberOfTiles()
public boolean isReserved(int dt,
                          int tid)
dt - the discrete timetid - the tile ID
public int getReservationId(int dt,
                            int tid)
dt - the discrete timetid - the id of the tile
public boolean hasReservation(int rid)
rid - the reservation ID
public int getLastReservedDiscreteTime()
public int getLastReservedDiscreteTime(int rid)
rid - the reservation ID
public boolean reserve(int rid,
                       Collection<? extends ReservationArray.TimeTile> workingList)
rid - the reservation IDworkingList - a collection of time-tiles to be reserved
public boolean cancel(int rid)
rid - the reservation ID
public void cleanUp(int dt)
dt - the discrete time before which the reservations will be removed.public List<Integer> getReservedTilesAtTime(int dt)
dt - the discrete time
public Set<Integer> getVinOfReservedTilesAtTime(int dt)
dt - the discrete time
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||