Title: Teaching Queueing
1Teaching Queueing
- TMS 2006 Workshop, San Francisco
- Armann Ingolfsson
- Armann.ingolfsson_at_ualberta.ca
- School of Business
- University of Alberta
- Edmonton, Alberta, Canada
2Exercise 1 Physical Queue Simulation
- I need
- One bank teller
- One announcer
- Ten bank customers
- Also
- Currency
- Post-it notes and pen to identify customers
- Spreadsheet computer to record times
- One computer operator (me)
3Agenda
- First part of my first queuing lecture
- Motivating students with examples of queues and
queue management - How to get numerical answers simulation vs.
formulas - What should one cover in two weeks?
- What we dont do enough of
- What we do too much of
4Before We Start
- Dont worry I wont try to go through every
slide ? - My goal air opinions and ideas (mine and yours)
- Most ideas Ill show you are classroom-tested,
but not all
5Asgard Bank Times Between Arrivals(pg. 173)
6Asgard Bank Arrival Rate
- Given avg. time between arrivals 1.00 minute
- Want average arrival rate per hour ? (1
customer / 1.00 min.) ? (60 min. / 1 hr.) 60
customers / hr.
7Asgard Bank Service Times
8Asgard Bank Service Rate
- Given avg. service time 0.95 minutes
- Want average service rate per hour(if working
continuously) ? (60 min. / 1 hr.) ? (1
customer / 0.95 min.) 63 customers / hour - Note
- the service rate is not the rate at which
customers are served - its the rate at which customers could be served,
if there were enough customers - service rate capacity of a server
9Why Do Customers Wait?
- GivenAverage inter-arrival time 1.00
min.Average service time 0.95 min.
0.95
time
Whats missing from this picture? Answer
Randomness in arrivals and service
completion Randomness causes congestion
10Including Randomness Simulation
- Use the computer to generate random draws from
the inter-arrival time distribution and service
time distribution - Service times
- Normal distribution, mean 57/3600 hrs, stdev
10/3600 hrs. - MAX(NORMINV(RAND(),57/3600,10/3600),0)
- Inter-arrival times
- Exponential distribution, mean 1/ 60 hrs.
- (1/60)LN(RAND())
- To Excel
11Simulated Lunch Hour 1
12Simulated Lunch Hour 2
13Simulated Lunch Hour 3
14Causes of Congestion
- Higher than average number of arrivals
- Lower than average service capacity
- Lost capacity due to timing
Lesson For a service where customers arrive
randomly, it is not a good idea to operate the
system close to its average capacity
15Anatomy of a Congested System
a service completion
waiting room
queue
An arrival
parallel servers
potential customers
16Exercise 2 Queues Youve Been In
- To be done individually
- List the three most annoying / interesting queues
that you have waited in since last Thursday
17Waiting for Housing
- Who are the customers?
- Who are the servers?
- What are the consequences of waiting?
- How would we predict the impact of actions such
as creating more public housing?
Edmonton Journal, July 12, 2006
18Waiting for Patents
Technology Review, May/June, 2006
19More Examples Let the Students do the Work
- Assignment on first day of class Find a
newspaper article, magazine article, TV show,
movie, web page, novel, etc., that is relevant to
the course material - Due at end of semester
- Example 1 Flying pig videohttp//www.youtube.com
/watch?vIcP9Wo3OKY8moderelatedsearchkids20in
20the20hall - Example 2 We Q 4 Uhttp//www.dontq.co.za/
20Exercise 3
- To be done in groups of 3-4
- Answer this question what is queueing theory?
21Exercise 3 follow-up questions
- What should we call the part of a course where we
discuss queues? - Queueing theory?
- Congestion management?
- Managing waiting lines?
- Variability and its impact on process
performance? - Managing flow variability safety capacity?
- Queueing Science?
22Developing a Queueing ToolkitGetting Numerical
Answers
- Simulation
- with a simulation language (Arena, Promodel,
etc.) - in a spreadsheet
- Analytical models (M/M/s, etc.), with
calculations done - with paper, pencil, and a calculator
- in a spreadsheet
- Template
- Function library
- with standalone software
- with a web-based calculator
23Simulation vs. Analytical Models
- Simulation models
- Helps students understand queues construct
arguments for why queues build up - Time-consuming expensive to build and debug
- More realistic
- More performance measures
- Sampling error
- Analytical models
- Faster way to get numerical answers
- Restrictive assumptions
- Limited set of performance measures
- Mostly steady state measures
24Visualization of Simulated Queues Animation
- Good for debugging, validation, convincing people
that model works - Snapshot at one point in time
- Difficult to see patterns over time
25Visualization of Simulated Queues Customer and
Server Graphs
26Visualization of Simulated Queues Customer and
Server Graphs
- Show evolution over time
- Allows students to create stories / explanations
of why congestion occurred or didnt occur - Other uses
- Clean / check data
- Prove Littles Law
- Explain various queue disciplines
27Littles Law L leffW Why it is True
- The short version
- You go through a FCFS queueing system
- Q How many customers will be in the system (L)
when you leave? - A All the customers that arrived while you were
in the system. - You spent an average of W time units in the
system, so the average of number of customers
that arrived would have been leffW - ? L leffW
28The Long Version
t
F(t) area between A and F curves, up to t
A(t)
D(t)
29The Long Version, continued
- leff A(t) / t
- W Total waiting / Total customers F(t) /
A(t) - L Total customer-hours / Total hours F(t) /
t - ? leff ? W (A(t) / t) ? (F(t) / A(t)) F(t)
/ t L
30Transition from Simulation to Analytical Models
31Transition from Simulation to Analytical Models
32Transition from Simulation to Analytical Models
Q Where will this end up, after a very long time?
A 1.5 (well see how to find this answer next
time)
33EOQ and Square Roots
- Need to know how to compute square roots
- Here is an efficient algorithm
- Do you teach your students this?
- Why or why not?
- Why and when should we look inside the black
box?
34Analogy M/M/s Queues and P0
- 2 of 4 service OM texts on my shelf contain
this formula - Why?
- Alternative
35Analytical Models Software Choices
- Custom software
- Stand-alone
- Web-based
- Matlab / Mathematica / Maple
- Spreadsheets
- Templates
- Function libraries, e.g., Queueing ToolPak
add-in(free from www.bus.ualberta.ca/aingolfsson/
qtp )
36Checking Software
- Test case 1 M/M/s, m 1, l x, s x1
- Test case 2 M/M/s, m 1, l x, s 2x
- All textbook software I have seen fails around
x 710 - QTP 3.0 and 4.0 work
37OK, you dont like the P0 formula. Are any
equations worth showing?
38Yes the Laws of Queueing
- Suppose you know L and PrFull. Then you can
calculate - Lq
- W
- Wq
- leff l (1 PrFull)
- r leff /(sm)
- W Wq 1/m
- Littles Law L leffW
- Littles Law for the queue Lq leffWq
- Littles Law for the servers sr leff (1/m)
- L Lq sr
39Exercise 4 Course Design
- Do in groups of 3-4
- Develop a prioritized list of topics to teach in
a two-week module on queueing - Mention the type(s) of students you have in mind,
if you think it is relevant
40Opinions What We Leave Out When Teaching Queueing
- Data collection, analysis, estimation
- Transient non-stationary analysis
- Fluid models are easy, and often appropriate
- Simulation can be used
- Analytical models are not as hard to use as some
people think - Queue behavior
- Reneging / abandonment Erlang A model
- Perceptions of waiting, priorities / fairness
- Balking, retrials
- Analytical approximations
- Square root safety staffing
- G/G/s approximations Lq(G/G/s) (fudge factor)
Lq(M/M/s)
41Typical Call Centre Data 1
1 N. Gans, G. Koole, and A. Mandelbaum (2003),
Telephone Call Centers Tutorial, Review, and
Research Prospects, Manufacturing and Service
Operations Management 579-141.
42Terminology
- Recvd of calls received (arrival rate)
- Answ of calls that were answered, i.e., did
not abandon - Abn (Recvd Answ) / Recvd
- ASA Average speed of answer Wq (seconds)
- AHT Average handle time avg. service time
43Sch Avail Logged in / Scheduled time On Prod
On production / Logged in Occ Active /
Logged in
On production
Active
Available
Unavailable
Unplanned breaks
Logged in
Scheduled time
44Call Centre Data A Service Time Distribution 1
45Call Centre Data Abandoment Rate vs. Time on
Hold 1
46Example Vancouver Intl Airport Security
Checkpoint MBPF
- Capacity 12 / min.
- Three 250-seat planes depart at 10 am
- Passengers start coming through checkpoint 80
min. before departure - 2.5 / min. / flight for 30 min.
- 5 / min / flight for 20 min.
- 2.5 / min / flight for 30 min.
47Example Vancouver Intl Airport Security
Checkpoint
48Example Vancouver Intl Airport Security
Checkpoint
How long does the queue get? How long do people
have to wait? What can be done to reduce waiting?
This is fluid modeling! Even executives can do it!
49What if Departures are Staggered 940, 1000,
1020
No queue build-up No waiting (?)
50Analytical Modeling of Transients
- Myths (?)
- It cant be done
- Its too hard
- Its too slow
- Its not important
- Responses
- Yes it can
- Discrete time is easy (matrix multiplication),
continuous time is not much harder, using
uniformization method - Computations for many real systems can be done in
seconds - Think of a real system that is in steady state
(you can get back to me after the workshop)
51Uniformization Example M/M/4/6
Transition rate L l s m 3.5 4 7.5
52The Equations
And it can even be done in a spreadsheet!
53Visible vs. Invisible Queues
invisible queue (e.g., on the phone)
visible queue (e.g., in the bank)
time
54From a Pizza 73 Ad
What is the purpose of showing the customers this?
55Ambulance Service
- Response time for heart attack victim
- 5 minutes life
- 10 minutes death
- ? 10 min. is more than twice as worse as 5 min.!
- ? Wq not the appropriate performance measure
- Prresponse time lt 859 min. might be more
appropriate - QTPMMS_SERVICELEVEL(.) function
56Fairness
- FCFS First-come-first-served
- FIFO First-in-first-out
- LCFS Last-come-first-served
- SIRO Service-in-random-order
- Priorities perceived as fair?
- Ci slipped by Bo
- Bo was skipped by Ci
- For every slip there is a skip
57Priority System Serve Customer from Highest
Priority Class Next
Example
58Alternative System Serve Customer with highest
(Aging Factor)(Waiting Time) Next
Example
Aging factor 1 for high
0.5 for low
59A Call Centre as a Queueing System
lost calls
agents (servers)
retrials
busy
Arrivals
Queue
abandon
retrials
returns
lost calls
60Which Parts does M/M/s/sC Capture?
lost calls
agents (servers)
retrials
busy
Arrivals
Queue
abandon
retrials
returns
lost calls
61A Better Model M/M/s/sCM
lost calls
agents (servers)
retrials
busy
Arrivals
Queue
abandon
retrials
Customers have exponentially distributed
patience. When they have waited in queue to the
limit of their patience, they abandon ( renege)
returns
lost calls
62M/M/s/sCM Calculatorhttp//www.math.vu.nl/koo
le/ccmath/ErlangX.php
63Reverse-Engineering Patience
- A call centre has 8 agents and 30 hold lines.
The average handling time is 4 minutes per
customer, and the arrival rate is 110 per hour.
The call centre manager knows that many customers
are abandoning, but he does not know how long
customers are willing to wait on hold before
hanging up. He does know that customers spend an
average of 0.67 minutes on hold before either
being connected to an agent or abandoning. - What is the average customer patience?
- What fraction of customers abandon?
64How Variability Impacts Waiting
65Opinions What We Do Too Much Of
- Steady state results
- Markovian models
- Emphasize closed-form formulas
- Manual plugging into formulas