Вы находитесь на странице: 1из 34

Modeling & Simulation

Lecture 5

Queuing Models Part 1

Instructor:
Eng. Ghada Al-Mashaqbeh
The Hashemite University
Computer Engineering Department
The Hashemite University 2
Outline
Introduction.
Queues types.
Birth-death process.
Models of arrival processes.

The Hashemite University 3
Objectives
At the end of this Lecture, student should
be able to calculate the following for
different queuing systems:
Average waiting times.
Average number of customers.
Server utilization.
In this lecture we will explore what is
known as the Queuing Theory which
is of wide interest in the field of
Computer Engineering.
The Hashemite University 4
Introduction
Each one of us has spent a great deal
of time waiting in lines.
One example is in the Cafeteria.
Other examples of queues are:
Printer queue.
Customers in front of a cashier.
Calls waiting for answer by a technical
support.
The Hashemite University 5
Queueing Theory
Queueing theory is the mathematical study of
waiting lines (i.e. queues).
Why to study them?
Important for many fields like:
Finance.
Computer networks.
CPUs performance study (multiprocessing).
More!!
Queueing theory support you with mathematical
tools to assess the performance of a specific
queue disciplines and to predict future behavior of
the system.
The Hashemite University 6
What makes up a queue?
The System: A collection of objects under
study.
It is important to define the system
boundaries.
The Entities: The people, organisms, or
objects that enter the system requiring some
kind of service.
The Servers: The people, organisms, or
machines that perform the service required.
The Queue: An accumulation of entities that
have entered the system but have not been
served.
The Hashemite University 7
Types of Queues I
Single Stage:




The Hashemite University 8
Types of Queues II
Multiple Stage - Manufacturing Plant
The Hashemite University 9
Types of Queues III
Multi-channel Single Stage - Bank
The Hashemite University 10
Types of Queues IV
Parallel Single Stage - Supermarket
The Hashemite University 11
Types of Queues V
Customer Discrimination Bus
station
The Hashemite University 12
Types of Queues VI
Converging Arrivals - Walk-in and
Drive-thru
The Hashemite University 13
Queue behavior: the actions of
customers while in a queue waiting for
service to begin, for example:
Balk: leave when they see that the line is
too long,
Renege: leave after being in the line when
its moving too slowly,
Jockey: move from one line to a shorter
line.
Queue behavior
The Hashemite University 14
Queues Disciplines
Static disciplines:
First Come First Served - FCFS
Most customer queues
Last Come First Served - LCFS
Packages, Elevator.
Dynamic disciplines:
Served in Random Order - SIRO
Entering Buses
Priority Service
Multi-processing on a computer.
Emergency room.
The Hashemite University 15
Queueing Notations I
A notation system for parallel server
queues: A/B/c/N/K (called Kendalls
Notation)
A represents the interarrival-time distribution,
B represents the service-time distribution,
c represents the number of parallel servers,
N represents the system capacity, omitted if
infinite.
K represents the size of the calling population,
omitted if infinite.
The Hashemite University 16
These symbols are used for arrival and
service distributions:
M is the Poisson (Markovian) process with
exponential distribution of intervals or service
duration respectively.
Em is the Erlang distribution of intervals or
service duration.
D is the symbol for Deterministic (known)
arrivals and constant service duration.
G is a general (any) distribution.
GI is a general (any) distribution with
independent random values.
Queueing Notations II
The Hashemite University 17
Examples
M/M/1
Poisson arrivals, exponential service times,
one server
M/G/1
Poisson arrivals, general service times, one
server
M/D/1
Poisson arrivals, deterministic service times
(fixed), one server

The Hashemite University 18
What factors affect system
performance
The Arrivals Process.
The time between any two successive arrivals
Does this depend on the number of people in
the system?
Finite populations.
The Service Process.
The time taken to perform the service.
Does this depend on the number of people in
the system?
The number of servers operating in system.
The Hashemite University 19
Measuring System Performance
The total time an entity spends in the system
(Denoted by W)
The time an entity spends in the queue.
(Denoted by W
q
)
The number of entities in the system.
(Denoted by L)
The number of entities in the queue.
(Denoted by L
q
)
The percentage of time the servers are busy
(Utilization time)
These quantities are variable over time.
The Hashemite University 20
Birth-Death Processes
It is a particular type of stochastic processes.
A birth-death process is used to model
populations of entities in a system
The state of the system at time t is the number
of entities in the system at that time, often
denoted by N(t).
Births and deaths occur at a constant rate (like
the Poisson and Exponential process model).
First we will revise the exponential distribution
since it is the basic building block of such
process.
The Hashemite University 21
Exponential Distribution I
We will denote X by T since most of the time we are
modeling time using such distribution (e.g. arrivals
or service times).
The exponential distribution is characterized by


