Documente Academic
Documente Profesional
Documente Cultură
Monterrey
Campus Saltillo
Queueing Theory
Session Activities
Roll Call
Queueing Theory
Why is it important to study it?
Poisson and Exponential distributions
Queueing Models (Kendall Notation)
Examples
Exercises
Waiting Line Systems
Everybody sometime in our life have
waited in a line.
We waited in the supermarket, at the
bank, in a restaurant.
In fact, not only people waits: jobs,
aircrafts, parts, etc.
It is a necessary evil.
3
Why to study them ?
To quantify the phenomenon of "waiting in queues" by
representative efficiency measures, such as:
Average queue length
Average wait time in queue
Average utilization of facilities
Etc.
Mc Burger
McBurger is a fast food restaurant. The manager has
ordered a study to investigate complaints about slow
service. The study indicates the following:
Number of cashiers 1 2 3 4 5 6 7
Average Waiting Time
(mins) 16.2 10.3 6.9 4.8 2.9 1.9 1.3
Optimal Level of
Service
Cost of Clients
Waiting
Level of Service
What affects a Queueing System?
Arrivals
Source size: unlimited, limited.
Pattern of arrivals to the system: programmed or random.
Behavior of arrivals: leave or wait.
Waiting line
Finite or infinite
Servers
Configuration
Distribution of service times
7
REMINDER
Two of the most common distributions are Poisson and
Exponential:
Poisson describes the distribution of arrivals per unit of
time. This distribution is discrete
The exponential distribution studies the time between
each of these arrivals. This distribution is continuous
If the arrivals are Poisson, the time between these arrivals
is exponential
Exponential
Poisson
8
Poisson & Exponential Relationships
Exponential Poisson
Interval t0 n = 0, 1, 2, …
t ( t ) n e t
Density Function f (t; ) e , t 0 pn (t )
n!
Probability of no arrivals in
e -t e -t
time t
POISSON Distribution
Poisson Distribution is given by:
n
P(n; ) e n 0,1,2,...
n!
10
EXPONENTIAL Distribution
Exponential Distribution is given by :
t
f (t; ) e , t 0
Where is the mean waiting time for the next event
recurrence.
11
Exponential Features
The expected value and the probability that t≤T are given
by: 1
E{t}
T
P(t T ) e t dt 1 e t
0
16
Average time a
customer waits in
queue
Equations Wq
Average customers or
units in the system
L
System utilization (in
percentage)
Average time a 1
customer spends in W
the system
Percentage of
idle time Po 1
2
Lq
k 1
The probability that
Average number of Pn k the number of
customers in queue customers in the
system is > k 17
EXAMPLE
In Arnold's Workshop, mufflers are installed by a mechanic
at a rate of 3 mufflers/hour. Customers come to the
workshop at a rate of 2 customers/hour. Larry Arnold, the
shop owner, wants to find the numerical values associated
with a queuing system.
18
SOLUTION
L=2
W=1
Lq = 4/3
Wq = 2/3
ρ = 0.67 PROVE IT!
Po = 0.33
Get with EXCEL the probability that 0 (zero) to 10 cars be in
the system at any given time.
19
k 1
Pn k
6 0.058
7 0.039
21
Information You Need:
Average use of ATM
Average number of customers in queue
Average number of customers in the system
Average waiting time in the queue
Average time in the system
Percent of the time the ATM is idle
22
COSTS IN A QUEUEING SYSTEM
Total Cost of Service = mCs
Total Waiting Cost = (λW)Cw
Total Waiting in Queue Cost = (λWq)Cw
Total Cost = mCs + λWCw
where:
m ~ number of servers (channels)
Cs ~ cost per server or channel.
Cw ~ cost of waiting in line/customer.
W ~ waiting time (Wq in queue)
23
EXAMPLE – Mufflers Shop
Arnold believes that the dissatisfaction cost of waiting in
queue is $ 10 customer/hour. When the car is in service,
customers will not mind waiting. The mechanic will be
paid $ 7 / hour. Obtain:
Total cost (per day)
Total cost of service per day
Total cost of the system
24
EXERCISE
Let’s suppose the shop owner finds a new mechanic who
charges $ 9.00 an hour, but who changes mufflers at a rate
of 4 / hour. Does it suit Arnold to change him?
25
MODEL OF MULTIPLE CHANNELS WITH POISSON ARRIVALS
AND EXPONENTIAL SERVICE TIMES
26
M/M/m – Model with “m” chanels
Multiple servers (channels) with Poisson arrivals and
exponential service times
A single row is formed and the customer is serviced as the
channels become free
Arrivals are attended FIFO and once in the row, should be
attended, sooner or later.
The arrival rate does not change with time and arrivals are
distributed Poisson from an infinite population
Service times are exponential, vary from one customer to
another and are independent
The service rate is greater than the arrival rate
RATES…
m ~ Number of open channels (serving servers)
~ Average number of arrivals per period.
µ ~ Average service rate on each channel.
28
Multichannel Model Equations
The probability of having zero clients in the system:
1
Po m
m 1 1 1 m
n m
n 0 n! m! m
30
More…
The average time a unit passes on the line waiting for
service (in qeue):
1 Lq
Wq W
Usage rate:
m
31
Another Visit to the Arnold Workshop
Arnold analyzed the costs if he paid for another mechanic,
a more expensive than the previous one, but who works
faster. Now we will analyze the option of opening an
additional area for customer service with another mechanic
in charge. Instead of dismissing the mechanic, another one
is hired that works similarly, ie with μ = 3 clients / hour,
without changing the arrival ( = 2 clients / hour).
Customers would wait in a single row to be served. Help
Arnold analyze the operation of his workshop with m = 2
and compare.
32
Visit No.3 to Arnold’s
Arnold already analyzed the costs if we paid another
mechanic, more expensive than the previous one, but
works faster. Now we will analyze the option of opening an
additional area for customer care with another mechanic in
charge. In other words, instead of dismissing the mechanic,
another is contracted to work similarly, ie with μ = 1 clients
/ min, without changing the arrival ( = 14 clients / min).
Customers would expect in a single row to be served. Help
Arnold analyze the operation of his workshop with m = 15
and compare.
33
SOLUTION
Probability of zero autos in the system:
1 1
Po 0.5
1 1 2 1 2 2(3)
n 2
2 1 4 6
1
3 2 9 6 2
n 0 n! 3 2! 3 2(3) 2
L
2(3) 2 3 2
1 2
0.75
2
(1)!(2(3) 3) 2 3
34
SOLUTION – cont.
Average time spent in a car in the system :
3
L 4 3
W
2 8
Average number of cars in the queue
3 2 1
Lq L 0.83
4 3 12
Average time in the queue
Lq 0.83
Wq 0.415
2
35
EXERCISE
Make a comparative table for the Arnold Workshop where
you consider: A mechanic, 2 mechanics and a faster but
more expensive mechanic.
Analyze costs
36
EXERCISE
A bank has a busy ATM. In order to improve the service
with your customers you want to increase 3 ATMs in the
same site. Each cashier serves on average 3 clients per
minute. Customers arrive at the cashier at a rate of 7
customers every minute. The bank manager wants to know
the information related to the waiting system in the area of
ATMs.
37
CONSTANT SERVICE TIME MODEL
38
M/D/1 – Servicio Constante
Algunos sistemas tiene tiempo de servicio constante en
lugar de exponencialmente distribuido.
Esto ocurre cuando los clientes se procesan de acuerdo con
un ciclo fijo, como en el caso de un lavado de autos
automático, o el de un juego en un parque de diversiones.
Las otras suposiciones se mantienen:
Las llegadas se atienden PEPS y una vez en la fila, deberá ser
atendido, tarde o temprano.
La tasa de llegada no cambia con el tiempo y las llegadas se
distribuyen Poisson de una población infinita
La tasa de servicio es mayor que la tasa de llegada
Ecuaciones
Tiempo promedio que
un cliente espera en la Wq
2
Número promedio de
2
clientes en la cola Lq Lq cola
2
40
EJERCICIO
Golding Recycling, Inc recolecta y compacta latas de
aluminio y botellas de vidrio en Nueva York. Los camiones
que llegan a descargar el material esperan 15 min en
promedio antes de vaciar sus cargas. El sueldo del chofer y
el costo de ocio del camión se valoraron en $60/hora. Se
puede adquirir un compactador automática que procesa
cargas a una tasa constante de 12 camiones/hora. Los
camiones llegan a una tasa de 8 camiones/hora. Si se instala
el compactador automático su costo se amortizaría a una
tasa de $3/camión descargado. Elabora el análisis
41
SOLUCIÓN - Análisis
Sistema Actual
Costo de espera actual/viaje =(1/4 hora * $60/hora) = $ 15.00
Nuevo Sistema
l =8 camiones/hora
µ =12 camiones/hora
42
Diagramas de Transición
0 1 n-1 n
0 1 2 n-1 n n+1
1 2 n n+1
n 0
pn 1
Ejemplo
La tienda B&K Groceries opera con 3 cajas. El gerente usa
un programa para determinar la cantidad de cajeras en
operación, en función de los clientes en la tienda.
Los clientes llegan a las cajas con una distribución Poisson
con frecuencia de 10/hr. El tiempo promedio de atención a
un cliente es exponencial con 12 min en promedio.
Calcular la probabilidad p de estado estable de que haya n
clientes en las cajas.
Ejemplo - continuación
Programa para determinar el número de cajeras en
operación:
Clientes en la Cajeros
Tienda funcionando
1a3 1
4a6 2
Más de 6 3
Solución
De la información tenemos que n = = 10 clientes/hora
para n =0,1,2,…
60
12 5 clientes por hora, n=1,2,3
n 2 5 10 clientes por hora, n=4,5,6
3 5 15 clientes por hora, n=7,8,…
Solución - continuación
10
p1 p0 2 p0
5
2
10
p 2 p 0 4 p0
5
3
10
p3 p0 8 p0
5
3
10 10
p 4 p 0 8 p0
5 10
3 2
10 10
p5 p0 8 p0
5 10
3 3
10 10
p5 p0 8 p 0
5 10
3 3 n 6 n 6
10 10 10 2
pn p0 8 p0 n = 7, 8, …
5 10 15 3
Solución - continuación
El valor de p se determina de la siguiente ecuación:
2 2
2
2
3
p0 p0 2 4 8 8 8 8 8 8 8 1
3 3 3
O bien, 2 2 2 2 3
p0 31 81 1
3 3 3
1 x
, x 1
Finalmente…
1 1
p0 31 8 1 p0
1
2 55
3
Ejercicio
Calcula la probabilidad de que sólo haya una caja abierta
Cantidad esperada de cajas vacías
La distribución de probabilidades de la cantidad de cajas
abiertas
La cantidad promedio de cajas ocupadas
Ejercicio
En el ejemplo de B&K suponga que el tiempo entre llegadas es
exponencial con media de 5 minutos, y que el tiempo de
atención a un cliente es también exponencial con media de 10
minutos. Además suponga que B&K tiene una cuarta caja y que
las cajas abren dependiendo de incrementos de 2 clientes.
Determina lo siguiente:
Las probabilidades pn de estado estable
La probabilidad de que se necesite al 4ta caja
La cantidad promedio de cajas vacías
COLAS ESPECIALIZADAS POISSON
Considera el siguiente esquema de un sistema
Cola
Frecuencia de Salidas
Frecuencia de llegadas Servidor 1
Servidor 2
Servidor c
Características de la Cola
a/b/c : d/e/f
a ~ Distribución de las llegadas
b ~ Distribución de las salidas
c ~ Cantidad de servidores en paralelo
d ~ Disciplina de la cola
e ~ Cantidad máxima de clientes en el sistema
f ~ Tamaño de la fuente (finito o infinito)
Distribución de Llegadas y Salidas
Las notaciones normales para a y b son
M = Distribución de Markov (o Poisson) de las salidas (tiempo
entre llegadas y salidas exponencial)
D = Tiempo constante (Determinístico)
Ek = Distribución de Erlang o Gamma del tiempo (como suma de
exponenciales independientes)
GI = Distribución general del tiempo entre llegadas
G = Distribución general del tiempo de servicio
Disciplina de Colas
PEPS – Primeras entradas, primeras salidas
UEPS – Ultimas entradas, primeras salidas
SEOA – Servicio en orden aleatorio
DG – Disciplina general (cualquier otro)
COLAS DE UN SOLO SERVIDOR
La población es infinita Implica que no hay cambio en
las tasas
Las llegadas ocurren una a la vez en forma aleatoria. Si
entran a la cola, deberán ser servidas tarde o temprano
Los tiempos de servicio se comportan en forma aleatoria
con cierta función de probabilidad invariable en el tiempo
56
COLAS DE UN SOLO SERVIDOR (cont.)
El sistema tiene capacidad ilimitada
Las unidades son atendidas de acuerdo al orden de su
llegada. (FIFO)
Existe sólo un servidor en el sistema
57
Sistema de Cola
58