chapitre 4 files d’attente pour la planification des capacités
DESCRIPTION
Chapitre 4 Files d’attente pour la planification des capacités. Système M/M/1. RESULTATS: Probabilité stationnaire ou distribution: p n = r n (1- r ), n≥0 Où r = l / m est appelé le taux de trafic. Ls = nombre moyen de clients dans le système = l /( m-l ) - PowerPoint PPT PresentationTRANSCRIPT
Chapter 4Queueing models for capacity
planning
Plan
• Introduction to Markov chains
• Queueing models and key results
• Application to hospital capacity planning
• A Queuing Approximation Method for Capacity Planning of Emergency Department with Time-Varying Demand
3
Stochastic processes
ServerQueue
N(t) : N(t) : nb of customers in the queue
Customer arrival
A stochastic process {Xt, t T} : a random variable defined on the same state space E and evolving as time t goes on.
Example: the queue length N(t) at time t
4
Stochastic process
Discrete events
Continuous event
Discrete time
Continuous time
Memoryless
A CTMC is a continuous time and memoryless discrete event stochastic process.
Continuous Time Markov Chain (CTMC)
5
Key conditions for memoryless
Memoryless times •All times (activity times, repair times, lifetimes, …) are exponentially distributed.
•X = EXP(m) : P(X x) = 1 – e-x/m, E[X] = m, Var[X] = m2
Memoryless events
•All events (arrivals, machine failures, …) occur according to a POISSON process
•A POISSON event e of frequency (also called event rate)
time between occurrences of e = EXP(1/)
6
A single server queue
Exponential service time at
rate
Queue
N(t) : N(t) : nb of customers in the queue
Poisson customer arrival at rate
7
Markov chain representation
s1
s2
s3
s4
12Freq. of event e12
13Freq. of event e13
41Freq. of event e41
8
A single server queue
Exponential service time at
rate
Queue
N(t) : N(t) : nb of customers in the queue
Poisson customer arrival at rate
0 1 2 3
9
Steady-state distribution
Steady-state distribution = probability distribution after infinite time
i = probability of being in state i in steady-state
Alternative definition (under ergodicity condition) i = percentage of time of state i over infinite time
10
Determination of the steady-state distribution
s1
s2
s3
s4
12Probability flow
13Probability flow
41Probability flow
Probability flow of event eij =12=frequency of event eij
Flow balance equation
Total flow in = Total flow out
Holds for any state or subset of states
Normalisation equationi i = 1
41 = 12 + 13
11
A single server queue
0 1 2 3
Flow balance equation
Total flow in = Total flow out
Normalisation equationi i = 1
Online derivation
Plan
• Introduction to Markov chains
• Queueing models and key results
• Application to hospital capacity planning
• A Queuing Approximation Method for Capacity Planning of Emergency Department with Time-Varying Demand
13
Definition of a queueing system
Customer arrivals
Departure of impatient customers
Departure of served customers
• A queueing system can be described as follows:"customers arrive for a given service, wait if the service cannot start
immediately and leave after being served"
• The term "customer" can be men, products, machines, ...
14
Notation of Kendall
Kendall notation of queueing systems
T/X/C/K/P/Z
– T: probability distribution of inter-arrival times– X: probability distribution of service times– C: Number of servers– K: Queue capacity– P: Size of the population– Z: service discipline
In this course,– K = : unlimited queue capacity– P = : infinity population– Z = FIFO: First In First Out service
15
Notation of Kendall
T/X/C– T: probability distribution of inter-arrival times– X: probability distribution of service times– C: Number of servers
•T or X can take the following values:
– M : markovian (i.e. exponential)– G : general distribution– D : deterministic
M/M/1 = Markovian arrival & service single server queueM/M/n = Markovian arrival & service n-servers queue
16
Little’s Laws
For any stable system,
L = TH×W(Number = Throughput Delay)
where •L : average number of customers in the system•W : average response time•TH : average throughput rate
Queueing system
LTH TH
W
17
M/M/1 queueM/M/1 queueStationary distribution:Stationary distribution:nn = = nn(1-(1-), ), n≥0n≥0
where where = = // is called traffic intensity is called traffic intensity. .
Ls Ls = Number of customers in the system = = Number of customers in the system = ) = ) = /(/())
WsWs = Sojourn time in the system == Sojourn time in the system =)) = 1/( = 1/())
LqLq = queue length = = queue length = 22/(/())LsLs
WqWq = average waiting time in the queue = = average waiting time in the queue = /(/())WsWs
= departure rate = = departure rate =
Server utilization ratio = Server utilization ratio =
Server idle ratio = PServer idle ratio = P00 = 1 - = 1 -
P{n > k} = Probability of more than k customers = P{n > k} = Probability of more than k customers = k+1k+1
18
M/M/c queue – Erlang C system M/M/c queue – Erlang C system
N(t) is a birth and death process withN(t) is a birth and death process with• The birth rate The birth rate ..• The deadth rate is not constant and is equal to N(t)The deadth rate is not constant and is equal to N(t) if N(t) if N(t) C C
and Cand C if N(t) > C. if N(t) > C.Stability condition : Stability condition : < c< c..
N(t) : number of customers in the system
Exponentially distributed service tim
Poisson arrivals
19
0 1 2 3
11
00 ! ! 1
n cc
n
a an c
, 0n
n c ca nc
Stationary probability distribution:Stationary probability distribution:aoffered loadca/ctraffic intensityn = an/n! 0, 0 < n c
M/M/c queue – Erlang C system M/M/c queue – Erlang C system
20
21c
Ls = Number of customers in the system= Lq + a
Ws = Sojourn time in the system= Wq + 1/
Lq = Average queue length=
Wq = Average waiting time= Lq /
= Average number of busy server, = a
M/M/c queue – Erlang C system M/M/c queue – Erlang C system
21
C(c,a) = Waiting probability of an incoming customer= c + c+1 + ...
wq = random waiting time of a customer (Moment generating funct)
T = Waiting time target
(T) = Service level= P(wq ≤ T)
1
0
! 1,
1! ! 1
c
cn cc
n
ac
C c aa an c
0, with probability 1 ,
, with probability ,qC c a
wEXP c C c a
1 , c TT C c a e
Erlang C formula
M/M/c queue – Erlang C system M/M/c queue – Erlang C system
22
M/M/c with impatient customers M/M/c with impatient customers –Erlang B–Erlang B
0 1 2
• Similar to M/M/C queue except the loss of customers Similar to M/M/C queue except the loss of customers which arrive when all servers are busy.which arrive when all servers are busy.
Markov chain of M/M/2 queue with impatient customers
23
M/M/c with impatient customers M/M/c with impatient customers –Erlang B–Erlang B
Steady state distribution :aoffered loadctraffic intensityn = an/n! 0, 0 < n c
Percentage of lost customers = C
Server utilization ratio = (1 – C) /C
Insensitivity to service time distribution: n depends on the distribution of service time T only through its mean, i.e. with = E[T]
1
00 !
nC
n
an
24
M/M/c with impatient customers M/M/c with impatient customers –Erlang B–Erlang B
0
!,!
c
c c nn
a cB c a
a n
1 ,a B c a
Erlag loss function or Erlang B formula = Percentage of lost customers or overflow probability
Accepted load
25
Normal approximation for staffing Erlang Loss systems
Condition: high offered load (a > 4) and high targeted service level
N(t) = number of patients : approximately normally distributed
E[N(t)] a
In M/M/∞ system, N(t) =d POISSON(a), i.e. E[N(t)] = a, Var[N(t)] = a
Square-Root-Staffing-Formula for a delay probability
c a a
1N a c aP Delay P N t c Pa a
Where is the cdf of the standard normal distribution
M/M/c with impatient customers M/M/c with impatient customers –Erlang B–Erlang B
26
0
!,!
c
c nn
a cB c aa n
Computation issues of Computation issues of Erlang B and C formulaErlang B and C formula
1
0
! 1,
! ! 1
c
n cc
n
ac
C c aa an c
, 1 / , : the reciprocalR c a B c a
1,, 1
cR c aR c a
a
1,
1 1, 1C c a
B c a
1,,
1 1,B c a
B c aB c a
0, 1B a
0, 1C a
!!! recursion for the same offered load !!!
Plan
• Introduction to Markov chains
• Queueing models and key results
• Application to hospital capacity planning
• A Queuing Approximation Method for Capacity Planning of Emergency Department with Time-Varying Demand
21
An introductory exampleAn introductory example
A hospital is exploring the level of staffing needed for a booth in A hospital is exploring the level of staffing needed for a booth in the local mall, where they would test and provide information the local mall, where they would test and provide information on the diabetes. Previous experience has shown that, on on the diabetes. Previous experience has shown that, on average, every 6.67 minutes a new person approaches the average, every 6.67 minutes a new person approaches the booth. A nurse can complete testing and answering questions, booth. A nurse can complete testing and answering questions, on average, in twelve minutes.on average, in twelve minutes.
Assuming s = 2, 3, 4 nurses, a hourly cost of 40€ per nurse and Assuming s = 2, 3, 4 nurses, a hourly cost of 40€ per nurse and a customer waiting cost of 75€ per hour in the system. a customer waiting cost of 75€ per hour in the system.
Determine the following: patient arrival rate, service rate, Determine the following: patient arrival rate, service rate, overall system utilisation, nb of patients in the system (Ls), the overall system utilisation, nb of patients in the system (Ls), the average queue length (Lq), average time spent in the system average queue length (Lq), average time spent in the system (Ws), average waiting time (Wq), probability of no patient, (Ws), average waiting time (Wq), probability of no patient, probability of waiting, total system costs.probability of waiting, total system costs.
22
Patien arrival rate 9 9 9service rate 5 5 5Overall system utilisation 90% 60% 45%L (system) 9,47 2,33 1,91Lq 7,67 0,53 0,11w (system) - in hours 1,05 0,26 0,21Wq - in hours 0,85 0,06 0,01no patient probability (idle) 0,05% 14,60% 16,16%patient waiting proba 85,26% 35,50% 12,85%Total system cost € per hour 790 205 303
An introductory exampleAn introductory example
23
Target occupancy levelTarget occupancy level
Consider obsterics units in hospitals. Obsterics is generally Consider obsterics units in hospitals. Obsterics is generally operated independently of other services, so its capacity needs operated independently of other services, so its capacity needs can be determined without regard to other services. It is also can be determined without regard to other services. It is also one for which the use of a standard M/M/s queueing model is one for which the use of a standard M/M/s queueing model is quite good. Most obsterics patients are unscheduled and the quite good. Most obsterics patients are unscheduled and the assumption of Poisson arrivals has been shown to be a ggod one assumption of Poisson arrivals has been shown to be a ggod one in studies of unscheduled hospital admissions. In addition, the in studies of unscheduled hospital admissions. In addition, the coefficient of variation (CV) of the length of stay (LOS), which is coefficient of variation (CV) of the length of stay (LOS), which is defined as the ratio of the standard deviation to the mean, is defined as the ratio of the standard deviation to the mean, is typically very close to 1 satisfying the service time assumption typically very close to 1 satisfying the service time assumption of the M/M/s model.of the M/M/s model.
Bed capacity of maternity servicesBed capacity of maternity services
24
Since obsterics patients are considered emergent, the American Since obsterics patients are considered emergent, the American College of Obsterics and Gynecology (ACOG) recommends that College of Obsterics and Gynecology (ACOG) recommends that occupancy levels of obsterics units not exceeding 75%. Many occupancy levels of obsterics units not exceeding 75%. Many hospitals have obsterics units operating below this level. hospitals have obsterics units operating below this level. However, some have eliminated beds to reduce « excess » However, some have eliminated beds to reduce « excess » capacity and costs and 20% of NY hospitals had obsterics units capacity and costs and 20% of NY hospitals had obsterics units that would be considered over-utilized by this standard.that would be considered over-utilized by this standard.
Assuming the target occupancy level of 75%, what is the Assuming the target occupancy level of 75%, what is the probability of delay for lack of beds for a hospital with s = 10, probability of delay for lack of beds for a hospital with s = 10, 20, 40, 60, 80, 100, 150, 200 beds.20, 40, 60, 80, 100, 150, 200 beds.
Lesson : Lesson : For the same occupancy level, the probability of delay decreases For the same occupancy level, the probability of delay decreases
with the size of the service.with the size of the service.
Bed capacity of maternity servicesBed capacity of maternity services
25
Evaluation of capacity based on a delay target leads to very Evaluation of capacity based on a delay target leads to very important conclusion. Though there is no standard delay target, important conclusion. Though there is no standard delay target, it has been suggested that the probability of delay for an it has been suggested that the probability of delay for an obsterics bed should not exceed 1%.obsterics bed should not exceed 1%.
What is the size of an obsterics unit (nb of beds) necessary to What is the size of an obsterics unit (nb of beds) necessary to achieve a probability of delay not exceeding 1% while keeping achieve a probability of delay not exceeding 1% while keeping the target occupancy level of 60%, 70%, 75%, 80%, 85%?the target occupancy level of 60%, 70%, 75%, 80%, 85%?
Lesson : Lesson : Achieving high occupancy level while having small probability of Achieving high occupancy level while having small probability of
delay is only possible for obsterics unit of large hospitals.delay is only possible for obsterics unit of large hospitals.Capacity cut should be made with clear understanding of the Capacity cut should be made with clear understanding of the
impact. Simple and naive analysis based on average could lead to impact. Simple and naive analysis based on average could lead to bad decisions. bad decisions.
Bed capacity of maternity servicesBed capacity of maternity services
26
Impact of seasonalityImpact of seasonalityConsider an obsterics unit with 56 beds which experiences a Consider an obsterics unit with 56 beds which experiences a significant degree of seasonality with occupancy level varying significant degree of seasonality with occupancy level varying from a low of 68% in January to about 88% in July.from a low of 68% in January to about 88% in July.
What is the probability of delay in January and in July?What is the probability of delay in January and in July?
If, as is likely, there are several days when actual arrivals If, as is likely, there are several days when actual arrivals exceed the month average by 10%, what is the probability of exceed the month average by 10%, what is the probability of delay for these days in July?delay for these days in July?
Lesson : Lesson : Capacity planning should not be based only on the yearly average. Capacity planning should not be based only on the yearly average.
Extra bed capacity should be planned for predictable demand Extra bed capacity should be planned for predictable demand increase during peak times.increase during peak times.
Bed capacity and seasonalityBed capacity and seasonality
27
Impact of clinical organisationConsider the possiblity of combining cardiac and thoracic surgery patients as thoracic patients are relatively few and require similar nursing skills as cardiac patients.The average arrival rate of cardiac patients is 1,91 bed requests per day and that of thoracic patients is 0,42. No additional information is available on the arrival pattern and we assume Poisson arrivals. The average LOS (Length Of Stay) is 7,7 days for cardiac patients and 3,8 days for thoracic patients.What is the number of beds for cardiac patients and thoracic patients in order to have average patient waiting time for a bed E(D) not exceeding 0,5, 1, 2, 3 days? What is the number of beds if all patients are treated in the same nursing unit?Delay in this case measures the time a patient coming out of surgery spends waiting in a recovery unit or ICU until a bed in the nursing unit is available. Long delays cause backups in operating rooms/emergency rooms, surgery cancellation and ambulance diversion.
Bed capacity reducing through mergingBed capacity reducing through merging
27
Lesson : Lesson : Personal and equipment flexibility and service pooling can Personal and equipment flexibility and service pooling can
achieve higher occupancy level and reduction of beds.achieve higher occupancy level and reduction of beds.
However, priority given to one patient group could significantly However, priority given to one patient group could significantly degrade the waiting time of other patients if all treated in the degrade the waiting time of other patients if all treated in the
same nursing unit.same nursing unit.
Bed capacity reducing through mergingBed capacity reducing through merging
27
Staffing Emergency Department Staffing Emergency Department under Service Level Constraintsunder Service Level Constraints
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
0,5 0,5 0,5 0,5 0,5 1 4 10 10 8 4 8 6 6 4 6 10 15 8 6 4 2 0,5 0,5
You are asked to help improving the nurse planning of an Emergency Department (ED). From the historic data, you are able to obtain the following demand forecast on the number arrivals at the ED:
From the statistics, 60% of the ED patients are regular patients and need only 15 minutes of the nursing care. However 40% of the ED patients are true emergency patients and require about 1h nursing care at ED before transfer to the wards.
27
Patient arrivals
Staffing Emergency Department Staffing Emergency Department under Service Level Constraintsunder Service Level Constraints
Goal 1: Planning shifts to meet loss probability target (<5%, 1%) (Erlang B)
Preliminary goals :•Derive the workload profile of a typical day.
•Enumerate all possible shift patterns. Shifts of 8h start either 7h-9h (20€/h), or 15h-17h (22€/h), or 23-01h (25€/h). Shifts of 12h start either 7h-9h (21€/h) or 19h-21h (23€/h).
Goal 2: Planning shifts to meet waiting time targets (Erlang C)1: less than 20 minutes for at least 80% of patients2: less than 1h for at least 95% of patients
Staffing Emergency Department Staffing Emergency Department under Service Level Constraintsunder Service Level Constraints
Plan
• Introduction to Markov chains
• Queueing models and key results
• Application to hospital capacity planning
• A Queuing Approximation Method for Capacity Planning of Emergency Department with Time-Varying Demand
A Queuing Approximation Method for Capacity
Planning of Emergency Department with Time-
Varying Demand
Qiang LIU, Xiaolan XIE, Ran LIU
Outline Background Problem description and solution Evaluating model Scheduling model Conclusions and future work
Background
Emergency department has to provide timely medical service 24 hours round .
At least one physician in ED at anytime.
Patient arrival rate fluctuates significantly during a day
Arrival rates from the emergency department in Ruijin hospital
Background
Current capacity plan does not take into account fluctuation of patient arrival.
Crowding during peak hours; Low human resource utilization during low arrival
periods; A more efficient plan could be made if we set the starting
working time and shift length flexible.
Outline Background Problem description and solution Evaluating model Scheduling model Conclusions and future work
Problem description and solution
Time-varying patient arrival rate
Flexible working time and shift length of physicians.
Reduce patient waiting time
Relief the crowding in ED
Improve staff utilization
Mathematical Modeling
Capacity Schedule
Key Point:Since the patient arrival rate fluctuates and the number of doctors is also time-dependent, the system cannot reach any steady state.
Results of classic queuing theory do not apply directly to evaluate patient waiting time.
Outline Background Problem description and solution Evaluation model Scheduling model Conclusions and future work
Evaluation model△t Length of each period
λt # of patients arrived in period,
ut # of patients served in period
pt # of physicians in period
qt # of patients overflowedFlow balance equation qt = qt-1 + t - ut
Waiting time of served patientsW(ut, pt) = steady-state waiting time of M/M/C model with arrival rate ut and pt servers.
Similar to existing Pointwise Stationary Approximation (PSA)
Waiting time of overflowed patients t
Non-linear
Evaluation model
,t t t t tw u W u p q
1t t t tq q u
1
T
tt
MIN w
st
t tu p
….….
Solved by linearization of the non-linear function.
*t tp p
# of patients served not exceeding physician service rate
The given schedule
Result of evaluation model
The current capacity plan is to be evaluated
Number of patients served in each period Waiting time in each period
outline Background Problem description and solution Evaluating model Scheduling model Conclusions and future work
Scheduling model
Shift decision variables:
st = number of physicians starting their shift in period t
et = number of physicians completing their shift in period t
Scheduling model
,t t t t tw u W u p q
1t t t tq q u
1
T
tt
MIN w
t tu p
10T
t tts e
12
tt i iip s e p
mod( , 1) mod( 1, 1)
1 1
t L T t U Ti t ii t i te p e
1t tp s
1
Ttts N
Shift length [L, U]
Shifts will overlap each other
N physicians in total
# of physicians and shifts
All shifts start and finish in a day
Evaluation model
Numerical Experiments
• N =10 physicians
• Shift length [5h, 8h]
• Service rate m = 5.9113
• Hourly periods
• Arrival rate collected from hospital history data
Numerical Experiments
New vs actual schedules
# of patients served and delayedActual schedule
# of patients served and delayedNew schedule
outline Background Problem description and solution Evaluating model Scheduling model Conclusions and future work
Conclusions
An evaluation model for a given shift schedule that combines steady-state performance and controlled overflow.
A shift optimization model based on the evaluation model.Resulting staffing schedule better matches the fluctuating
patient arrival.
Future research Improve the accuracy of the evaluation model, especially
when the congestion level is not very high.Design fast solution techniques for solving the evaluation and
shift optimization models.