CSCE 146 Matthews Lab 8 June 27, 2002
In this Lab we will do a discrete event simulation using some queues.
We will be running a simulation of a Piggly Wiggly. In particular
we want to know how many cashiers do we need to have working
on the late shift, midnight to 6:00AM,
time to keep the queue lengths manageable.
In this run we will consider having two cash registers open
and thus need two queues.
Input Parameters
Output Produced:
In a given time step, which is 5 seconds, we need to generate
a new random number ranNumber (float) and compare it to ,
the estimate of the probability that a customer will arrive in
this time slot. We will assume that in any time slot at most
one customer will arrive. If a customer arrives then we will use the
nextGaussian method of Random to return a value, , sampled from a N(0,1),
i.e., a Gaussian (normal) distribution with mean 0 and standard deviation 1.
To convert this to a Gaussian N() we use the formula
| (1) |
Then assume that the customers will take 45 seconds to find and place each item in their shopping cart. Assume that a customer will when finished will proceed to the checkout. When the customer gets there he will choose the smaller line. Assume that it takes 5 seconds per item to checkout.
For each customer we should measure how long they are in line and report this to an Averager, as in the CarWash example. Questions:
Imports: Find these in the documentation online.
References: