0% found this document useful (0 votes)
31 views8 pages

Lesson 4 - Simulation of Queing Systems

Queuing models are mathematical models used to study systems where entities arrive at a service facility and wait in line to be served. There are single server and multi-server queuing models. Key metrics include average delay, number of customers in the queue, and server utilization. The document provides details on simulating a single-server queuing system and calculating performance metrics.

Uploaded by

cosum kondowe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views8 pages

Lesson 4 - Simulation of Queing Systems

Queuing models are mathematical models used to study systems where entities arrive at a service facility and wait in line to be served. There are single server and multi-server queuing models. Key metrics include average delay, number of customers in the queue, and server utilization. The document provides details on simulating a single-server queuing system and calculating performance metrics.

Uploaded by

cosum kondowe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

What are queuing models?

● Queuing models are mathematical models used to study systems where


entities (such as customers, tasks, or data packets) arrive at a service facility
and wait in line (queue) to be served by one or more servers.
● These models help in understanding and optimising the performance of
systems like banks, call centres, computer networks, and manufacturing
processes.
● There are two major categories of queuing models: single server and
multi-server.

1. Single Server Queuing Models:


● In a single server queuing system, there is only one server available to
serve customers.
● When a customer arrives, they join the queue and wait for the server to
become available.
● Examples of single server queuing systems include:
○ A single checkout counter at a grocery store.
○ A single teller at a bank serving multiple customers.
● Key metrics in single server queuing models include:
○ Average number of customers in the queue.
○ Average waiting time in the queue.
○ Server utilisation (percentage of time the server is busy).

2. Multi-Server Queuing Models:


● In a multi-server queuing system, there are multiple servers available to
serve customers simultaneously.
● When a customer arrives, they choose the shortest queue or are
assigned to the next available server.
● Examples of multi-server queuing systems include:
○ Multiple checkout counters at a supermarket.
○ Multiple tellers at a bank serving customers.

BICT4702 Modelling and Simulation. Mzuzu University. -1


● Multi-server systems can be further categorised based on queue
discipline:
○ Parallel Servers: Each server operates independently, serving
customers as they arrive.
○ Tandem Servers: Customers move from one server to the next in
a predefined sequence.
● Key metrics in multi-server queuing models include:
○ Average system time (waiting time plus service time).
○ Queue length distribution across servers.
○ Balanced utilisation of servers to minimise overall waiting time.

Example: Simulation of a single-server queuing system


Problem Statement
● In this system, customers arrive at a service facility and may either find the
server available for immediate service or join a queue if the server is busy.
● The time between arrivals (interarrival times) and the time taken to serve each
customer (service times) are Independent Identically distributed (IID) random
variables.
● The server serves customers in a "first-in, first-out" (FIFO) order, meaning the
first customer to arrive is the first to be served.
● The simulation begins with an empty queue and an idle server.
● The arrival of the first customer is expected after a certain period (interarrival
time).
● The simulation continues until a fixed number of customers (denoted as "n")
have completed their service.

BICT4702 Modelling and Simulation. Mzuzu University. -2


Performance Metrics:

● The performance of the system is assessed using three metrics:


○ Expected average delay in queue (d(n)):
■ This metric represents the average time customers spend waiting
in the queue.
■ To compute d(n), we observe the delays experienced by n
customers during the simulation.
■ Each delay value is obtained from a single simulation run,
resulting in a sample of delays (D1, D2, ..., Dn).
■ The average delay, d(n), is the expected value of this sample,
providing an estimate of the average delay across multiple
simulation runs.

○ Expected average number of customers in the queue (q(n)):


■ q(n) denotes the average number of customers waiting in the
queue over time during the simulation.
■ To estimate q(n), we track the number of customers in the queue
at different time intervals.
■ The computation involves calculating the proportion of time the
queue spends at each possible length, weighted by the duration
of each interval.
○ Expected Proportion of time the server is busy (u(n)):
■ This metric indicates the percentage of time during the
simulation that the server is busy serving customers.
■ The utilisation of the server, u(n), is computed by examining the
intervals when the server is idle versus when it is busy.
■ The calculation involves determining the proportion of time the
server is busy relative to the total simulation time.

