|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Simulation | +--Simulation2
Field Summary | |
private java.util.Vector |
waiting
Holds all waiting parties. |
Fields inherited from class Simulation |
MAX_PARTY_SIZE,
MIN_PARTY_SIZE,
PARTY_SIZES,
schedule,
stats,
TABLE_COUNTS,
tablesTaken,
timer |
Constructor Summary | |
Simulation2(long seed1,
long seed2)
Creates a new instance of the simulation. |
Method Summary | |
protected void |
addToQueue(Party p)
If a table is not available for the party, the party will be added to this "queue". |
protected int |
findTable(Party p)
Attempts to find a table for the specified party. |
protected void |
freeTable(int tableSize)
Frees a table of a specific size. |
Methods inherited from class Simulation |
addArrivals,
arrivalTime,
eatingTime,
isFree,
processArrival,
processDeparture,
processEvent,
runSimulation,
seatAtTable |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.Vector waiting
Constructor Detail |
public Simulation2(long seed1, long seed2)
seed1
- a seed to initialize the EventTimerseed2
- a seed to initialize the EventTimerMethod Detail |
protected int findTable(Party p)
p
- the party to be seatedprotected void addToQueue(Party p)
p
- the party to be added to the "queue"protected void freeTable(int tableSize)
tableSize
- the size of the table to be freed
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |