0% found this document useful (0 votes)
58 views107 pages

QueueingTheory PartI

The document introduces queuing theory and its importance in analyzing production and service processes. It describes the components of a queuing system including the arrival process, queue configuration, service mechanism, and queue discipline. Common queuing models and how queuing analysis can inform system design decisions are also discussed.

Uploaded by

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

QueueingTheory PartI

The document introduces queuing theory and its importance in analyzing production and service processes. It describes the components of a queuing system including the arrival process, queue configuration, service mechanism, and queue discipline. Common queuing models and how queuing analysis can inform system design decisions are also discussed.

Uploaded by

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

Lec 1: Introduction to

Queuing and Simulation

Business Process Modeling, Simulation and


Design
(Math Analysis II)

1
Overview (I)
• What is queuing/ queuing theory?
– Why is it an important tool?
– Examples of different queuing systems
• Components of a queuing system
• The exponential distribution & queuing
• Stochastic processes
– Some definitions
– The Poisson process
• Terminology and notation
• Little’s formula
• Birth and Death Processes

2
Overview (II)
• Important queuing models with FIFO discipline
– The M/M/1 model
– The M/M/c model
– The M/M/c/K model (limited queuing capacity)
– The M/M/c//N model (limited calling population)
• Priority-discipline queuing models
• Application of Queuing Theory to system
design and decision making

3
Overview (III)

• Simulation – What is that?


– Why is it an important tool?
• Building a simulation model
– Discrete event simulation (DES)
• Structure of a BPD simulation project
• Model verification and validation
• Example – Simulation of a M/M/1 Queue

4
What is Queuing Theory?

• Mathematical analysis of queues and waiting times in


stochastic systems.
– Used extensively to analyze production and service processes
exhibiting random variability in market demand (arrival times) and
service times.
• Queues arise when the short term demand for service
exceeds the capacity
– Most often caused by random variation in service times and the
times between customer arrivals.
– If long term demand for service > capacity the queue will explode!

5
Why is Queuing Analysis Important?
• Capacity problems are very common in industry and one
of the main drivers of process redesign
– Need to balance the cost of increased capacity against the gains of
increased productivity and service
• Queuing and waiting time analysis is particularly
important in service systems
– Large costs of waiting and of lost sales due to waiting

Prototype Example – ER at Hospital


• Patients arrive by ambulance or by their own accord
• One doctor is always on duty
• More and more patients seeks help  longer waiting times
 Question: Should another MD position be instated?
6
A Cost/Capacity Tradeoff Model

Total
cost
Cost

Cost of
service

Cost of waiting

Process capacity

7
A Cost/Capacity Tradeoff
Model
• A cost/capacity trade-off refers to the
decision-making process of choosing
between two or more options that have
varying costs associated with them. In
essence, it is the trade-off between the costs
and benefits of choosing one option over
another.

8
Examples of Real World Queuing Systems?
• Commercial Queuing Systems
– Commercial organizations serving external customers
– Ex. Dentist, bank, ATM, gas stations, plumber, garage …
• Transportation service systems
– Vehicles are customers or servers
– Ex. Vehicles waiting at toll stations and traffic lights, trucks or ships
waiting to be loaded, taxi cabs, fire engines, elevators, buses …
• Business-internal service systems
– Customers receiving service are internal to the organization providing
the service
– Ex. Inspection stations, conveyor belts, computer support …
• Social service systems
– Ex. Judicial process, the ER at a hospital, waiting lists for organ
transplants or student dorm rooms … 9
Components of a Basic Queuing Process

Input Source The Queuing System

Served
Calling Jobs Service Jobs
Queue Mechanism
Population
leave the
system

Arrival Queue
Process Discipline
Service
Queue
Process
Configuration
10
Components of a Basic Queuing Process (II)
 The calling population
– The population from which customers/jobs originate
– The size can be finite or infinite (the latter is most
common)
– Can be homogeneous (only one type of customers/ jobs)
or heterogeneous (several different kinds of
customers/jobs)
 The Arrival Process
– Determines how, when and where customer/jobs arrive to
the system
– Important characteristic is the customers’/jobs’ inter-
arrival times
– To correctly specify the arrival process requires data
collection of interarrival times and statistical analysis.
11
Components of a Basic Queuing Process (III)
 The queue configuration