BICT4702 Modelling and Simulation. Mzuzu University. -3


Calculating expected average delay for n customers

● We take the average of n delays (D’s) observed in the simulation run.


𝑛
∑ 𝐷𝑖
𝑖=1
𝑑(𝑛) = 𝑛

Calculating expected average number of of customers in que (4 simple steps)

● To calculate the expected time-average number of customers in a single-server


queuing system (denoted as q(n)), there are 4 simple steps to follow. Before we
explore the steps, let us define some key variables:
○ Let Q(t) denote the number of customers in the queue at time t.
○ Let T(n) be the total time during the simulation that we observe n delays.
○ Let pi be the expected proportion of time that Q(t) is equal to i.
● Calculating q(n) involves the following steps:

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.

BICT4702 Modelling and Simulation. Mzuzu University. -4


4. Rewriting our formula:
● We can rewrite the formula using the total time spent at each queue
length (Ti) divided by the total observed time (T(n)). This is
computationally easier and gives the same result.

Σ 𝑖𝑇𝑖
𝑞(𝑛) = 𝑇(𝑛)

● 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).

T0 = (1.6 - 0) + (4.0 - 3.1) + (5.6 - 4.9) = 3.9


T1 = (2.1 - 1.6) + (3.1 - 2.4) + (4.9 - 4.0) + (5.8 - 5.6) = 2.3
T2 = (2.4 - 2.1) + (7.2 - 5.8) = 1.7
T3 = (8.6 - 7.2) = 1.4

BICT4702 Modelling and Simulation. Mzuzu University. -5


Σ 𝑖𝑇𝑖
● Therefore the numerator for the equation 𝑞(𝑛) = 𝑇(𝑛)
is (0 x 3.9) + (1 x

2.3) + (2 x 1.7) + (3 x 1.4) = 9.9


● Dividing by T(6) = 8.6 we get 9.9/8.6 = 1.15 as the expected time-average
number of people in the queue.
● The expected average number of customers in the queue (q(n)) can also be
found by calculating the integral of the area under the curve of 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).

Calculating expected utilisation of server

● 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.

BICT4702 Modelling and Simulation. Mzuzu University. -6


● In our example, the server is idle when there has been a departure but no
arrivals, leading to queue length 0 and no customer being serviced. Otherwise,
the server is busy.
● The figure below is a plot of B(t) for the same example we are working with.
Note that it is also a time-average function.

● To find u(n) we:


○ Look at the intervals when the server is actively serving customers.
These intervals represent the periods when the server is busy.
○ Sum up the durations of all the intervals identified in step 1. This gives us
the total time the server spends serving customers during the
simulation.
○ Divide the total time the server is busy by the total time of the
simulation. This gives us the proportion of time the server is busy, which
represents the expected utilisation of the server.

(3.3 −0.4) + (8.6 − 3.8)


𝑢(𝑛) = 8.6
= 0.90

● This indicates that the server is busy 90% of the time


● Similar to calculation expected average number of customers in que, th
numerator in the equation above can be viewed as area under the curve tóf

BICT4702 Modelling and Simulation. Mzuzu University. -7


the function B(t), thus:

𝑇(𝑛)
∫ 𝐵(𝑡) 𝑑𝑡
0
𝑢(𝑛) = 𝑇(𝑛)

● Finding expected server utilisation is useful in finding:


○ Performance bottlenecks when server utilisation is closer to 100%
○ Underutilization of server resources when utilisation is closer to 0%

References
Law, A.,. (2014). Basic Simulation Modelling. In Simulation Modelling and Analysis(pp.
12-18). McGraw Hill.

BICT4702 Modelling and Simulation. Mzuzu University. -8

You might also like