Queueing Theory (Part 4) Nonexponential Queueing Systems and Economic Analysis Queueing Theory-1
Queueing Models with Nonexponential Distributions M/G/1 Model Poisson input process, general service time distribution with mean 1/µ and variance σ 2 Assume ρ = λ/µ < 1 Results P 0 L L q W W q = 1"! 2 2 $ # + " = 2(1! ") = " + L = L q = W q q /! + 1/ µ 2 Notice for M/M/1: Mean service time = 1/µ Variance of service time, σ 2 = 1/µ 2 P 0 =1" # L q = $ 2 µ 2 + # 2 2 1" # ( ) = 2# 2 2( 1" #) = # 2 L = # + L q = # + # 2 1" # 1" # = # 1" # Queueing Theory-2
Queueing Models with Nonexponential Distributions M/D/1 Model Poisson input process, deterministic service time distribution with mean 1/µ and variance σ 2 =0 Assume ρ = λ/µ < 1 L q =! 2 " 2 + # 2 2(1! #) = 0 + # 2 2(1! #) = # 2 2(1! #) L = # + L q Queueing Theory-3
M/D/s: L versus ρ for several values of s L 100 Steady-state expected number of customers in the queueing system 10 1.0 s 2 s 1 s 4 s 3 s 10 s 7 s 5 s 25 s 20 s 15 FIGURE 17.8 Values of L for the M/D/s model (Sec. 17.7). 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Utilization factor s Queueing Theory-4
Queueing Models with Nonexponential Distributions M/E k /1 Model Erlang: Sum of exponentials ( ) k f T (t) = µk ( k "1)! t k"1 e "kµt Think it would be useful? for t # 0 Mean Standard Deviation Variance Yes, because service time may be made up of several tasks each of which has an iid, independent identical exponential distribution, and T = T 1 + T 2 + T 3 + + T K If T i ~ expon(µ) and independent, then T~Erlang(k,µ) Can readily apply the formulae for M/G/1 where! 2 =1/ kµ 2 Also, Erlang k is between exponential and deterministic, and is a 2-parameter family so can get a better fit to more situations As k goes to infinity M/E k /1 approaches M/D/1 When k=1, get exponential 1 µ 1 µ 1 µ 2 Erlang k as k -->, approach deterministic 1 µ 1 kµ 1 kµ 2 1 µ " 0 " 0 Queueing Theory-5
M/E k /2: L versus ρ for several values of k L 100 Steady-state expected number of customers in the queueing system 10 1.0 k 1 k 2 k 8 FIGURE 17.10 Values of L for the M/E k /2 model (Sec. 17.7). 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Utilization factor s Queueing Theory-6
Application of Queueing Theory We can use the results for the queueing models when making decisions on design and/or operations Some decisions that we can address Number of servers Efficiency of the servers Number of queues Amount of waiting space in the queue Queueing disciplines Queueing Theory-7
Number of Servers Suppose we want to find the number of servers that minimizes the expected total cost, E[TC] Expected Total Cost = Expected Service Cost + Expected Waiting Cost (E[TC]= E[SC] + E[WC]) How do these costs change as the number of servers change? Expected cost E[TC] E[SC] increases with number of servers E[WC] decreases with number of servers Number of servers Minimum E[TC] is not necessarily where E[SC] and E[WC] intersect Queueing Theory-8
Repair Person Example SimInc has 10 machines that break down frequently and 8 operators The time between breakdowns ~ Exponential, mean 20 days The time to repair a machine ~ Exponential, mean 2 days Currently SimInc employs 1 repair person and is considering hiring a second Costs: Each repair person costs $280/day Lost profit due to less than 8 operating machines: $400/day for each machine that is down Objective: Minimize total cost Should SimInc hire the additional repair person? Queueing Theory-9
Repair Person Example Problem Parameters What type of problem is this? M/M/1? M/M/s? M/M/s/K? M/M/s//N finite calling population? (close, but not exactly have to draw the rate diagram finite number of machines (10), but maximum of 8 operating at a time) M/G/1? M/E k /1? M/D/1? What are the values of λ and µ? Time between breakdowns ~expon. mean = 20 days λ = 1 customer / 20 days for each machine operating Compare 1 and 2 servers time to repair ~expon. mean = 2 days µ = 1 customer / 2 days Queueing Theory-10
Repair Person Example Rate Diagrams Draw the rate diagram for the single-server and two-server case 8λ 8λ 8λ 7λ 6λ 3λ 2λ λ Single server 0 1 2 3 4 8 9 µ µ µ µ µ µ µ µ 10 Two servers 0 1 2 3 4 8 9 10 Expected service cost (per day) = E[SC] = 1 server: 280 $/day 2 servers: 2(280) $/day = 560 $/day Expected waiting cost (per day) = E[WC] = ( ) = 400 n # 2 400 1" P 3 + 2P 4 +!+ 8P 10 µ 2µ 2µ 2µ 2µ 2µ 2µ 2µ 10 $ ( )P n = $ g( n)p n where g n n= 3 ( ) = % 0 if n = 0,1,2 & ' 400 n # 2 ( ) if n = 3,4, 10 Queueing Theory-11
Repair Person Example Steady-State Probabilities Write the coefficients for the balance equations for each case Single server 2 servers C 0 =1 # C 1 = 8 " & % ( $ µ ' # C 2 = 8 2 "& % ( $ µ ' # "& C 3 = 8 3 % ( $ µ ' # C 4 = 8 3 ) 7 " & % ( $ µ ' # C 5 = 8 3 ) 7 ) 6 " & % ( $ µ ' 2 3 4 5 = 8 2 ) 8! # "& % ( 5! $ µ ' How to find E[WC] for s=1? s=2? E WC 10 [ ] = 400 n " 2 5 C 6 = 8 2 " 8! $ #' & ) 4! % µ ( C 7 = 8 2 " 8! $ #' & ) 3! % µ ( C 8 = 8 2 " 8! $ #' & ) 2! % µ ( C 9 = 8 2 " 8! $ #' & ) 1! % µ ( C 10 = 8 2 " 8! $ #' & ) 0! % µ ( #( )P n = # g( n)p n where g n n= 3 10 n= 0 6 7 8 9 10 ( ) = C 0 =1 # C 1 = 8 " & % ( $ µ ' C 2 = 82 2 # "& % ( $ µ ' # C 3 = 83 "& 2 2 % ( $ µ ' C 4 = 83 ) 7# "& 2 3 % ( $ µ ' C 5 = 82 2 ) 8! # "& 4 % ( 5! $ µ '! $ 0 if n = 0,1,2 % & 400 n " 2 ( ) if n = 3,4, 10 2 3 4 5 Queueing Theory-12
Repair Person Example E[WC] Calculations s=1 s=2 N=n g(n) P n g(n) P n P n g(n) P n 0 0 0.271 0 0.433 0 1 0 0.217 0 0.346 0 2 0 0.173 0 0.139 0 3 400 0.139 56 0.055 24 4 800 0.097 78 0.019 16 5 1200 0.058 70 0.006 8 6 1600 0.029 46 0.001 0 7 2000 0.012 24 0.0003 0 8 2400 0.003 7 0.00004 0 9 2800 0.0007 0 0.000004 0 10 3200 0.00007 0 0.0000002 0 E[WC] $281/day $48/day Queueing Theory-13
Repair Person Example Results We get the following results s E[SC]: E[WC]: E[TC]: 1 $280/day $281/day $561/day 2 $560/day $48/day $608/day * min! 3 $840/day $0/day $840/day What should SimInc do? Stay with 1 server Could consider other possibilities to reduce E[TC]; - instead of another server, decrease service time by considering faster equipment or an apprentice - consider a different maintenance policy to decrease arrival rate Queueing Theory-14
Supercomputer Example Emerald University has plans to lease a supercomputer They have two options Supercomputer Mean number of jobs per day Cost per day MBI 30 jobs/day $5,000/day CRAB 25 jobs/day $3,750/day µ MBI = 30 jobs/ day µ CRAB = 25 jobs/ day Students and faculty jobs are submitted on average of 20 jobs/day, (λ = 20 jobs /day) distributed Poisson i.e. Time between submissions ~ 1/20 = 0.05 day = 1.2 hours Which computer should Emerald University lease? Queueing Theory-15
E[TC] = E[SC] + E[WC] Supercomputer Example Expected service cost:!# 5000 $/day for MBI E [ SC] = " $# 3750 $/day for CRAB Consider two forms for waiting costs (ω = waiting time in days): If waiting cost is linear: h(ω)=cω then E[h(ω)] = ce[ω] = cw $/job and then E[WC] = cwλ = cl $/job job/day $/day If waiting cost is not linear: h(ω) = 500 ω + 400 ω 2 then E[h(ω)] is more difficult to express Queueing Theory-16
Supercomputer Example Waiting Cost Function Assume the waiting cost is not linear: h(ω) = 500 ω + 400 ω 2 (ω = waiting time in days) What distribution do the waiting times follow? for M/M/1 f w (") = µ ( 1# $ )e #µ( 1#$ )" What is the expected waiting cost, E[WC]? % E h " ( )" d" & ( )µ 1# $ [ ( )] = 500" + 400" 2 0 ' 58 $/job for MBI = ( ) 132 $/job for CRAB #µ 1#$ ( )e ' 1160 $/day for MBI E[WC] = E[h(")]* = ( ) 2640 $/day for CRAB $/day $/job jobs/day Queueing Theory-17
Supercomputer Example Results Next incorporate the leasing cost to determine the expected total cost, E[TC] E[ TC] = E[ SC] + E[ WC] E[ TC] = Which computer should the university lease? MBI " 5000 $/day + 1160 $/day = 6160 $/day for MBI * # $ 3750 $/day + 2640 $/day = 6390 $/day for CRAB Queueing Theory-18