Simulating a Multiple Server Queue

​
total number of customers
50
random seed
1
​
λ, mean arrival rate per hour
50
initial deletion ratio
0.
0.1
0.2
0.3
0.4
0.5
0.6
0.7
μ, mean service rate per hour for one server
30
c, number of servers
1
2
3
4
5
6
7
8
expected
observed
server utilization factor (proportion of time each server is busy): ρ
λ
cμ
0.830
0.650
probability of no customers in the system:
P
0

1
c
(cρ)
c!(1-ρ)
+
c-1
∑
n=0
n
(cρ)
n!
0.091
0.150
probability that an arriving customer has to wait:
P
w
=
c
(cρ)
P
0
c!(1-ρ)
0.760
0.460
average number of customers in the queue:
N
Q

ρ
P
w
1-ρ
3.800
0.810
average number of customers in the system, including the queue: N
N
Q
+cρ
5.500
2.100
average time a customer spends in the queue, in mins.: W60
N
Q
1
λ
4.500
1.100
average time a customer spends in the system, including the queue, in mins.: W+60
1
μ
6.500
3.300
In queuing theory, the simplest model is called the M/M/1 or M/M/c model (Markovian arrivals, Markovian service, and 1 or
c
servers). Customers arrive at a facility and either get served immediately by a free server or join a queue that waits for a server to become available. Standard notation is:
λ
= customer arrival rate in people per hour; it is assumed that the arrival times are a Poisson process, that is, the inter-arrival times follow an exponential distribution with mean
1/λ
;
μ
= rate at which a single server can serve customers, in number per hour; this follows an exponential distribution with mean
1/μ
;
c
​
= number of servers.
In the Demonstration graphic, the number of people in the queue is indicated by the height of the red bars at the bottom; the horizontal green lines indicate customers being served; red lines indicate customers waiting. The table below the graphic shows the expected and observed values of several values associated with such a process. Note that the basic units are hours, but some of the parameters are given in minutes.
In order to look at a typical window of the queue situation, a certain percentage of the initial customers is ignored. This is controlled by the choice of the initial deletion ratio. If this is set to 0 then one sees a simulation that starts with the first customer that walks in the door. In that case, the number in the queue or the system will generally be less than the expected value, since the queue is smaller than the limiting value at the start. If the deletion ratio is set to, say, 0.5, then the graphic shown will start with the customer in the order
N/2
where
N
is the total number of customers. Regardless of deletions, the time starts at 0.

Details

The first snapshot shows the situation starting from an empty queue (initial deletion ratio is 0) and with
λ=μ
. In that case the queue builds up and then increases without bound. The last two snapshots use two servers, with
λ=50
and
μ=30
. The first 70% of the time interval is deleted, thus giving a more typical window on the queue formation process. Still there is a lot of variation in the size of the queue: in the first case the average number of people waiting is 0.57 while in the second it is 13. For more information, see[1] and[2].

References

[1] F. S. Hillier and G. J. Lieberman, Introduction to Operations Research, 8th ed., New York: McGraw-Hill, 2004, pp. 765–774.
[2] R. B. Chase, F. R. Jacobs, and N. J. Aquilano, Operations Management for Competitive Advantage, 10th ed., New York: McGraw-Hill, 2004.

External Links

Simulating the M/M/1 Queue

Permanent Citation

Karl W. Heiner, Stan Wagon
​
​"Simulating a Multiple Server Queue"​
​http://demonstrations.wolfram.com/SimulatingAMultipleServerQueue/​
​Wolfram Demonstrations Project​
​Published: August 9, 2011