Lesson 4 - Simulation of Queing Systems
Lesson 4 - Simulation of Queing Systems
1. Calculate Proportions
● For each possible number of customers in the queue (i), calculate the
expected proportion of time the queue spends at that length (pi).
● This involves observing how long the queue stays at each length during
the simulation and calculating the ratio of time spent at each length to
the total time.
2. Weighted Average:
● Calculate the weighted average of the possible queue lengths (i) using
the proportions calculated in step 1.
● This is done by multiplying each proportion by its corresponding queue
length and summing them up i.e ipi
3. Estimate q(n):
● Use the formula q(n) = Σ ipi to estimate the expected average number of
customers in the queue over the observed time period.
Σ 𝑖𝑇𝑖
𝑞(𝑛) = 𝑇(𝑛)
● Say for example, the system under study, for n = 6, has arrivals at 0.4, 1.6, 2.1,
3.8, 4.0, 5.6, 5.8 and 7.2. Service completions occur at 2.4, 3.1, 3.3, 4.9, and 8.6.
The simulation ends at time 8.6.
● We start by computing Ti’s (the total time that we had i customers in the que)
which we can see from the graph above (the values for Q(t).
𝑇(𝑛)
∫ 𝑄(𝑡) 𝑑𝑡
0
𝑞(𝑛) = 𝑇(𝑛)
● The curve of Q(t) represents the number of customers in the queue at any
given time during the simulation. It fluctuates as customers arrive, wait in the
queue, and are served by the server.
● To find q(n), we calculate the integral of the area under the curve of Q(t) over
the entire duration of the simulation. This integral represents the total "work"
done by the queue, which is essentially the total time customers spend waiting
in the queue.
● By integrating the curve of Q(t), we're essentially summing up all the individual
areas under the curve, each of which represents the time a customer spends
waiting in the queue.
● Simply put, the formula for finding q(n) is like adding up all the time each
customer spends waiting in the queue throughout the simulation, as
represented by the curve of Q(t).
● We consider the number of times that the server changes status (busy to idle
and vice versa) as a continuous time average by defining a “busy” function B(t)
● Let B(t) = 1 if the server is busy and let B(t) = 0 is server is idle
● u(n) therefore can be expressed as the total percentage of time that B(t) = 1.
𝑇(𝑛)
∫ 𝐵(𝑡) 𝑑𝑡
0
𝑢(𝑛) = 𝑇(𝑛)
References
Law, A.,. (2014). Basic Simulation Modelling. In Simulation Modelling and Analysis(pp.
12-18). McGraw Hill.