public class Simulation
extends java.lang.Object
| Constructor and Description |
|---|
Simulation() |
| Modifier and Type | Method and Description |
|---|---|
static void |
logEvent(SimulationEvent event) |
static void |
main(java.lang.String[] args)
Entry point for the simulation program.
|
static java.util.List<SimulationEvent> |
runSimulation(int numEaters,
int numCooks,
int numTables,
int machineCapacity)
This function performs the simulation.
|
public static void logEvent(SimulationEvent event)
public static java.util.List<SimulationEvent> runSimulation(int numEaters, int numCooks, int numTables, int machineCapacity)
numEaters - the number of eaters wanting to enter the restaurantnumCooks - the number of cooks in the simulationnumTables - the number of tables in the restaurant (i.e. restaurant capacity)machineCapacity - the capicity of all machines in the restaurantpublic static void main(java.lang.String[] args)
throws java.lang.InterruptedException
args - the command-line arguments for the simulation. There
should be exactly four arguments: the first is the number of eaters,
the second is the number of cooks, the third is the number of tables
in the restaurant, and the fourth is the number of items each cooking
machine can make at the same time.java.lang.InterruptedException