public class ReservationGrid extends ReservationArray
| Modifier and Type | Class and Description |
|---|---|
class |
ReservationGrid.TimeTile
The time tile.
|
| Constructor and Description |
|---|
ReservationGrid(int xNum,
int yNum,
double gridTimeStep)
Create a reservation grid.
|
| Modifier and Type | Method and Description |
|---|---|
int |
calcDiscreteTime(double time)
Get the discrete time of a given time.
|
double |
calcRemainingTime(double time)
Get the remaining time in the grid time step of the given time
|
int |
calcTileId(int x,
int y)
Get the ID of the time tile at a given coordinate.
|
double |
calcTime(int discreteTime)
Get the time of a given discrete time.
|
int |
calcX(int tid)
The x coordinate of the time tile.
|
int |
calcY(int tid)
The y coordinate of the time tile.
|
void |
cleanUp(double currentTime)
Clean up the reservation grid.
|
double |
getGridTimeStep()
Get the time step.
|
double |
getLastReservedTime()
Get the last time at which any time-tile has been reserved.
|
List<Integer> |
getReservedTilesAtTime(double time)
Get the set of all reserved tiles at a given discrete time.
|
Set<Integer> |
getVinOfReservedTilesAtTime(double time)
Get the VINs of all reserved tiles at a given discrete time.
|
int |
getxNum()
Get the number of time tiles in the x direction.
|
int |
getXnum()
Get the number of time tiles in the x direction.
|
int |
getyNum()
Get the number of time tiles in the y direction.
|
int |
getYnum()
Get the number of time tiles in the y direction.
|
cancel, cleanUp, getLastReservedDiscreteTime, getLastReservedDiscreteTime, getNumberOfTiles, getReservationId, getReservedTilesAtTime, getVinOfReservedTilesAtTime, hasReservation, isReserved, reservepublic ReservationGrid(int xNum,
int yNum,
double gridTimeStep)
xNum - the number of time tiles in the x directionyNum - the number of time tiles in the y directiongridTimeStep - the time step.public void cleanUp(double currentTime)
currentTime - the current timepublic int getXnum()
public int getYnum()
public int calcX(int tid)
tid - the ID of the time tilepublic int calcY(int tid)
tid - the ID of the time tilepublic int calcTileId(int x,
int y)
x - the x-coordinatey - the y-coordinatepublic int getxNum()
public int getyNum()
public double getGridTimeStep()
public int calcDiscreteTime(double time)
time - the timepublic double calcRemainingTime(double time)
time - the timepublic double calcTime(int discreteTime)
discreteTime - the timepublic double getLastReservedTime()
public List<Integer> getReservedTilesAtTime(double time)
time - the timeCopyright © 2013. All rights reserved.