Queuing Models in Operations 35E00100 Service Operations and Strategy #4 Fall 2015
Topics Principles of queuing theory Extensions Key points Queue parameters Basic queuing models M/M/1 and M/M/s G/G/1 and G/G/s Extensions Systems with finite buffers Serial (tandem) queuing system Queuing network Multiple priority system Priority queuing network Key points Useful material in the textbook: Hopp, W. & Spearman, M. (2000) Factory Physics, Chapter 8.6
“Customer arrives every 10 minutes, service process takes 8 minutes” 100% 100% 90% 90% 80% 80% “Customer arrives every 10 minutes, service process takes 8 minutes” Ideal situation 70% 70% 60% 60% Probability 50% 50% 40% 40% 30% 30% 20% 20% 10% 10% 0% 0% 15 30 45 60 75 90 105 120 135 150 165 180 195 Reality 0% 5% 10% 15% 20% 25% 30% 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 Yli 40% 50% 60% 70% 80% 90% 100% Arrival rate Probability 0% 5% 10% 15% 20% 25% 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 Yli Probability 40% 60% 80% 90% Service rate 100%
What is queuing theory about? Average number of jobs in queue (WIPq ) Average waiting time in queue (CTq ) Service Arrival rate (ra Service rate (re Average number of jobs in the system (WIP ) Average time in the system (CT )
Cost Trade-Off: Capacity Utilization Total costs Low utilization levels (u < 0.6 ) provide Better service levels Lower waiting costs (e.g., lost business) Greater flexibility High utilization levels (u > 0.9 ) provide Better equipment and employee utilization Fewer idle periods Lower production/service costs Cost of operations Cost Cost of queuing 0 % Utilization 100 %
Cost Trade-Off: Capacity Level Total costs Cost of operations Optimum Cost of queuing Capacity
Kendall's Classification 1/2/3/4/5/6 Queue Server 1 = the nature of arrival process 2 = the nature of service process 3 = the number of (parallel) machines 4 = queue discipline 5 = the maximum allowable number of jobs 6 = the size of population
System Characteristics Inter-arrival and service times M = exponential (Markovian) distribution Memoryless property Common in service models G = completely general distribution (with mean and variance specified) Memoryless property is lost performance approximations Manufacturing environment Typical queuing disciplines FCFS, SPT, EDD, LCFS, etc. Priority classes and within class FCFS
Inter-arrival and Service Times Exponential Distribution 1.0 0.9 0.8 0.7 Exp(1) 0.6 Exp(3) 0.5 Exp(5) 0.4 0.3 0.2 0.1 0.0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 Time (t)
Inter-arrival and Service Times Poisson Distribution 0.40 0.35 If the times between arrivals are independent and exponentially distributed, then the number of customer that arrive within a given period of time is Poisson distributed. These are often referred to as “Poisson arrivals”. For instance, if inter-arrival times are exponentially distributed with mean (1 / ra) = 0.25 hrs, then the number of customer arrivals in a one hour period has a Poisson distribution with mean ra = 4. 0.30 0.25 0.20 0.15 Poisson(1) 0.10 Poisson(3) 0.05 Poisson(5) 0.00 2 4 6 8 10 12 14 16 18 20 Arrivals per hr
M/M/1 Queue - Relevant Equations Utilization rate u Average waiting time CTq Average queue length WIPq Average time of jobs in system CT Average number of jobs in system WIP e.g. Krajewski & Ritzman
M/M/m Queue - Relevant Equations Utilization rate u Average queue length WIPq Average waiting time CTq Average time of jobs in system CT Average number of jobs in system WIP Probability for being idle p0 e.g. Krajewski & Ritzman
General Inter-arrival & Process Times G/G/1 queue Single machine workstations Flow variability, process variability, or both can combine to inflate queue time Variability causes congestion G/G/m queue Multi-machine workstations (parallel machines) Fast and accurate Extremely general Note! This VUT equation is also called Kingman’s Equation. (VUT = Variability x Utilization x Time) Hopp and Spearman 2000, 270
Some points to be remembered Arrival rate is rarely stationary Long term average versus ”worst case” estimate A heuristic to decide how many servers to provide Specify service level by defining the probability for waiting in line Calculate the number of servers Little’s law Lower utilization, less waiting Change in throughput can be avoided by decreasing variability Resource pooling Economies of scale achieved by joining multiple queues into a single queue with multiple machines Problems in one machine do not delay all orders Server Queue 50% ?
Extensions to the Basic Models
Effects of Blocking VUT equation versus real world systems? Blocking models The principle is to estimate WIP and TH for given set of rates and buffer sizes. Typically much more complex than non-blocking (open) models. Often simulation is needed to evaluate realistic systems. Differences of blocking models compared to basic queuing models: Arrival rate is only the rate of potential arrivals Utilization can equal or exceed 100 % Balking rate to be defined (rate at which arrivals are rejected) Hopp and Spearman 2000, 273 - 279
M/M/1/b Queue Model of Station 2 1 2 B Infinite raw materials There is room for b=B+2 jobs in system, B in the buffer and one at each station B Infinite raw materials 1 2 Model of Station 2 Formulas valid for u1 Goes to u/(1-u) as b Always less than WIP(M/M/1) Goes to ra as b Always less than TH(M/M/1) Little’s law Hopp and Spearman 2000, 273 - 279
Illustrating the Effect of Blocking Example 1 Illustrating the Effect of Blocking te1=21 te2=20 1 2 Conclusion: M/M/1/b system has less WIP and less TH than M/M/1 system! 18 % less TH 90 % less WIP Hopp and Spearman 2000, 275 - 277
We need to be able to analyze different types of processes… Single Stage Multi-Stage ATM Car wash Single Channel Queue Server Queue Queue Server Server Bank teller’s windows Hospital admissions Multi- Channel Queue Queue Queue Servers Servers Servers 6
Serial and Network Queuing Systems Serial (or tandem) queuing systems Servers arranged in series e.g. repetitive flow process 1 3 2 Queuing networks Some servers arranged in parallel and some in series E.g. cellular manufacturing, job shops 1a 3a 2a 1b 2b 2c 3b
Example 2 Serial Queuing System 1 3 2 Suppose a company produces a variety of similar but customized products using a three stage batch flow process. Customer orders are received randomly during the day according to a Poisson process at the rate of five orders per day. Because of differences in order (batch) sizes, machine setup times, and operating speeds, and because of machine breakdowns quality problems, and worker fatigue, the time to process a customer order at each production stage is exponentially distributed, with an average processing time of 1/6 day. The 1st stage of the system is then an M/M/1 queue, where orders are the customers and the 1st stage is the server, ra =5 orders/day and re =6 orders/day. It can be proved that in steady state, the pattern of served customers leaving an M/M/1 queuing system will approximate a Poisson process with an average rate of ra. So, the seriel queuing system can be treated as a series of 3 identical M/M/1 queues.
Serial Queuing System u = ra / re = 5/6 = 0.83 Example 2 1 3 2 Serial Queuing System Using the M/M/1 formulas for the 1st stage u = ra / re = 5/6 = 0.83 WIPq = ra2/ [re(re-ra)] = 52 / 6(6-5) = 4.17 orders CTs = 1/(re -ra) = 1/(6-5) = 1 day In front of the 1st stage there will be an average of 4.17 customer orders waiting in the queue to be processed. It will take an order an average of 1 day to make its way through the 1st stage (from receipt of the order until processing is completed at stage 1). The other two stages are identical, so in front of each stage there will be an average of 4.17 orders in queue, and it will take 1 day to get through each stage. So, on average, there will be a total of 12.51 jobs in inventory in front of the three processing stages. The average throughput time is 3 days, even though the time spent processing an order is one-half of a day. 1 re=5/day CT=1 day ra=6/day WIPq=4.17 3 2 CT=1 day ra=6/day WIPq=4.17 WIPq=4.17
Serial Queuing System Demand increases from 5.0 to 5.7 orders per day Example 2 1 3 2 Serial Queuing System Demand increases from 5.0 to 5.7 orders per day u = ra / re = 5.7/6 = 0.95 WIPq = ra2/ [re(re-ra)] = 5.72 / 6(6-5.7) = 18.05 orders CTs = 1/(re -ra) = 1/(6-5.7) = 3.3 days In front of the 1st stage there will be an average of 18.05 customer orders waiting in the queue to be processed. It will take an order an average of 3.33 days to make its way through the 1st stage. On average, there will be a total of 54.15 jobs in inventory in front of the three processing stages. The average throughput time is 10 days, even though the time spent processing an order is one-half of a day. 1 re=5.7/day CT=3.33 d ra=6/day M/M/1 WIPq= 18.05 3 2 ra=6/day CT=3.33 d WIPq= 18.05 M/M/1
Serial Queuing System No randomness in processing times Example 2 1 3 2 Serial Queuing System No randomness in processing times Using the M/D/1 formulas for the first stage WIPq = u2 / [2(1-u)] = 0.952 / 2(1-0.95) = 9.025 orders CTq = WIPq / ra = 9.025 / 5.7 = 1.583 days CT = CTq +1/re = 1.583 + 1/6 = 1.75 days re=5.7/day 1 CT=1.75 d WIPq=9.025 M/D/1 ra=6/day 2 CT=0.167 d D/D/1 ra=6/day 3 CT=0.167 d D/D/1 ra=6/day WIPq=0 WIPq=0 No queues develop in front of stages 2 and 3, and so the average time in the stage is the processing time 0.167 days per job. On average, there will be a total of 9.025 jobs in inventory in the system. The average throughput time is 2.08 days. Inventories are reduced by 83% and throughput time decreases by nearly 80%.
M/D/1 Queue: Relevant Equations Average waiting time CTq Average queue length WIPq Average # of jobs in system WIP Probability for being idle p0
Serial Queuing System Process and Resources Example 3 Serial Queuing System Process and Resources Two single-server work stations Three types of tasks to perform 2 job types (A and B) Inter-arrival times for A and B Uniform[0,40] Type A makes two passes Type B jobs make a single pass through the system Service times Stage 1: Uniform[0,12] Stage 2: Uniform[0,10] Individual service times not known No changeover cost Can change from one task type to another without penalty No preemption Processing of jobs cannot be interrupted A B Stage 1 Stage 2
Serial Queuing System Questions Stage 2 Stage 1 Example 3 Serial Queuing System Questions What is the long run utilization rate for server 1 and for server 2? What are key findings of the following simulation? The length of the simulation is 120,000 hrs. First 20,000 hrs are discarded. Summary statistics of the remaining 100,000 hrs are used. 95% confidence interval for the mean throughput time (MTPT) of each class = MTPT estimate +/- 10% FCFS discipline is applied. Same as b) except type B jobs have non-preemptive priority over type A jobs. Same as b) except two identical servers at each station and an inter-arrival time distribution of each customer type that is uniformly distributed between 0 and 20 hrs. Inter-arrival and service time distributions are exponential.
Serial Queuing System Summary Statistics of a Simulation Stage 2 Stage 1 Example 3 Serial Queuing System Summary Statistics of a Simulation QL=queue length
Serial Queuing System Simulation Results (Questions b, c and d) Stage 2 Stage 1 Example 3 Serial Queuing System Simulation Results (Questions b, c and d)
Serial Queuing System Simulation Results (Question e) Stage 2 Stage 1 Example 3 Serial Queuing System Simulation Results (Question e)
Queuing Network Precedence constraints as illustrated Example 4 Queuing Network Precedence constraints as illustrated n “servers” are identical Service times per stage j UNIFORM[aj,bj] Many statistically independent replications of the project to be completed over time Inter-arrival times uniformly distributed between 0 and 7 days 1 3 2 4 Start End a2= 3 b2= 7 n2= 2 a4= 2 b4= 4 n4= 1 a1= 3 b1= 9 n1= 3 a3= 3 b3= 5 n3= 3 Uniform[0,7]
Queuing Network Simulation Setting and Questions 1 3 2 4 Start End Example 4 Queuing Network Simulation Setting and Questions Simulation for 60,000 days First 5,000 days are discarded Statistics of the remaining 55,000 days are used as the base case This data represents the “steady state” behaviour of the system. Potential improvements One improvement at a time (effect evaluated in isolation) If improvement achieved, the whole task time distribution will be shifted by one day. Which of the four improvements is the best for improving the system performance? Why?
Queuing Network Summary Statistics 1 3 2 4 Start End Example 4 Queuing Network Summary Statistics
Queuing Network Simulation Results 1 3 2 4 Start End Example 4 Queuing Network Simulation Results
Single Channel, Multiple Priority Average waiting time in queue (CTq ) Service Arrival rate (ra Average number of jobs in queue (WIPq ) Service rate (re New orders are assigned a priority upon arrival Decision on the processing order
Performance Measures for Multiple Priority Queuing Model System utilization Average waiting time in line for units in kth priority class Average waiting time in system for units in kth priority class Average number waiting in line for units in kth priority class
Multiple Priorities Model Example 5 Multiple Priorities Model 4 4 3 3 3 2 1 1 1 Arriving jobs are assigned a priority and based on it placed into one of several priority classes. Jobs are then processed by class, highest class first. Within each class, on FCFS basis. Non - preemptive system assumed. A machine shop handles tool repairs in a large company. As each job arrives in the shop, it is assigned a priority based on urgency of the need for that tool. Requests for repair can be described by a Poisson distribution. Arrival rates are: ra1 = 2 per hour, ra2 = 2 per hour , and ra3 = 1 per hour. The service rate is one tool per hour for each server, and there are six servers in the shop. Determine: System utilization The average time a tool in each of the priority classes will wait for service The average time spends in the system for each priority class The average number of tools waiting for repair in each class
Multiple Priorities Model Example 5 1 2 3 Multiple Priorities Model ra = rak = ra1 + ra2 + ra3 = 5 per hr re = 1 job per hr m = 6 servers System utilization u = 5 / 6*1 = 0.833 Average waiting times per each priority class For ra = 5 and m=6, WIPq=2.938 (given) 3 3 3 2 1 1 1 Average time in system = CTq+ 1/re = CTqk+ 1
Multiple Priorities Model Example 5 1 2 3 Multiple Priorities Model Average times in the system per each priority class Average time in system = CTqk+ 1/ re = CTqk+ 1 Average number of units waiting in each priority class WIPqk= rak * CTk
Priority Queuing Network Process and Resources Example 6 Priority Queuing Network Process and Resources Two processing resources Six kinds of tasks each with own processing time distribution All distributions exponential Deterministic arrival of type A jobs: one every 4.5 hrs Station 1 Deterministic arrival of type B jobs: one every 5.0 hrs MPT 2.0 MPT 1.9 MPT 0.1 Station 2 MPT 2.0 MPT 1.9 MPT 0.1
Priority Queuing Network Simulation and Questions Example 6 Priority Queuing Network Simulation and Questions MPT 2.0 MPT 1.9 MPT 0.1 Simulation for 120,000 hrs First 20,000 hours discarded The statistics of the remaining 100,000 hours = Base case The data represents the “steady state” behavior of the system Disciplines tested 1: FCFS 2: Type B jobs are given priority at station 1, and type A jobs are prioritized at station 2, otherwise FCFS applied 3: Type B jobs are given priority at station 1, and type A jobs are prioritized at station 2, otherwise second priority at each station given to jobs which are waiting for their final operation (otherwise processed on FCFS basis) Questions What is the long run utilization rate? Can any principles of network scheduling be deduced from the summary statistics?
Priority Queuing Network Simulation Results Example 6 Priority Queuing Network Simulation Results MPT 2.0 MPT 1.9 MPT 0.1
Priority Queuing Network Simulation Results MPT 2.0 MPT 1.9 MPT 0.1 Example 6 Priority Queuing Network Simulation Results
Key Points Cost trade-offs include the cost of waiting, lost sales, and cost of capacity. The VUT equation considers the impact of variability and utilization on system performance. High variability lead to long queues and long waits. Reduction in throughput reduces waiting. Reducing variability improves performance. Pooling servers improves performance. Different types of systems exists A variety of models is needed in practice. Simple ones easy to solve; simulation can be used to gain insights in more complex ones.
Queuing Notation and Measures ra = arrival rate ta = mean inter-arrival time (=1/ ra) re = mean service rate for a single server (=m/ te) u = system utilization (=ra / mre) te = mean process time (1/re) m = the number of parallel machines in the system WIP = average number of jobs in the system (incl. those being served; steady state) WIPq = average number of jobs in the queue (steady state) CT = average time spent in the system (including service; steady state) CTq = average time spent in the queue (steady state) p0 = the probability that there are no jobs in the system pn = the probability that there are n jobs in the system b = buffer size e.g. between machines ca2 = SCV of the inter-arrival time ce2 = SCV of the effective process time SCV = squared coefficient of variation MPT = mean processing time MTPT = mean throughput time Hopp and Spearman 2000, 265