650 likes | 918 Views
Queuing Theory. Overview . Introduction M/M/1 M/M/s M/M/s/K M/M/s with finite calling population. Introduction. queuing theory? mathematical study of queues and waiting lines waiting line? current demand for service exceeds current capacity to provide service
E N D
Overview Introduction M/M/1 M/M/s M/M/s/K M/M/s with finite calling population 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
Introduction • queuing theory? • mathematical study of queues and waiting lines • waiting line? • current demand for service exceeds current capacity to provide service • how much service to provide? • providing too much is costly • but: excessive waiting is costly • impossible to predict accurately when units arrive to seek service and/or how much time is required to provide service 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
Introduction • queuing theory • does not solve problems related to stochastics directly • provides useful information required by decision makers • average # in waiting line / system • average waiting time • average time in system • utilization rate 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
Basic Queuing Process • input source • customers requiring a service are generated over time • customers • enter queuing system • join a queue • queue discipline • member of queue is selected for service by some rule (f.e. FCFS) • service mechanism • required service is performed for the customer 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
basic queuing system queuing system service mechanism input source service rate (μ) [expected number of customers completing service per time unit] arrival rate (λ) [expected number of arrivals per time unit] 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
useful results “birth” “death” service mechanism average # in queue (Lq) input source average waiting time in queue (Wq) average # in system (L) average time in system (W) 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
input source • size • number of potential customers (calling population) • common assumption: unlimited • statistical pattern • how customers are generated • common assumption: • # of customers generated until some specific time: poisson process • interarrivaltime: exponential distribution • behavior of customers • balking (refuse to enter system) 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
queue • queue capacity • maximum permissible number of customers that can be in queue • finite vs. infinite • queuing discipline • order how members of queue are selected • first-come-first-served • random • priority procedure 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
service mechanism • one or more service facilities • each of them: one or more parallel service channels (servers) • service time • how long does it take to serve customers? • follows some probability distribution • common: assume same for all servers • exponential distribution • Erlangdistribution • break downs? 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
single vs. multiple servers • single server • multiple servers server server server 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
remarks • server • not necessarily a single person • could be machine as well • queue • not necessarily a line (waiting room) • Kendall notation: X / Y / s • X distribution of arrivals • Y distribution of service times • M exponential distribution (memoryless) • D deterministic • EkErlang distribution • G general distribution • s number of servers 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
terminology • State of system • number of customers in queuing system • state of servers (idle/busy) • arrival times of individual customers • N(t) • # of customers being in queuing system at time t (t ¸0) • Pn(t) • probability of exactly n customers in system at t • n (n) • mean arrival (service) rate when n customers are within system • expected interarrival (service) time • utilization factor for service facility 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
system status changes over time • at start • depends on initial state and on time already elapsed • system is in a transientcondition • after sufficient time elapsed • state of system becomes independent of initial state • system eventually reached a steady-state condition • probability distribution of state of system remains unchanged 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
relationship between L, W, Lq, Wq • Little’s formula (John Little, 1961) • L = W • Lq = Wq • W = Wq + 1 / 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
Managerial Implications • Low utilization levels provide • better service levels • greater flexibility • lower waiting costs (e.g., lost business) • High utilization levels provide • better equipment and employee utilization • fewer idle periods • lower production/service costs • Must trade off benefits of high utilization levels with benefits of flexibility and service 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
Flexibility/Utilization Trade-off High utilization Low ops costs Low flexibility Poor service L Lq W Wq Low utilization High ops costs High flexibility Good service = 0.0 = 1.0 Utilization 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
Cost Trade-offs Combined Costs Cost Sweet Spot – Min CombinedCosts Cost of Waiting Cost of Service * =1.0 = 0.0 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
birth- and death process • describes how N(t) changes as t increases • given N(t) = n, • the current probability distribution of the remaining time until the next birth (arrival) is exponential with parameter n • the current probability distribution of the remaining time until the next death (departure) is exponential with parameter n • random variables are mutually independent • special type of continuous time Markov chain 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
graphical representation • rate diagram λ0 λ1 λ2 λn-2 λn-1 λn λn+1 … … 0 1 2 n-1 n n+1 μ2 μ3 μn-1 μn μn+1 μn+2 μ1 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
rate in = rate out • in equilibrium, the tendency to move out of a certain state must equal the tendency to move towards that state • balance equations for state n 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
rate in = rate out • solving for yet unknown Pn • in order to simplify 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
calculate P0 • requirement • implies • and finally 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
determine L, Lq, W, Wq • average # of customers in system • average length of queue • average time spent in system • average waiting time • average mean arrival rate 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
M/M/1 single server model
properties M/M/1 • interarrival times • iid according to an exponential distribution • input process is Poisson • service times • iid according to another exponential distribution • number of servers = 1 • constant mean arrival rate () and mean service rate () • independent of system’s state • utilization rate = / < 1 otherwise no steady-state condition can be reached 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
rate diagram λ λ λ λ λ λ λ … … 0 1 2 n-1 n n+1 μ μ μ μ μ μ μ 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
M/M/1 • example • Boulder Reservoir has one launching ramp for small boats. On summer weekends, boats arrive for launching at a mean rate of 6 boats per hour. It takes an average of s=6 minutes to launch a boat. Boats are launched FCFS. • = 6 per hour • = 1/6 per minute = 10 per hour • = 6/10 = 60% 6 6 6 6 6 6 6 … … 0 1 2 n-1 n n+1 10 10 10 10 10 10 10 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • steady state probabilities 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • average # in system 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
formulas for M/M/1 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
M/M/s multiple server model
rate diagram λ λ λ λ λ λ λ … … 0 1 2 s-1 s s+1 2μ 3μ (s-1)μ sμ sμ sμ μ 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
M/M/s • example • a bank employs 4 tellers to serve its customers. Customers arrive according to a Poisson process at a mean rate of 3 per minute. If a customer finds all tellers busy, he joins a queue that is serviced by all tellers; i.e., there are no lines in front of each teller, but rather one line waiting for the first available teller. The transaction time between the teller and customer follows an exponential distribution with a mean of 1 minute. • M/M/4 • = 3 (customers/minute) • = 1 (customers/minute) • = / (s ) = 3/4 < 1 otherwise no steady-state condition can be reached 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • rate diagram 0 =3 3 =3 4 =3 5 =3 6 =3 1 =3 2 =3 … 0 1 2 3 4 5 6 4 =4 5 =4 7=4 1 =1 2 =2 3 =3 6 =4 no queue some tellers idle customers can be served immediately queue all tellers busy customers have to wait 4 servers 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • steady state probabilities 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • average # in system • replace ¾ by x 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • average # in queue 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • applying Little’s Law • average time in system • average waiting time 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
formulas for M/M/s 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
formulas for M/M/s 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
M/M/s/K finite queue variation of the M/M/s
M/M/s/K • basic idea • finite queue • space in waiting area is limited (a maximum of K customers can be accommodated in the system) • customers balk because queue is too long • any customer that arrives while queue is full is refused to enter into the system and leaves forever • mean input rate into system = 0
rate diagram λ λ λ λ λ λ … … 0 1 2 s K 2μ 3μ sμ sμ sμ μ 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
M/M/s/K • example • an airline ticket office as two ticket agents answering incoming phone calls for flight reservations. In addition, one caller can be put on hold until one the agents is available to take the call. • If all three phone lines (both agent lines and the hold line) are busy, a potential customer gets a busy signal, and it’s assumed that the call goes to another ticket office and that the business is lost. • The calls and attempted calls occur randomly (i.e. according to a Poisson process) at a mean rate of 15 per hour. The length of a telephone conversation has an exponential distribution with a mean of 4 minutes. • M/M/2/3 • = 15 (per hour) • = 15 (per hour) 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example • rate diagram λ0 = 15 λ1 = 15 λ2 = 15 3 0 1 2 2 = 30 3 = 30 1 = 15 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I
example unfortunately: LqWq and L W (as n are not equal for all n) 040669 || WS 2008 || Dr. Verena Schmid || PR KFK PM/SCM/TL Praktikum Simulation I