Waiting Line or Queue Template

Embed Size (px)

DESCRIPTION

Template for waiting line and queues. It facilitates ease in the calculation of waiting time

Citation preview

InstructionsSteady State Queuing Models 26 Oct 2007John O. McClain [email protected] Graduate School of ManagementSage Hall, Cornell UniversityIthaca NY 14853This spreadsheet is intended for teaching purposes. You are welcome to use it in anymanner and change it as you see fit. This model comes without any guarantee, and isdistributed free of charge.Note: If the worksheets don't seem to work properly,Click HereContents:DescriptionsModelsModels included in this workbookDefinition of Steady StateUsing the ModelsExponential Service and Interarrival TimesModels with limited waiting capacity (balking)Finite Queue worksheetModels with infinite waiting capacity (no balking)Infinite Queue worksheetGeneral Service and Interarrival Times, ApproximationInfinite waiting capacity, ApproximationInfinite Queue Approx. worksheetLimited waiting capacity, SimulationQueue Simulation worksheetThe ModelsThe Finite Queue model assumes that there is a limit to the waiting line, and thatcustomers will not join the queue when that limit is reached. Those customers arepermanently lost, but the arrival rate of future customers is not affected.Assumptions: Identical Servers, Poisson arrivals, Exponential service times.(More)The Infinite Queue model assumes that there is no limit to the waiting line. That is,customers are extremely patient and will wait indefinitely.Assumptions: Identical Servers, Poisson arrivals, Exponential service times,and Arrival Rate < (Number of Servers)(Service Rate capacity per server)This model also allows up to 4 priority classes (non-preemptive).(More)The Infinite Queue Approximation gives a fairly simple formula that allows you toadjust the CV (coefficient of variation) for arrival and service times. Output includesaverages but not probabilities.Assumptions: Identical Servers, Arrival Rate < (# Servers)(Service Rate)(More)The Finite Queue Simulation begins with no customers, and simulates using theGamma distribution for time between arrivals and for service times. If CV (coefficient of variation) = 1.0, the Gamma is the same as the Exponential,in which case the simulation results should converge to the Finite Queue Model. For CV 1, the average queue should converge to a value similar to theInfinite Queue Approximation, if the service capacity exceeds the arrival rate,and if the simulation's queue capacity large enough.Assumptions: Identical Servers, Gamma inter-arrival times, Gamma service times.(More)Each of these models is described in more detail below, and examples are worked out.Steady State, Defined.These models give "Steady State" results. This has two important implications:The probability distributions of arrivals and service times do not change with time.For example, you cannot model variations in the arrivals at different times of day.The outputs are long run averages.For example, if the model gives 9% probability that the queue is empty, it means that9% of the time there will be no one waiting. But the 9% does not apply, for example, ifyou start with no one waiting and watch the system for 15 minutes.Using the ModelsYour inputs always go in the yellow cells, like this:Please be careful with your time units. Two of the inputs are rates, and they must have thesame time units. For example, suppose the arrival rate is 4 customers per hour, and theaverage service time is 10 minutes. To be consistent, the service rate must also be givenin customers per hour, which would be 60/10 or 6.For the first 3 models, the results are available immediately, as soon as you enter an input.However for the simulation, once you change the inputs, you must click a button and waitfor the simulation to finish. The program then writes new output on the spreadsheet.Finite Queues (limited waiting line capacity)Assumptions: Identical Servers, Poisson arrivals, Exponential service times.The model also assumes that arrivals cease when the queue is full. This is "balking".Your Inputs: The 4 basic inputs for the finite queuing model are S, M, l and m.There are S identical servers, and the queue can hold M customers.Therefore the system can hold up to M+S customers (M in queue and S in service).The arrival rate of customers is l, and the service rate is m for each server.Another input looks like this:Use it to find the probability of a queue exceeding a given length, Q. For example, to find theprobability of 11 or more customers waiting for service, type 10 in the yellow box.Example:City Clinic serves a population that requires an average of 45 visits per 8-hour day.There are two nurse-practitioners, each capable of serving 25 patients per day.Customers go to another clinic if the waiting room is full when they arrive.a.If there is no waiting area at all, what fraction of the patients will leave without service?b.How large should the waiting area be so that at least 95% of patients will be served?c.If the waiting area holds 20 patients, how often will more than 10 be waiting?Solution:a.On the Finite Queue worksheet, put in S = 2, M = 0, l = 45 and m = 25.Answer: Customers who Balk = 36.65%, so this is how many leave without service.b.Choose larger values for M until Customers who Balk is below 5%. Answer: M=9.Go to the Finite Queue Graph sheet to see the entire probability distribution displayed.c.Put in M=20 and Q=10. Answer: 19.22%Experiments:d.Using M=20 as the capacity of the waiting area, change the number of servers to 3and watch what happens to the Finite Queue Graph.e.Change the number of servers to 1 and watch what happens to the Finite Queue Graph.Note that the queue is never empty when there is only one server to handle the load.Infinite Queues (unlimited waiting line capacity)Assumptions: Identical Servers, Poisson arrivals, Exponential service times.Your Inputs: The 3 basic inputs for the infinite queuing model are S, l and m.There are S identical servers, and the queue can hold an unlimited number of customers.The arrival rate of customers is l, and the service rate is m for each server.Another input looks like this:Use it to find the probability of a queue exceeding a given length, Q. For example, to find theprobability of 11 or more customers waiting for service, type 10 in the yellow box.Similarly, this input,gives the probability that a customer will have to wait 0.5 time units* or longer before service,*The time units are the same as the ones you use for the arrival and service rates.You may (optionally) specify up to 4 customer categories, each with different priorities.When there is a waiting line, the highest priority customers get the next available server.Example:City Clinic serves a population that requires an average of 45 visits per 8-hour day.There are two nurse-practitioners, each capable of serving 25 patients per day.a.What is the average size of the waiting line, and how long is the average wait?b.What percent of the time are more than 10 patients are waiting?c.What is the probability that a patient will have to wait more than one-half of a day?d.20% of the patients have severe injuries that require immediate attention. How long dothese "high-priority" patients have to wait, on average?e.Does the use of a priority system change the total size of the waiting line?Solution:a.On the Infinite Queue worksheet, put in S = 2, l = 45 and m = 25.This will cause Nq = 7.674 patients waiting, on average, and Tq = 0.1705 days waiting,on average. (Tq is in days because the arrival rate is in customers per day.)b.Put in Q = 10. Answer: 26.76%c.Put in T = 0.5. Answer: 7%d.Put in 0.8 as the fraction of priority 2 customers, and put 0 for priorities 3 and 4.The result is Tq (1) = 0.0208 days for priority 1 customers.e.No. Adding the waiting lines gives a total of 7.674, the same as part (a).Approximation: Infinite Queues (unlimited waiting line capacity)Assumptions: Identical Servers.Your Inputs:There are S identical servers, and the queue can hold an unlimited number of customers.The arrival rate of customers is l, and the service rate is m for each server.CV(s) = Coefficient of Variation of Service Times:CV(a) = Coefficient of Variation of Inter-arrival Times (i.e. times between arrivals):Definition: CV = standard deviation divided by the mean.The advantage of this formula is that it makes no assumptions about the distributionsof arrivals and service times. Therefore it is more general than the "Infinite Queue Model".Example:Computer Clinic serves a population that generates an average of 45 requests per 8-hour day.There are two technicians, each capable of serving 25 customers per 8-hour day.a.What is the average service time?b.The standard deviation of service time is 0.16 hours. What is its CV?c.What is the average inter-arrival time?d.The standard deviation of inter-arrival time is 0.1 hours. What is its CV?e.What is the average size of the waiting line, and how long is the average wait?Solution:a.To serve 25 customers in 8 hours, service time must be 8/25 = 0.32 hours.b.CV(s) = Standard Deviation divided by Average = 0.16/0.32 = 0.5c.If 45 customers arrive in 8 hours, one arrives every 8/45 = 0.178 hours.d.CV(a) = Standard Deviation divided by Average = 0.1/0.178 = 0.562e.On the Infinite Queue Approx. worksheet, put in S = 2, l = 45, m = 25, CV(a) = 0.562and CV(s) = 0.5. Result: Nq = 2.186 patients waiting, on average, and Tq = 0.0486 dayswaiting, on average. (Tq is in days because the arrival rate is in customers per day.)Simulation: Finite Queue CapacityAssumptions: Identical Servers, Gamma Distributions for inter-arrival and service times.Your Inputs:There are S identical servers, and the queue can hold unlimited customers.The arrival rate of customers is l, and the service rate is m for each server.CV(s) = Coefficient of Variation of Service Times:CV(a) = Coefficient of Variation of Inter-arrival Times (i.e. times between arrivals):Definition: CV = standard deviation divided by the mean.Simulated time per repetition, RunLength: Time units per repetition of the simulation.Time Units are defined by Arrival and Service Rates.If you use customers per hour for the arrival rate, You MUST use the SAME UNITS for the service rate, and The time units for the simulation will be "hours".Repetitions (200), nReps = the number of times the simulation is repeated.Data collection occurs after each repetition.Number of Repetitions to Ignore, WarmUp = number of repetitions NOT included inthe summary statistics. If "Repetitions" = 12 and WarmUp = 3, then the summarystatistics will cover runs 4 to 12.Example:FarAway Call Center provides over-the-phone help for computer owners. They currentlyreceive an average of 45 calls per hour. Their service area is world-wide, so the callsarrive at a steady rate, 24 hours a day. Arrivals are quite random. The CV of inter-arrivaltimes is 1.0. Service times also have CV of 1.0, but management hopes to reduce thatvariation by a combination of training and other tools for the servers.The phones are answered by an automatic system, which informs the caller of thenumber of customers that are waiting and gives an estimate of the waiting time. Experiencehas shown that people hang up when they hear that the waiting line is 10 customers.a.Find the average number waiting and the probability that more than 5 are waiting.What is the average waiting time for a customer?What fraction of customers hang up without receiving service?b.How do your answers compare to the theoretical values using the Finite Queue model?c.If the CV of service time is reduced to 0.3, what is the effect on the answers to part (a)?d.Comment on the changes that you see between the two results.Solution:a.On the Queue Simulation worksheet, put in S = 5, M = 10, l = 45 and m = 10.Enter 1.0 for CV(a) and CV(s), and set RunLength = 100, nReps = 12, WarmUp = 2.Then click the "Simulate" Button.Answers: Your answers will differ because each simulation has different customers.Average number waiting, Nq = 2.8 P(>5) in queue = 23%Average Waiting Time (Tq) = 0.065 days Fraction who balk = 3.7%b.Virtually the same: 2.73, 21.8%, 0.063 days, and 3.49%, respectively.c.Same method except CV(s) = 0.3Answers: Your answers will differ because each simulation has different customers.Average number waiting = 2.4 P(>5) in queue = 16%Average Waiting Time (Tq) = 0.054 days Fraction who balk = 1.4%d.Less variablity of service means that the number of customers in the system remainscloser to the average. That lowers the probability of the system being full, which meansless balking. It also lowers the probability of a long queue.Experiments:e.Change the RunLength to 10 and see what happens.Note that the "Results" become much more variable. The simulation's accuracy dependson a lot of observations.