– Specifies the number of queues
• Single or multiple lines to a number of service
stations
– Their location
– Their effect on customer behavior
• Balking and reneging
– Their maximum size (# of jobs the queue can hold)
• Distinction between infinite and finite capacity

12
Customer Behaviors
• Balking of Queue
Some customers decide not to join the queue due to their
observation related to the long length of queue, insufficient
waiting space or improper care while customers are in
queue. This is balking, and, thus, pertains to the
discouragement of customer for not joining an improper or
inconvenient queue.
• Reneging of Queue
Reneging pertains to impatient customers. After being in
queue for some time, few customers become impatient and
may leave the queue. This phenomenon is called as
reneging of queue.

13
Example – Two Queue Configurations

Multiple Queues Single Queue


Servers Servers

14
Multiple v.s. Single Customer Queue Configuration

Multiple Line Advantages Single Line Advantages

1. The service provided can 1. Guarantees fairness


be differentiated – FIFO applied to all arrivals
– Ex. Supermarket express lanes 2. No customer anxiety
2. Labor specialization possible regarding choice of queue
3. Customer has more flexibility 3. Avoids “cutting in” problems
4. Balking behavior may be 4. The most efficient set up for
deterred minimizing time in the queue
– Several medium-length lines are 5. Jockeying (line switching) is
less intimidating than one very avoided
long line

15
Components of a Basic Queuing Process (IV)
 The Service Mechanism
– Can involve one or several service facilities with one or several
parallel service channels (servers) - Specification is required
– The service provided by a server is characterized by its service time
• Specification is required and typically involves data gathering and
statistical analysis.
• Most analytical queuing models are based on the assumption of
exponentially distributed service times, with some generalizations.
 The queue discipline
– Specifies the order by which jobs in the queue are being served.
– Most commonly used principle is FIFO.
– Other rules are, for example, LIFO, SPT, EDD…
– Can entail prioritization based on customer type.

16
Queue discipline
FIFO LIFO
- meaning new - removes the most
entities are added to recently added
the back of the queue, element yet to be
and the entities at the removed.
front of the queue are
processed first

17
Mitigating Effects of Long Queues
1. Concealing the queue from arriving customers
– Ex. Restaurants divert people to the bar or use pagers, amusement parks
require people to buy tickets outside the park, banks broadcast news on
TV at various stations along the queue, casinos snake night club queues
through slot machine areas.
2. Use the customer as a resource
– Ex. Patient filling out medical history form while waiting for physician
3. Making the customer’s wait comfortable and distracting their
attention
– Ex. Complementary drinks at restaurants, computer games, internet
stations, food courts, shops, etc. at airports
4. Explain reason for the wait
5. Provide pessimistic estimates of the remaining wait time
– Wait seems shorter if a time estimate is given.
6. Be fair and open about the queuing disciplines used 18
A Commonly Seen Queuing Model (I)

The Queuing System

The Service Facility

C S = Server
The Queue C S
Customers (C)
CCC…C •

Customer =C C S

19
A Commonly Seen Queuing Model (II)
• Service times as well as interarrival times are assumed
independent and identically distributed
– If not otherwise specified
• Commonly used notation principle: A/B/C
– A = The interarrival time distribution
– B = The service time distribution
– C = The number of parallel servers
• Commonly used distributions
– M = Markovian (exponential) - Memoryless
– D = Deterministic distribution
– G = General distribution
• Example: M/M/c
– Queuing system with exponentially distributed service and inter-arrival
times and c servers
20
Importance of the Queuing Theory
-Improve Customer Service, continuously.
-When a system gets congested, the service delay
in the system increases.
• A good understanding of the relationship
between congestion and delay is essential for
designing effective congestion control for any
system.
• Queuing Theory provides all the tools needed
for this analysis.
Queuing Models
• Calculates the best number of servers to
minimize costs.
• Different models for different situations (Like
SimQuick, we noticed different measures for
arrival and service times)
• Exponential
• Normal
• Constant
• Etc.
Queuing Models Calculate:
• Average number of customers in the system
waiting and being served
• Average number of customers waiting in the line
• Average time a customer spends in the system
waiting and being served
• Average time a customer spends waiting in the
waiting line or queue.
• Probability no customers in the system
• Probability n customers in the system
• Utilization rate: The proportion of time the system
is in use.
Assumptions
• Different for every system.
• Variable service times and arrival times are
used to decide what model to use.
• Not a complex problem:
– Queuing Theory is not intended for complex problems.
We have seen this in class, where this are many decision
points and paths to take. This can become tedious,
confusing, time consuming, and ultimately useless.
How the Queuing Theory is used in
Supply Chain Management
• Supply Chain Management use simulations and
mathematics to solve many problems.

• The Queuing Theory is an important tool used to model


many supply chain problems. It is used to study
situations in which customers (or orders placed by
customers) form a line and wait to be served by a service
or manufacturing facility.

• Clearly, long lines result in high response times and


dissatisfied customers.
• The Queuing Theory may be used to
determine the appropriate level of capacity
required at manufacturing facilities and the
staffing levels required at service facilities,
over the nominal average capacity required
to service expected demand without these
surges.

26
Answer these riddles and
get a prize.

27
Answer these riddles and get a prize.

1. How does Bill Gates enter his house?


_____________

28
2. What did the mouse say to the webcam?
_____________

29
3. What is an astronaut’s favorite key on a
computer keyboard? _____________

30
4. Why do java programmers wear glasses?

31
Little’s Law
• The mean queue length or the average number
of customers (N) can be determined from the
following equation:
• N= T
• lambda is the average customer arrival rate and
T is the average service time for a customer.
* Finding ways to reduce flow time can lead to
reduced costs and higher earnings
Poisson Distribution
Poisson role in the arrival and service process:

Poisson (or random) processes: means that the


distribution of both the arrival times and the service
times follow the exponential distribution. Because of
the mathematical nature of this exponential
distribution, we can find many relationships based on
performance which help us when looking at the
arrival rate and service rate.
Poisson process. An arrival process where customers
arrive one at a time and where the interval between
arrivals is described by independent random variables
Poisson’s Law

n
(  t)   t
Pn (t )  e (1)
n!
Poisson’s Law in Physics
• radio active decay
–P[k alpha particles in t
seconds]
–= avg # of prtcls per second
Poisson’s Law in
Operations Research
• planning switchboard sizes
–P[k calls in t seconds]
– =avg number of calls per sec
Poisson’s Law in Biology
• water pollution monitoring
–P[k coliform bacteria in 1000
CCs]
– =avg # of coliform bacteria per
cc

Poisson’s Law in
Transportation
• planning size of highway
tolls
–P[k autos in t minutes]
–  =avg# of autos per minute
Poisson’s Law in Optics
• in designing an optical recvr
–P[k photons per sec over the
surface of area A]
– =avg# of photons per second
per
 unit area
Poisson’s Law in
Communications
• in designing a fiber optic
xmit-rcvr link
– P[k photoelectrons generated at
the rcvr in one second]
– =avg # of photoelectrons per

sec.
Factors of a Queuing System
• When do customers arrive?
– Are customer arrivals increased during a certain time
(restaurant- Denny’s: breakfast, lunch, dinner) Or is the
customer traffic more randomly distributed (a café-starbucks)
• Depending on what type of Queue line, How much
time will customers spend
• Do customers typically leave in a fixed amount of
time?
• Does the customer service time vary with the type of
customer?
Important characteristics
• Arrival Process: The probability distribution
that determines the customer arrivals in the
system.
• Service Process: determines the customer
service times in the system.
• Number of Servers: Amount of servers
available to provide service to the customers
• Queuing systems can then be classified as
A/S/n
A (Arrival Process) and S (Service Process) can
be any of the following:
Markov (M): exponential probability density
(Poisson Distribution)
Deterministic (D): Customers arrival is
processed consistently
“N”: Number of servers
“G”: General, the system has “n” number of
servers
Notation
A/B/x/y/z
• A = letter for arrival distribution
• B = letter for service distribution
• x = number of service channels
• y = number allowed in queue
• z = queue discipline
Examples of Different Queuing
Systems
• M/M/1 (A/S/n)
• Arrival Distribution: Poisson rate (M) tells
you to use exponential probability
• Service Distribution: again the M signifies an
exponential probability
• 1 represents the number of servers
M/D/n
• -Arrival process is Poisson, but service is
deterministic.
• The system has n servers.
ex: a ticket booking counter with n cashiers.
G/G/n
• - A general system in which the arrival and
service time processes are both random
Summary
• M/M/1: The system consists of only one server.
This queuing system can be applied to a wide
variety of problems as any system with a very
large number customers.
• M/D/n: Here the arrival process is poisson and the
service time distribution is deterministic. The
system has n servers. Since all customers are
treated the same, the service time can be assumed
to be same for all customers
• G/G/n: This is the most general queuing system
where the arrival and service time processes are
both arbitrary. The system has n servers.
Pros and Cons of Queuing Theory
(END)
Positives Negatives
• Helps the user to easily • Based on assumptions
interpret data by looking ex. Poisson
at different scenarios Distribution and
quickly, accurately, and service time
easily
• Can visually depict where • Curse of variability-
problems may occur, congestion and wait
providing time to fix a time increases as
future error variability increases
• Applicable to a wide range • Oversimplification of
of topics model
• Mathematical models put a L
restriction on finding real world I
solutions M
– Ex: Often assume infinite I
customers, queue capacity, service T
time, In reality there are such
limitations. A
T
• Relies too heavily on behavior
and characteristics of people to I
work smoothly with the model O
N
S
Types of Queuing Systems
• Single Line Multiple Phase: Wendy’s Drive
Thru -> Order + Pay/Pickup
Types of Queuing Systems
• Multiple Line Multiple Phase: Hospital
Outpatient Clinic, Multi-specialty
Measuring Queuing System
Performance
• Average number of customers waiting (in the
queue or in the system)
• Average time waiting
• Capacity utilization
• Cost of capacity
• The probability that an arriving customer will
have to wait and if so for how long.
Group Exercise
• By 4s
• You will be assigned by a number where each
number corresponds with a topic/ queueing domain

1. Transportation-K 4. Entertainment - Ian


2. Retail and Enterprise -J 5. Systems - O
3. Production / Business

53
Provide the ff:
I. Yellow Paper

1. Background / Scenario
2. Problem
3. Recommendation Solution

II. Choose somebody to share group’s output


54
PART II

55
The Exponential Distribution and Queuing

• The most commonly used queuing models are based on the


assumption of exponentially distributed service times and
interarrival times.

Definition: A stochastic (or random) variable Texp( ),


i.e., is exponentially distributed with parameter , if its
frequency function is:
e t when t  0
fT (t)  
0 when t  0

 The Cumulative Distribution Function is: FT ( t )  1  e t


 The mean = E[T] = 1/
 The Variance = Var[T] = 1/ 2 56
The Exponential Distribution

fT(t)


Probability density

t
Mean=
Time between arrivals
E[T]=1/
57
Properties of the Exp-distribution (I)

 Property 1: fT(t) is strictly decreasing in t


 P(0Tt) > P(t T t+t) for all t, t0

 Implications
– Many realizations of T (i.e.,values of t) will be small; between
zero and the mean
– Not suitable for describing the service time of standardized
operations when all times should be centered around the mean
• Ex. Machine processing time in manufacturing
– Often reasonable in service situations when different customers
require different types of service
– Often a reasonable description of the time between customer
arrivals

58
Properties of the Exp-distribution (II)

 Property 2: Lack of memory


 P(T>t+t | T>t) = P(T >t) for all t, t0

 Implications
– It does not matter when the last customer arrived, (or how long
service time the last job required) the distribution of the time until
the next one arrives (or the distribution of the next service time)
is always the same.
– Usually a fair assumption for interarrival times
– For service times, this can be more questionable. However, it is
definitely reasonable if different customers/jobs require different
service

59
Properties of the Exp-distribution (III)
 Property 3: The minimum of independent exponentially
distributed random variables is exponentially distributed
Assume that {T1, T2, …, Tn} represent n independent and
exponentially distributed stochastic variables with
parameters {1, 2, …, n}.
n
Let U=min {T1, T2, …, Tn}  U  exp(   i )
i 1
 Implications
– Arrivals with exponentially distributed interarrival times from n
different input sources with arrival intensities {1, 2, …, n} can be
treated as a homogeneous process with exponentially distributed
interarrival times of intensity = 1+ 2+…+ n.
– Service facilities with n occupied servers in parallel and service
intensities {1, 2, …, n}can be treated as one server with service
intensity = 1+2+…+n
60
Properties of the Exp-distribution (IV)

 Relationship to the Poisson distribution and the Poisson


Process

Let X(t) be the number of events occurring in the interval [0,t]. If


the time between consecutive events is T and Texp()

(t ) n e nt
P(X( t )  n )  for n  0, 1, ...
n!

 X(t)Po(t)  {X(t), t0} constitutes a Poisson Process

61
Stochastic Processes in Continuous Time

 Definition: A stochastic process in continuous time is a


family {X(t)} of stochastic variables defined over a
continuous set of t-values.
• Example: The number of phone calls connected through a
switch board
X(t)=# Calls

 Definition: A stochastic process {X(t)} is said to have


independent increments if for all disjoint intervals (t i, ti+hi) the
differences Xi(ti+hi)Xi(ti) are mutually independent.
62
The Poisson Process

 The standard assumption in many queuing models is that the


arrival process is Poisson

Two equivalent definitions of the Poisson Process


1. The times between arrivals are independent, identically
distributed and exponential
2. X(t) is a Poisson process with arrival rate  iff.
a) X(t) have independent increments
b) For a small time interval h it holds that
 P(exactly 1 event occurs in the interval [t, t+h]) = h + o(h)
 P(more than 1 event occurs in the interval [t, t+h]) = o(h)

