Java Reference
In-Depth Information
Using these assumptions, we can do the simulation to find out how the queue length varies when there are 2, 3, 4, ...,
and so on, service counters. We assume that there is one queue; the person at the head of the queue goes to whichever
counter first becomes available. In practice, a bank usually assigns more counters at peak periods than at slow periods.
In this case, we can do the simulation in two parts, using the assumptions that apply for each period.
These are other situations in which a similar method of simulation applies:
Checkout counters at supermarkets or stores : We are normally interested in a compromise
between the number of checkout counters and the average queue length. The fewer counters
we have, the longer the queue will be. However, having more counters means more machines
and more employees. We want to find the best compromise between the cost of operation and
service to customers.
Gasoline stations : How many pumps will best serve the needs of the customers?
Traffic lights : What is the best timing of the lights so that the average length of the queues in all
directions is kept to a minimum? In this case, we would need to gather data such as follows:
How often do cars arrive from direction 1 and from direction 2? The answer to this might
be something like this:
Between 5 and 15 cars arrive every minute from direction 1.
Between 10 and 30 cars arrive every minute from direction 2.
How fast can cars leave in direction 1 and in direction 2? The answer might be as follows:
20 cars can cross the intersection in direction 1 in 30 seconds.
30 cars can cross the intersection in direction 2 in 30 seconds.
We assume, in this simple situation, that turning is not allowed.
6.9 Simulating a Queue
Consider the situation at a bank or supermarket checkout, where customers arrive and must queue for service. Suppose
there is one queue but several counters. If a counter is free, the person at the head of the queue goes to it. If all counters
are busy, the customers must wait; the person at the head of the queue goes to the first available counter.
To illustrate, suppose there are two counters; we denote them by C1 and C2. To perform the simulation, we need
to know the frequency with which customers arrive and the time it takes to serve a customer. Based on observation
and experience, we may be able to say the following:
The time between customer arrivals varies randomly from one to five minutes.
The time to serve a customer varies randomly from three to ten minutes.
For the simulation to be meaningful, this data must be close to what occurs in practice. As a general rule,
a simulation is only as good as the data on which it is based.
Suppose we begin at 9 a.m. We can simulate the arrival of the first ten customers by generating ten random
numbers from 1 to 5, like this:
3 1 2 4 2 5 1 3 2 4
This means the first customer arrives at 9:03, the second at 9:04, the third at 9:06, the fourth at 9:10, and so on.
We can simulate the service time for these customers by generating ten random numbers from 3 to 10, like this:
5 8 7 6 9 4 7 4 9 6
 
Search WWH ::




Custom Search