&C&F, &A, page &PClick Here(More)(More)(More)(More)Models included in this workbookDefinition of Steady StateUsing the ModelsModels with limited waiting capacity (balking)Models with infinite waiting capacity (no balking)Infinite waiting capacity, ApproximationLimited waiting capacity, SimulationFinite Queue worksheetInfinite Queue worksheetInfinite Queue Approx. worksheetQueue Simulation worksheet

Module1Steady-State, Finite Capacity Queues1 Servers, Queue Capacity = 10, Arrival Rate = 10, Service Rate = 5Basic Inputs:Number of Servers, S =1Queue Capacity, M =10Arrival Rate, l =10Service Rate Capacity of each server, m =5Arrivals:Average Rate Joining System (Lambda-Bar) =4.9987789988Average Rate Leaving Without Service (balking) =5.0012210012Customers who Balk: Probability that System is Full (Pfull) =50.01%The Waiting Line:Average Number Waiting in Queue (Nq) =9.003Average Waiting Time (Tq) =1.8010747435Q: Probability of more than0customers waiting= 99.93%Service:Average Utilization of Servers =99.98%Average Number of Customers Being Served (Ns) =0.9997557998The Total System (waiting line plus customers being served):Average Number in the System (N) =10.003Average Time in System (Tq + Ts) =2.0010747435Probability Distribution:n = total number of customers in the systemq = number of customers in the waiting linenP(n)CumulativeqP(q)Cumulative00.00020.000210.00050.000700.00070.000720.00100.001710.00100.001730.00200.003720.00200.003640.00390.007630.00390.007550.00780.015440.00780.015460.01560.031050.01560.031070.03130.062360.03130.062280.06250.124870.06250.124890.12500.249880.12500.2498100.25010.499990.25010.4998110.50011.0000100.50011.0000

