WK8 - Queuing System
WK8 - Queuing System
WK8 - Queuing System
Examples:
Queue up at the checkout counters, restaurants, post office
Jobs wait to be processed on a machine
Planes circle in a stack before given permission to land at
an airport.
Cars stop at traffic lights
66
For example:
Supermarkets must decide how many cash register
check-out positions should be opened
Petrol station must decide how many pumps should
be opened and how many attendants should be on
duty.
Manufacturing plants must determine the optimal
number of mechanics to have on duty each shift to
repair breakdown machines.
Example
No. of 1 2 3 4 5 6 7
cashiers
Average 16.2 10.3 6.9 4.8 2.9 1.9 1.3
waiting
time (min)
67
The results of queuing analysis can be used in the
context of a cost optimization model.
68
A queuing system is described by the following
components: arrivals, waiting lines or queue, queue
discipline, service facility and departures
System
Server
Customer
arrivals
Waiting line Order taking Customer
and order leaves after
filling order is
filled
Customer
Server
Source
Facility
Service
Queue
Idle
69
Interarrival time and service time can be
probabilistic (operation of a post office) or
deterministic (arrival of applicants for job
interviews).
Queuing behaviour
Jockey from one queue to another – reduce waiting
time
Balk from joining a queue – anticipate long delay
70
Service facility
Servers in parallel – all servers provide the same type
of service and a customer only pass through one server
to complete service, e.g. post office
Servers in series – a customer must pass through
several servers before completing service, e.g.
assembly line
Servers in network - routers in a computer network
Service rate
Constant – washing machine’s cycle (laundry shop)
Vary –described according to a number of
probability distribution
Departure
Once arrivals are served, they become departures
Departing customers are not usually allowed to re-enter
the system immediately because frequent re-entries by
departing entities may affect the arrival rate.
Arrivals Service
facility
Queue
Departures
71
Single-server, single-phase system
Type 1 Type 2
Arrivals Service Service
facility facility
Queue
Departures
Single-server, multi-phase system
Queue
Service facility 2
Service facility 3
Departures
Type 1 Type 2
Arrivals Service Service
facility 1 Facility 1
Queue
Departures
Type 1 Type 2
Service Service
facility 2 Facility 2
Departures
72
No. of cashiers 1 2 3 4 5 6 7
_____________________________________________
Idleness (%) 0 8 12 18 29 36 42
______________________________________________
Example 2
73
2. For each of the situations in Problem 1, identify the
following:
(a) nature of the calling source (finite or infinite),
(b) nature of arriving customers (individually or in
bulk),
(c) type of the interarrival time (probabilistic or
deterministic),
(d) definition and type of service time,
(e) queue capacity (finite or infinite), and
(f) queue discipline.
74
Negative Exponential (Exponential) Distribution
f t e t , t 0
1
Et
1
vart
2
75
Generalized Poisson Queuing Model
Recall: Poisson assumptions - The interarrival and the service
times follow the exponential distribution.
Define
n = Number of customers in the system (in-queue
plus in-service)
76
pn is derived as a function of n and n .
0 1 2 n 1 n n 1
77
Under steady-state conditions, for n 0 , the expected rates
of flow into and out of state n must be equal.
Expected rate of
n 1 pn 1 n 1 pn 1
flow into state n
Expected rate of
n n pn
flow out of state n
Balance equation:
n 1 pn 1 n 1 pn 1 n n pn , n 1,2,
0 p0 1 p1 , n0
p2 1 0 p0
21
By induction,
0
pn n 1 n 2 p0 , n 1,2,
n n 1 1
p0 pn 1
n 0
78
Example 17.5-1
79
Thus,
10
p1 p0 2 p0
5
2
10
p2 p0 4 p0
5
3
10
p3 p0 8 p0
5
3
10 10
p4 p0 8 p0
5 10
3 2
10 10
p5 p0 8 p0
5 10
3 3
10 10
p6 p0 8 p0
5 10
3 3 n6 n 6
10 10 10 2
pn p0 8 p0 ,n 7 ,8,...
5 10 15 3
2 2
2
2
3
p0 p0 2 4 8 8 8 8 8 8 8 ... 1
3 3 3
80
or, equivalently
2 2 2
p0 31 8 1 ... 1
3 3
1
p1 p2 p3 2 4 8 .255
55
We can use pn to determine measures of performance for the
B & K situation. For example,
Expected number
3 p0 2 p1
p2 p3 1 p4 p5 p6 0 p7 p8 ...
of idle counters
1 counter
81
Specialized Poisson Queues
System
Departure
Server 1 Rate
Departure
Arrival Server 2 Rate
Rate
Departure
Queue Server c Rate
Characteristics:
i. Customers are served by the first available
server
ii. Arrival rate customers per unit time
iii. All parallel servers are identical service rate
for any server is customers per unit time
iv. Number of customers in the system in
service + in queue.
A convenient notation:
a / b / c : d / e / f
(Kendall notation) : (Lee notation)
where
a Arrivals distribution
b Departures (service time) distribution
82
c Number of parallel servers 1,2,,
d Queue discipline
e Maximum number (finite or infinite) allowed in
the system (in-queue plus in-service)
f Size of the calling source (finite or infinite)
83
Example: The model M / D / 10 : GD / 20 /
Characteristics:
i. Poisson arrivals (exponential interarrival time)
ii. Constant service time
iii. 10 parallel servers
iv. Queue discipline is GD
v. Only 20 customers in the system
vi. The size of the customer source is infinite.
Other examples:
1. M / M / 1 : SIRO,20,
2. M / G / 3 : FIFO,30,
84
Ls npn
n 1
Lq n c pn
n c 1
By definition,
Expected waiting Expected waiting Expected service
time in system time in queue time
1
Ws Wq
eff
Therefore, Ls Lq
eff
Average number of busy server, c Ls Lq
Hence,
Facility c
utilizatio n c
85
Example
86
Single-Server Models
Assumptions:
1) Infinite-capacity source
2) Arrivals occur at the rate of customers per unit time
3) Service rate is customers per unit time
n
,n 0,1,2,
n
Let ,
0
pn n 1 n 2 p0 , n 0,1,2,
n n 1 1
pn n p0 , n 0,1,2,
pn p0 1 1
n 0
2
1
Assuming 1, 1 2
1
87
Thus, p0 1
Ls npn nn 1
n 0 n0
1 nn 1 nn 1
n 0 n0
d n d 1
1 1
d n 0 d 1
1
1 -
2
1 1
Ls L 1
Ws s
eff
1
Wq Ws
1
2
Lq Wq
1
c Ls Lq
88
Example
Automata car wash facility operates with only one bay. Cars
arrive according to a Poisson distribution with a mean of 4 cars
per hour and may wait in the facility’s parking lot if the bay is
busy. The time for washing and cleaning a car is exponential
with a mean of 10 minutes. Cars that cannot park in the lot can
wait in the street bordering the wash facility. This means that
for all practical purposes, there is no limit on the size of the
system. The manager of the facility wants to determine the size
of the parking lot.
Solution
= , = , =
2
Lq 1.33 cars.
1
89
An arriving car will find a space 90% of the time if there are at
most K cars in the system,
p0 p1 pK 0.9
pn n 1 , n 0,1, 2, 1
= 1 1 2
K 0.9
= 1 K 1 0.9
K 1 0.1
ln 0.1
K 1 5
4
ln
6
Thus, K 5 parking spaces
90
For the same example, do the following:
91
Second Case - M / M / 1 : GD / N /
There is a limit N on the number in the system
, n 0,1, , N 1
n
0, n N , N 1,.
n , n 0,1,2,
Using ,
n p0 , n N
pn
0, nN
p0 1 2 N 1
1
1 N 1 , 1
p0
1 , 1
N 1
92
Thus,
n 1
1 N 1 , 1
pn ,n 0,1, , N
1 , 1
N 1
N
Ls npn
1 N 1 N N N 1
, 1
n 0 1
1 N 1
N
Ls , 1
2
93
Example
94
Example
95
Multiple-Server Models
c parallel servers
arrival rate
service rate per server
eff
The arrivals wait in a single waiting line and then move to
the first open channel for service
Effect of using c parallel servers is a proportionate
increase in the facility service rate.
n , n 0 ,1,2, ,
n , n c
n
c , n c
Thus,
n n n
p0 p p0 , nc
2 n3 n
n 0
n! n!
pn n n
c p0 p
n c n 0
p ,
nc 0
nc
i c
n c c! c c! c
i 1
96
Let and assuming 1,
c
1
c 1 n c n c
p0
n 0 n! c! n c c
1
c 1
n c 1
, 1
n 0 n! c! 1 c
c
c 1
Lq n c pn p
n c c 1! c p 2 0
Lq
Wq
1 1
Ws Wq Wq Ws
Ls Ws
97
Example Final 2004/05
Consider a two-channel queuing system with Poisson
arrivals and exponential service times. The mean arrival
rate is 14 units per hour, and the mean service rate is 10
units per hour for each channel.
a) What is the probability that no units are in the system?
b) What is the average number of units in the system?
c) What is the average time a unit waits for service?
d) What is the average time a unit is in the system?
Solution
98
Second case - M / M / c : GD / N / , c N
, 0 n N
n
0, nN
n , 0 n N
n
c , cnN
n
p0 , 0 n c
pn nn !
p , cnN
c! c n c 0
where
1
N c 1
c 1
c 1 c
, 1
n
n 0 n! c
p0 c! 1
c
1
c1 N c 1 , 1
n c
n 0 n! c!
c
99
For 1,
c
N c 1 N c
N c 1
Lq n c pn 1 N c 1 1 p0
n c c 1! c
2 c c
c
For 1,
c
c N c N c 1
Lq p0
2c!
lost pN
eff lost 1 p N
Lq
Wq
1 1
Ws Wq Wq Ws
Ls Ws
100
Example
101
Machine Servicing Model -
M / M / R : GD / K / K , R K
K machines
R available repair persons
breakdowns per unit time per machine
service rate - machines per unit time
All breakdowns and services are assumed to follow the
Poisson distribution.
Finite calling source
n K n , 0 n K
K n , 0 n K
n
0, nK
n , 0nR
n
R , RnK
102
From the generalized model:
CnK n p0 , 0 n R
pn
K n!
n
Cn p , RnK
n R 0
R!R
1
R K n K
K n!
n
p0 Cn Cn n R
n 0 n R 1 R ! R
K
Ls npn
n 0
eff E K n K Ls
103
Example
b) Find average down time for a police car that needs repairs
104
Queues in Series
System
Figure 1
Theorem
105
Example
The last two things that are done to a car before its
manufacture is complete are installing the engine and putting
on the tires. An average of 54 cars per hour arrive requiring
these two tasks. One worker is available to install the engine
and can service an average of 60 cars per hour. After the
engine is installed, the car goes to the tire station and waits for
its tires to be attached. Three workers serve at the tire station.
Each works on one car at a time and can put tires on a car in an
average of 3 minutes. Both interarrival times and service times
are exponential.
a) Determine the mean queue length at each work station
b) Determine the total expected time that a car spends
waiting for service.
Solution
c1 1
c2 2
106
For stage 1 (engine),
2
Lq
1
Lq
Wq
Lq
Lq
Wq
Thus, the total expected time a car spends waiting for engine
installation and tires is
107
Queues With Priorities
Assumptions:
108
Priority service may follow one of two rules:
M i / Gi / 1 : NPRP / /
Poisson arrivals (interarrival times are
exponential)
Let
109
1
Ei t be the mean and vari t 2 be the
variance.
k
m
i Ei t vari t
i 1
2
Wq
21 S k 1 1 S k
Lqk kWqk
Lsk Lqk k
110
where
k k Ek t
k
S k i 1, k 1,2 , ,m
i 1
S0 0
m k k
Wq Wq
k 1
k
is the relative weight of Wqk .
m
where i and
i 1
Also applies to Ws .
Example
111
Solution
We thus have
1
2
3
We also have
S1
S2
S3
m
i Ei t vari t
i 1
2
112
Example
113