63
Properties of the Poisson Process

 Poisson processes can be aggregated or disaggregated and the


resulting processes are also Poisson processes
a) Aggregation of N Poisson processes with intensities
{1, 2, …, n} renders a new Poisson process with
intensity = 1+ 2+…+ n.
b) Disaggregating a Poisson process X(t)Po(t) into N
sub-processes {X1(t), X2(t), , …, X3(t)} (for example
N customer types) where Xi(t) Po(it) can be done if
– For every arrival the probability of belonging to
sub-process i = pi
– p1+ p2+…+ pN = 1, and i = pi 

64
Illustration – Disaggregating a
Poisson Process

X1 (t )  Po(p1 t )  Po( 1t )
p1

X(t)Po(t) p2 X 2 (t )  Po(p 2 t )  Po( 2t )

pN 
X N (t )  Po(p N  t )  Po( N t )

65
Terminology and Notation
 The state of the system = the number of customers in the system
 Queue length = (The state of the system) – (number of
customers being served)

N(t) = Number of customers/jobs in the system at time t


Pn(t) = The probability that at time t, there are n customers/jobs in the
system.
n = Average arrival intensity (= # arrivals per time unit) at n
customers/jobs in the system
n = Average service intensity for the system when there are n
customers/jobs in it. (Note, the total service intensity for all
occupied servers)
 = The utilization factor for the service facility. (= The expected fraction
of the time that the service facility is being used) 66
Example – Service Utilization Factor

• Consider an M/M/1 queue with arrival rate =  and service


intensity = 
  = Expected capacity demand per time unit
  = Expected capacity per time unit
Capacity Demand λ
 ρ 
Available Capacity μ

• Similarly if there are c servers in parallel, i.e., an M/M/c system


but the expected capacity per time unit is then c*

Capacity Demand 
  
Available Capacity c * 
67
Queuing Theory Focus on Steady State
• Steady State condition
– Enough time has passed for the system state to be independent of the
initial state as well as the elapsed time
– The probability distribution of the state of the system remains the same
over time (is stationary).
• Transient condition
– Prevalent when a queuing system has recently begun operations
– The state of the system is greatly affected by the initial state and by the
time elapsed since operations started
– The probability distribution of the state of the system changes with
time

With few exceptions Queuing Theory has focused on


analyzing steady state behavior
68
Transient and Steady State Conditions
• Illustration of transient and steady-state conditions
– N(t) = number of customers in the system at time t,
– E[N(t)] = represents the expected number of customers in the system.

30
Transient condition Steady State condition
25
N(t)
Number of jobs in the system,

20

15
N(t) E[N(t)]

10

0
0 5 10 15 20 25 30 35 40 45 50

time, t
69
Notation For Steady State Analysis

Pn = The probability that there are exactly n


customers/jobs in the system (in steady state, i.e.,
when t)
L = Expected number of customers in the system
(in steady state)
Lq = Expected number of customers in the queue (in
steady state)
W = Expected time a job spends in the system
Wq= Expected time a job spends in the queue

70
Little’s Formula Revisited

 Assume that n =  and n =  for all n

L  W Lq  Wq

 Assume that n is dependent on n



Let    Pn  n
n 0

L  W Lq   Wq

71
Birth-and-Death Processes

 The foundation of many of the most commonly used


queuing models
 Birth – equivalent to the arrival of a customer or job
 Death – equivalent to the departure of a served customer or job

Assumptions
1. Given N(t)=n,
 The time until the next birth (TB) is exponentially distributed with
parameter n (Customers arrive according to a Po-process)
 The remaining service time (TD) is exponentially distributed with
parameter n
2. TB & TD are mutually independent stochastic variables and
state transitions occur through exactly one Birth (n  n+1)
or one Death (n  n–1)
72
A Birth-and-Death Process Rate Diagram

 Excellent tool for describing the mechanics of a Birth-and-


Death process

0 1 n-1 n

0 1 2  n-1 n n+1

1 2 n n+1

n = State n, i.e., the case of n customers/jobs in the system

73
Steady State Analysis of B-D Processes (I)

• In steady state the following balance equation must hold


for every state n (proved via differential equations)

The Rate In = Rate Out Principle:


Mean entrance rate = Mean departure rate

• In addition the probability of being in one of the states


must equal 1

 Pi  1
i 0

74
Steady State Analysis of B-D Processes (II)

State Balance Equation


0
0 1P1   0 P0 P1  P0
1
 0 P0   2 P2  1P1  1P1 1
1 P2  P1
2
 
n  n 1Pn 1   n 1Pn 1  ( n   n ) Pn  n 1
Pn  Pn 1
 n

   0  01  01 2 
Normalization :  Pi  P0 1       1
i 0  1 1 2 1 2 3 
C0 C2
75
Steady State Analysis of B-D Processes (III)
 Steady State Probabilities


P0  1  Ci Pn  C n P0
i 0

 Expected Number of Jobs in the System and in the Queue


– Assuming c parallel servers

 
L   i  Pi Lq   (i  c)  Pi
i 0 i c

76
The M/M/1 - model

Assumptions - the Basic Queuing Process


 Infinite Calling Populations
– Independence between arrivals
 The arrival process is Poisson with an expected arrival rate 
– Independent of the number of customers currently in the system
 The queue configuration is a single queue with possibly
infinite length
– No reneging or balking
 The queue discipline is FIFO
 The service mechanism consists of a single server with
exponentially distributed service times
  = expected service rate when the server is busy
77
The M/M/1 Model

 n=  and n = for all values of n=0, 1, 2, …


   

0 1 2  n-1 n n+1

   

 Steady State condition:  = (/) < 1

P0 = 1- Pn = n(1- ) P(nk) = k

L=/(1- ) Lq= 2/(1- ) = L-


W=L/=1/(- ) Wq=Lq/=  /( (- ))
78
The M/M/c Model (I)
• Generalization of the M/M/1 model
– Allows for c identical servers working independently from each other
    

0 1 2  c-2 c-1 c c+1

 2 (c-2) (c-1) c c

1
 c1 ( / ) n ( / ) c 1 

P0     
 n ! c ! 1  (  /( c  ) 
 n  0 
Steady State
Condition:
 ( /  ) n
 P0 for n  1,2, , c
 n! =(/c)<1
Pn  
n
 ( /  ) P for n  c  1, c  2,
 c!c n c 0
79
The M/M/c Model (II)

• A Condition for existence of a steady state solution is that


 = /(c) <1

 ( /  ) c 
Lq   ( n  c) Pn  ...  P
2 0
n c c!(1  )

Little’s Formula  Wq=Lq/

W=Wq+(1/)

Little’s Formula  L=W= (Wq+1/ ) = Lq+ / 

80
Example – ER at County Hospital
 Situation
– Patients arrive according to a Poisson process with intensity 
( the time between arrivals is exp() distributed.
– The service time (the doctor’s examination and treatment time of
a patient) follows an exponential distribution with mean 1/
(=exp() distributed)
 The ER can be modeled as an M/M/c system where c=the
number of doctors
 Data gathering
  = 2 patients per hour
  = 3 patients per hour
 Questions
– Should the capacity be increased from 1 to 2 doctors?
– How are the characteristics of the system (, Wq, W, Lq and L)
affected by an increase in service capacity?
81
Summary of Results – County Hospital
• Interpretation
– To be in the queue = to be in the waiting room
– To be in the system = to be in the ER (waiting or under treatment)

Characteristic One doctor (c=1) Two Doctors (c=2)


 2/3 1/3
P0 1/3 1/2
(1-P0) 2/3 1/2
P1 2/9 1/3
Lq 4/3 patients 1/12 patients
L 2 patients 3/4 patients
Wq 2/3 h = 40 minutes 1/24 h = 2.5 minutes
W 1h 3/8 h = 22.5 minutes

• Is it warranted to hire a second doctor ?


82
The M/M/c/K – Model (I)
• An M/M/c model with a maximum of K customers/jobs
allowed in the system
– If the system is full when a job arrives it is denied entrance to the
system and the queue.
• Interpretations
– A waiting room with limited capacity (for example, the ER at County
Hospital), a telephone queue or switchboard of restricted size
– Customers that arrive when there is more than K clients/jobs in the
system choose another alternative because the queue is too long
(Balking)

83
The M/M/c/K – Model (II)

• Still a Birth-and-Death process but with a state dependent


arrival intensity

 for n  0,1,2, , K  1
n  
0 for n  K

Observation
The M/M/c/K model always has a steady state
solution since the queue can never “explode”

84
The M/M/c/K – Model (III)

• The state diagram has exactly K states provided that c<K

       

0 1 2  c-1 c  K-1 K

 2 3 (c-1) c c c

• The general expressions for the steady state probabilities,


waiting times, queue lengths etc. are obtained through the
balance equations as before (Rate In = Rate Out; for every
state)
85
Results for the M/M/1/K – Model
• For  = (/)  1

1  n 1  n
P0  Pn   P0   
1   K 1 1   K 1

 ( K  1) K 1
L  Lq  L  (1  P0 )
1  1   K 1

W  L/ 
Where     n Pn
n 0
Wq  Lq / 
86
The M/M/c//N – Model (I)
• An M/M/c model with limited calling population, i.e., N
clients
• A common application: Machine maintenance
– c service technicians is responsible for keeping N service stations
(machines) running, that is, to repair them as soon as they break
– Customer/job arrivals = machine breakdowns
– Note, the maximum number of clients in the system = N
• Assume that (N-n) machines are operating and the time until
breakdown for each machine i, Ti, is exponentially distributed
(Tiexp()). If U = the time until the next breakdown
 U = Min{T1, T2, …, TN-n}  Uexp((N-n))).

87
The M/M/c//N – Model (II)
• The State Diagram (c service technicians and N machines)
  = Arrival intensity per operating machine
  = The service intensity for a service technician

N (N-1) (N-(c-1)) 

0 1 2  c-1 c  N-1 N

 2 3 (c-1) c c

• General expressions for this queuing model can be obtained


from the balance equations as before

88
Priority-Discipline Queuing Models
• For situations where different customers have different priorities
– For example, ER operations, VIP customers at nightclubs…
• Assuming a situation with N priority classes (where class 1 has
the highest priority) there are two fundamental priority
principles to consider.
1. Non-Preemptive priorities
 A customer being served cannot be ejected back into the queue to
leave place for a customer with higher priority
2. Preemptive priorities
 A customer of lower priority that is being served will be thrown
back into the queue to leave room for a higher priority customer
• Assuming that all customers experience independent exp()
service times and arrive according to Poisson processes  both
models can be analyzed as special case M/M/c models 89
Queuing Modeling and System Design (I)

• Design of queuing systems usually involve some kind of


capacity decision
– The number of service stations
– The number of servers per station
– The service time for individual servers
 The corresponding decision variables are , c and 

• Examples:
– The number of doctors in a hospital,
– The number of exits and cashiers in a supermarket,
– The choice of machine type at a new investment decision,
– The localization of toilets in a new building, etc…

90
Queuing Modeling and System Design (II)
• Two fundamental questions when designing (queuing)
systems
– Which service level should we aim for?
– How much capacity should we acquire?
• The cost of increased capacity must be balanced against
the cost reduction due to shorter waiting time
 Specify a waiting cost or a shortage cost accruing when
customers have to wait for service or…
 … Specify an acceptable service level and minimize the capacity
under this condition
• The shortage or waiting cost rate is situation dependent and
often difficult to quantify
– Should reflect the monetary impact a delay has on the
organization where the queuing system resides
91
Different Shortage Cost Situations

1. External customers arrive to the system


• Profit organizations
 The shortage cost is primarily related to lost revenues –
“Bad Will”
• Non-profit organizations
 The shortage cost is related to a societal cost
2. Internal customers arrive to the system
 The shortage cost is related to productivity loss and associated
profit loss

• Usually it is easier to estimate the shortage costs in


situation 2. than in situation 1.

92
Analyzing Design-Cost Tradeoffs
• Given a specified shortage or waiting cost function the analysis
is straightforward
• Define
– WC = Expected Waiting Cost (shortage cost) per time unit
– SC = Expected Service Cost (capacity cost) per time unit
– TC = Expected Total system cost per time unit
• The objective is to minimize the total expected system cost
TC
Cost

Min TC = WC + SC
SC

WC

Process capacity
93
Analyzing Linear Waiting Costs
• Expected Waiting Costs as a function of the number of
customers in the system
– Cw = Waiting cost per customer and time unit
– CwN = Waiting cost per time unit when N customers in the system


WC  C w  nPn  C w L
n 0

• Expected Waiting Costs as a function of the number of


customers in the queue

WC  C w Lq
94
Analyzing Service Costs

 The expected service costs per time unit, SC, depend on the
number of servers and their speed
• Definitions
– c = Number of servers
  = Average server intensity (average time to serve one
customer)
– CS() = Expected cost per server and time unit as a function of 

SC = c*CS()

95
A Decision Model for System Design
Determining  and c
• Both the number of servers and their speed can be varied
– Usually only a few alternatives are available
• Definitions
– A = The set of available  - options

Min TC  c  Cs ()  WC
A,c  0,1,...

• Optimization
– Enumerate all interesting combinations of  and c, compute TC and
choose the cheapest alternative

From a structural point of view, a few fast servers are usually


better than several slow ones with the same maximum capacity
96
Example – “Computer Procurement”
• A university is about to lease a super computer
• There are two alternatives available
– The M computer which is more expensive to lease but also faster
– The C computer which is cheaper but slower
• Processing times and times between job arrivals
are exponential  M/M/1 model
  = 20 jobs per day
 M = 30 jobs per day
 C = 25 jobs per day
• The leasing and waiting costs:
– Leasing price: CM = $500 per day, CC = $350 per day
– The waiting cost per job and time unit job is estimated to $50 per job
and day
• Question:
– Which computer should the university choose in order to minimize the
expected costs?
97
Simulation – What is it?

• Experiment with a model mimicking the


real world system
– Ex. Flight simulation, wind tunnels, …
• In BPD situations computer based
simulation is used for analyzing and
evaluating complex stochastic systems
– Uncertain service and inter-arrival times

98
Simulation – Why use it?

• Cheaper and less risky than experimenting


with the actual system.
• Stimulates creativity since it is easy to test
the effect of new ideas
• A powerful complement to the traditional
symbolical and analytical tools
• Fun tool to work with!

99
Simulation v.s. Symbolic & Analytical Tools
 Strengths
+ Provides a quantitative measure
+ Flexible – can handle any kind of complex system or statistical
interdependencies
+ Capable of finding inefficiencies otherwise not detected until the
system is in operation
 Weaknesses
– Can take a long time to build
 Usually requires a substantial amount of data gathering
– Easy to misrepresent reality and draw faulty conclusions
– Generally not suitable for optimizing system parameters

 A simulation model is primarily descriptive while an


optimization model is by nature prescriptive
100
Modern Simulation Software Packages are
Breaking Compromises

• Graphical interfaces
 Achieves the descriptive benefits of
symbolic tools like flow charts

• Optimization Engines
 Enables efficient automated search
for best parameter values

101
Building a Simulation Model
• General Principles
– The system is broken down into suitable components or entities
– The entities are modeled separately and are then connected to a
model describing the overall system
 A bottom-up approach!
• The basic principles apply to all types of simulation models
– Static or Dynamic
– Deterministic or Stochastic
– Discrete or continuous
• In BPD and OM situations computer based Stochastic
Discrete Event Simulation (e.g. in Extend) is the natural
choice
– Focuses on events affecting the state of the system and skips all
intervals in between

102
Steps in a BPD Simulation Project
1. Problem formulation Phase 1
Problem Definition
2. Set objectives and overall project plan

4. Data Collection
Phase 2
3. Model conceptualization
Model Building
5. Model Translation

No Phase 3
6. Verified
Yes Experimentation
No No
7. Validated
Yes
8. Experimental Design
Phase 4
Implementation
9. Model runs and analysis

Yes No 11. Documentation, reporting and


10. More runs 103
implementation
Model Verification and Validation

• Verification (efficiency)
– Is the model correctly built/programmed?
– Is it doing what it is intended to do?
• Validation (effectiveness)
– Is the right model built?
– Does the model adequately describe the reality you want to
model?
– Does the involved decision makers trust the model?

 Two of the most important and most challenging issues in


performing a simulation study

104
Model Verification Methods

• Find alternative ways of describing/evaluating the system


and compare the results
– Simplification enables testing of special cases with predictable
outcomes
 Removing variability to make the model deterministic
 Removing multiple job types, running the model with one job type at
a time
 Reducing labor pool sizes to one worker
• Build the model in stages/modules and incrementally test
each module
– Uncouple interacting sub-processes and run them separately
– Test the model after each new feature that is added
– Simple animation is often a good first step to see if things are
working as intended
105
Validation - an Iterative Calibration Process

The Real System


Conceptual
validation

Conceptual Model
Calibration and 1. Assumptions on system components
Validation 2. Structural assumptions which define the
interactions between system components
3. Input parameters and data assumptions

Model
verification
Operational Model
(Computerized representation)
106
Example – Simulation of a M/M/1 Queue
• Assume a small branch office of a local bank with only
one teller.
• Empirical data gathering indicates that inter-arrival and
service times are exponentially distributed.
– The average arrival rate =  = 5 customers per hour
– The average service rate =  = 6 customers per hour
• Using our knowledge of queuing theory we obtain
  = the server utilization = 5/6  0.83
– Lq = the average number of people waiting in line
– Wq = the average time spent waiting in line

Lq = 0.832/(1-0.83)  4.2 Wq = Lq/   4.2/5  0.83


• How do we go about simulating this system?
– How do the simulation results match the analytical ones?
107

You might also like