&APage &P&C&F, &A, page &P

Module1

&C&F, &F, page &P1 Servers, Queue Capacity = 10, Arrival Rate = 10, Service Rate = 5Total Number of Customers in the System (waiting or being served)Steady-State Probabilities for Finite Capacity Queue

Finite QueueSteady-State, Infinite Capacity QueuesModel is OKBasic Inputs:Number of Servers, S =2Arrival Rate, l =45Service Rate Capacity of each server, m =25The Waiting Line:Average Number Waiting in Queue (Nq) =7.674Average Waiting Time (Tq) =0.1705263158Q: Probability of more than20customers waiting= 9.33%T: Probability of more than0.5time-units waiting= 7%Service:Average Utilization of Servers =90.00%Average Number of Customers Receiving Service (Ns) =1.8The Total System (waiting line plus customers being served):Average Number in the System (N) =9.474Average Time in System (Tq + Ts) =0.2105263158An Option: Multiple Classes of CustomersClassfraction(Ignore)Nq (k)Tq (k)highest priority = 10.20.820.1870.020820.80.17.4870.2080300.10.0000.0000400.10.0000.0000

&C&F, &A, page &PIgnore this column. It contains an intermediate calculation that has no physical interpretation.

Infinite QueueApproximate Formula for Steady-State, Infinite Capacity QueuesModel is OKBasic Inputs:Number of Servers, S =2Arrival Rate, l =45Coefficient of Variation of Inter-arrival time, CV(a) =0.562Service Rate Capacity of each server, m =25Coefficient of Variation of Service time, CV(s) =0.5The Waiting Line:Average Number Waiting in Queue (Nq) =2.186