1
) ( ] [
1 ) ( F(t)
0
t
0
= =
= = s =
}
}


dt t tf T E
e ds e t T P
t s
2
2 2
0
2 2
1
] [ ] [ ) ( ) ( ] [

= = =
}

T E T E T Var dt t f t T E
etc.) (arrival, rate the is , f(t)
t
e

=
The Hashemite University 22
Exponential Distribution II
What is P(T>t) for an exponential distribution with
parameter ?
P(T>t) = 1- P(T<= t) =1-(1-e
- t
) = e
- t

P(T>t+s|T>s) is the probability of waiting a further
time t after having already waited to time s.

What is P(T>t+s|T>s) for an exponential
distribution with parameter ? (Prove it!!)
e
- (t+s)
/ e
- s
= e
- t

Answer: P(T>t+s|T>s) = P(T>t) This is called the
memoryless property
The Hashemite University 23
An Example of Memoryless
Suppose that the amount of time one
spends in a bank is exponentially distributed
with mean ten minutes.
What is ?
What is the probability that a customer
will spend more than a quarter of an hour
in the bank?
You have been waiting for ten minutes
already. Now what is the probability that
you will spend more than a quarter of an
hour in the bank?
The Hashemite University 24
Birth-Death Processes II
P
i,j
(t) is defined to be the probability
that there are j entities in the system
at time t, given that there were i
entities in the system at time 0.

0 1 2 j-1 j j+1
0

1 j
j

j
1 + j

... ...
The Hashemite University 25
Birth-Death Processes III
The state of the system must be a
non-negative integer
Law 1
A birth increases the state from j to
j+1
The variable
j
is called the birth rate
for state j
A birth occurs between times t and t +
At with probability
j
At + o(At)
The Hashemite University 26
Birth-Death Processes IV
Law 2
A death decreases the state from j to j-1
The variable
j
is called the death rate for state j (note
that
0
=0)
A death occurs between times t and t + At with
probability
j
At + o(At )
Law 3
Births and Deaths are independent
Why must
0
=0?
Why must
k
=0 for finite queues?
Knowledge of
j
and
j
completely specifies a
Birth-Death process.

The Hashemite University 27
Birth-Death Processes V
Birth-Death Processes can be used to
model most M/M/... queuing systems.
An arrival is considered a birth.
A service completion is considered a
death.
Let P
i,j
(t) be the probability N(t+s)
N(s)=j given that N(s)=i (or N(t)=j
given N(0)=i
It turns out that for many queuing
systems, P
i,j
(t) will approach a limit t
j

as t gets larger.
The Hashemite University 28
Birth-Death Processes VI
This limit will be independent of the
initial state i.
t
j
is called the steady state or
equilibrium probability of state j.
t
j
can be thought of as the probability that
at some instant in the future there are j
entities in the system.
t
j
can also be thought of as the fraction of
time that there are j entities in the system.
The Hashemite University 29
Birth-Death Processes MORE I
Consider a M/M/1 queuing system.
Inter-arrival times are exponential with rate
.
Service times are exponential with rate .
Suppose there are j entities in the system
at time t.
What is the probability of an arrival in the
interval (t,t + At]? Hint: use Taylor series
expansion on F(t + At)-F(t) = 1 - e
- At
=
At + o(At)
The Hashemite University 30
Birth-Death Processes MORE II
So the arrivals and service
completions of a M/M/1 queue are a
birth-death process with the following
rate diagram:

0 1 2 j-1 j j+1
0

1 j


... ...
The Hashemite University 31
Birth-Death Processes-
(Balance equations)
It can be shown by induction that






These are called balance equations, therefore:
j j j j j j j j
t t t t + = +
+ + 1 1 1 1
0
2 1
1 1 0
t


t
j
j
j


=
0
1
0
1
1 1 0 0
t

t
t t
=
=
The Hashemite University 32
Birth-Death Processes MORE III
If we define the constants



then

and we know that
j
j
j
c

2 1
1 1 0
=
0
t t
j j
c =
1
1
0 0
0
= + =


=

= j
j
j
j
c t t t
The Hashemite University 33
Birth-Death Processes MORE IV

So


This means that the infinite sum of the c
j
s
must converge.
If this sum is infinite then no steady-state
distribution can exist.
Such equations will be very useful in
computing the main parameters for different
queues types.

=
+
=
1 j
j
0
c 1
1

The Hashemite University 34


Additional Notes
It is your task to find the source for
this material.

Вам также может понравиться