You are on page 1of 26

162049979.xls, Infinite Queue Approx.

(2), page 1

Approximate Formula for Steady-State, Infinite Capacity Queues


Model is OK Basic Inputs: Number of Servers, S =

5 12 1 3 0.667

Arrival Rate, l =

c r W
0.0333333

Total service capacity Avg. processing time

Rp = c x r 1/r

15 0.3333333

Coefficient of Variation of Inter-arrival time, CV(a) = Service Rate Capacity of each server, m = Coefficient of Variation of Service time, CV(s) = The Waiting Line:

Average Number Waiting in Queue (Nq) = 1.668 <== The Approximation Average Waiting Time (Tq) = 0.139

Ii
8.3 mins

Service:

Average Utilization of Servers = 80.00% 4 Average Number of Customers Receiving Service (Ns) =

p = R/Rp utlization

The Total System (waiting line plus customers being served): Average Number in the System (N) = 5.668 Average Time in System (Tq + Ts) = 0.4723

162049979.xls, Instructions, page 2

Steady State Queuing Models


John O. McClain

26 Oct 2007 jom1@cornell.edu

Johnson Graduate School of Management


Sage Hall, Cornell University Ithaca NY 14853 This spreadsheet is intended for teaching purposes. You are welcome to use it in any manner and change it as you see fit. This model comes without any guarantee, and is distributed free of charge. Note: If the worksheets don't seem to work properly, Click Here

Contents:
Models included in this workbook Definition of Steady State Using the Models

Descriptions

Exponential Service and Interarrival Times


Models with limited waiting capacity (balking) Models with infinite waiting capacity (no balking)

General Service and Interarrival Times, Approximation


Infinite waiting capacity, Approximation Limited waiting capacity, Simulation

The Models The Finite Queue model assumes that there is a limit to the waiting line, and that customers will not join the queue when that limit is reached. Those customers are permanently 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 to adjust the CV (coefficient of variation) for arrival and service times. Output includes averages but not probabilities. Assumptions: Identical Servers, Arrival Rate < (# Servers)(Service Rate) (More) The Finite Queue Simulation begins with no customers, and simulates using the Gamma 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.

162049979.xls, Instructions, page 3

For CV 1, the average queue should converge to a value similar to the Infinite 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 that 9% of the time there will be no one waiting. But the 9% does not apply, for example, if you start with no one waiting and watch the system for 15 minutes. Using the Models Your 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 the same time units. For example, suppose the arrival rate is 4 customers per hour, and the average service time is 10 minutes. To be consistent, the service rate must also be given in 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 wait for 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, and . 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 , and the service rate is for each server. Another input looks like this:
Q : Probability of more than 10

customers waiting

Use it to find the probability of a queue exceeding a given length, Q. For example, to find the probability 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:

162049979.xls, Instructions, page 4

a. On the Finite Queue worksheet, put in S = 2, M = 0, = 45 and = 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 3 and 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.

162049979.xls, Instructions, page 5

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, and . There are S identical servers, and the queue can hold an unlimited number of customers. The arrival rate of customers is , and the service rate is for each server. Another input looks like this: Q: Probability of more than 10 customers waiting Use it to find the probability of a queue exceeding a given length, Q. For example, to find the probability of 11 or more customers waiting for service, type 10 in the yellow box. Similarly, this input, T : Probability of more than 0.5 tim e-units waiting 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 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 do these "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, = 45 and = 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).

162049979.xls, Instructions, page 6

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 , and the service rate is 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 distributions of 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.5 c. 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.562 e. On the Infinite Queue Approx. worksheet, put in S = 2, = 45, = 25, CV(a) = 0.562 and CV(s) = 0.5. Result: Nq = 2.186 patients waiting, on average, and Tq = 0.0486 days waiting, on average. (Tq is in days because the arrival rate is in customers per day.)

162049979.xls, Instructions, page 7

Simulation: Finite Queue Capacity Assumptions: 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 , and the service rate is 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 in the summary statistics. If "Repetitions" = 12 and WarmUp = 3, then the summary statistics will cover runs 4 to 12. Example: FarAway Call Center provides over-the-phone help for computer owners. They currently receive an average of 45 calls per hour. Their service area is world-wide, so the calls arrive at a steady rate, 24 hours a day. Arrivals are quite random. The CV of inter-arrival times is 1.0. Service times also have CV of 1.0, but management hopes to reduce that variation by a combination of training and other tools for the servers. The phones are answered by an automatic system, which informs the caller of the number of customers that are waiting and gives an estimate of the waiting time. Experience has 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, = 45 and 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.3 Answers: Your answers will differ because each simulation has different customers.

162049979.xls, Instructions, page 8

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 remains closer to the average. That lowers the probability of the system being full, which means less 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 depends on a lot of observations.

162049979.xls, Instructions, page 9

ome to use it in any ny guarantee, and is

Models

Finite Queue worksheet Infinite Queue worksheet Infinite Queue Approx. worksheet Queue Simulation worksheet

aiting line, and that ose customers are affected. service times. waiting line. That is,

service times, y per server)

la that allows you to mes. Output includes

rvice Rate)

simulates using the

as the Exponential, Finite Queue Model.

162049979.xls, Instructions, page 10

similar to the s the arrival rate,

amma service times.

mples are worked out.

nt implications: ot change with time. erent times of day.

s empty, it means that ot apply, for example, if

s, and they must have the mers per hour, and the e rate must also be given

on as you enter an input. st click a button and wait n the spreadsheet.

ne capacity) rvice times. is full. This is "balking". , M, and .

ue and S in service).

h server.
customers waiting

10

Q. For example, to find the the yellow box.

s per 8-hour day. ents per day.

l leave without service? atients will be served? 10 be waiting?

162049979.xls, Instructions, page 11

d = 25. eave without service. 5%. Answer: M=9. ity distribution displayed.

mber of servers to 3

o the Finite Queue Graph. ver to handle the load.

162049979.xls, Instructions, page 12

line capacity)

rvice times. S, and . mited number of customers. each server.


customers waiting

10

Q. For example, to find the the yellow box.

tim e-units waiting s* or longer before service, al and service rates. with different priorities. next available server.

0.5

s per 8-hour day. ents per day. e average wait?

n one-half of a day? e attention. How long do

aiting line?

q = 0.1705 days waiting, ers per day.)

priorities 3 and 4.

s part (a).

162049979.xls, Instructions, page 13

waiting line capacity)

mited number of customers. each server.

s between arrivals):

out the distributions "Infinite Queue Model".

45 requests per 8-hour day. per 8-hour day.

s its CV? e average wait? 0.32 hours.

8 hours.

, = 25, CV(a) = 0.562 age, and Tq = 0.0486 days n customers per day.)

162049979.xls, Instructions, page 14

apacity rival and service times.

ed customers. each server.

s between arrivals):

petition of the simulation.

on is repeated.

etitions NOT included in 3, then the summary

wners. They currently d-wide, so the calls m. The CV of inter-arrival hopes to reduce that

ms the caller of the waiting time. Experience e is 10 customers. than 5 are waiting.

the Finite Queue model? the answers to part (a)?

45 and = 10. ps = 12, WarmUp = 2.

s different customers.

k = 3.7%

s different customers.

162049979.xls, Instructions, page 15

k = 1.4% in the system remains being full, which means

ation's accuracy depends

162049979.xls, Finite Queue, page 16

Steady-State, Finite Capacity Queues


Basic Inputs:
Number of Servers, S = Queue Capacity, M = Arrival Rate, = Service Rate Capacity of each server, = 2 3 8 5

Probabilities for = Finite Capacity Que 2 Servers, Steady-State Queue Capacity = 3, Arrival Rate 8, Service Rate = 5 12 10 8 6 4 2 0
0 1 2 3 4

Arrivals:

Average Rate Joining System (Lambda-Bar) = #VALUE! Average Rate Leaving Without Service (balking) = #VALUE! Customers who Balk: Probability that System is Full (Pfull) = #VALUE! Average Number Waiting in Queue (Nq) = #VALUE! Average Waiting Time (Tq) = #VALUE! customers waiting Q: Probability of more than 0 #VALUE! Average Utilization of Servers = #VALUE! Average Number of Customers Being Served (Ns) = #VALUE! Average Number in the System (N) = #VALUE! Average Time in System (Tq + Ts) = #VALUE!

The Waiting Line:

Service:

The Total System (waiting line plus customers being served):

Total Number of Customers in the System (waiting or being ser

Probability Distribution:

n = total number of customers in the system q = number of customers in the waiting line
n 0 1 2 3 4 5

Cumulative P(n) #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE!

P(q)

Cumulative

0 1 2 3

#VALUE! #VALUE! #VALUE! #VALUE!

#VALUE! #VALUE! #VALUE! #VALUE!

162049979.xls, Infinite Queue, page 17

Steady-State, Infinite Capacity Queues


Model is OK Basic Inputs:
Number of Servers, S = Arrival Rate, = Service Rate Capacity of each server, = 3 3.5 30 #VALUE! #VALUE! #VALUE! #VALUE!

The Waiting Line:

Average Number Waiting in Queue (Nq) = Average Waiting Time (Tq) = customers waiting Q: Probability of more than 0 time-units waiting T: Probability of more than 0

Service:

Average Utilization of Servers = 3.89% Average Number of Customers Receiving Service (Ns) = 0.116667

The Total System (waiting line plus customers being served):


Average Number in the System (N) = #VALUE! Average Time in System (Tq + Ts) = #VALUE!

An Option: Multiple Classes of Customers


Class highest priority = 1 2 3 4 fraction 0.6 0.4 0 0 (Ignore) 0.97666667 0.96111111 0.96111111 0.96111111 Nq (k) #VALUE! #VALUE! #VALUE! #VALUE! Tq (k) #VALUE! #VALUE! #VALUE! #VALUE!

162049979.xls, Infinite Queue Approx., page 18

Approximate Formula for Steady-State, Infinite Capacity Queues


Model is OK Basic Inputs:
Number of Servers, S =

3 3.5 1 2 0.667 0.378 0.1079 58.33% 1.75 2.128 0.6079

Arrival Rate, =

c r
<== The Approximation 0.0333333

Total service capacity Avg. processing time

Rp = c x r 1/r

6 0.5

Coefficient of Variation of Inter-arrival time, CV(a) = Service Rate Capacity of each server, = Coefficient of Variation of Service time, CV(s) =

The Waiting Line:

Average Number Waiting in Queue (Nq) = Average Waiting Time (Tq) =

Ii
6.5 mins

Service:

Average Utilization of Servers = Average Number of Customers Receiving Service (Ns) =

p = R/Rp utlization

The Total System (waiting line plus customers being served):


Average Number in the System (N) = Average Time in System (Tq + Ts) =

162049979.xls, Queue Simulation, page 19

Finite Capacity Queue Simulation (initially empty)


Number of Servers, S = Run with Queue Capacity, M = TRUE Arrival Rate, = Animation Animation is ONCoefficient of Variation of Inter-arrival time, CV(a) = Service Rate Capacity of each server, = Coefficient of Variation of Service time, CV(s) = Simulate
2 4 5 1 3 0.3 100 12 1 Simulated 4.944 0.996 3.025 0.300 n 5,444 3,318
Service Times: CV=0.3 Inter-Arrivals: CV=1

Show Results

Simulated time per repetition, RunLength = Repetitions (200), nReps = Number of repetitions to ignore, WarmUp =

Theoretical if CV=1 Arrivals: Average Rate Joining System without Balking = #VALUE! Average Rate Leaving Without Service (balking) = #VALUE! Customers who Balk: Probability that System is Full (Pfull) = #VALUE! Fraction who balk = #VALUE! The Waiting Line: Average Number Waiting in Queue (Nq) = #VALUE! Average Waiting Time (Tq) = #VALUE! Probability of Queue more than 4 customers waiting = #VALUE! Service: Average Utilization of Servers = Average Number of Customers Being Served (Ns) = Customers in the System (Number waiting + Average Number in the System (N) = Average Time in System (Tq + Ts) = Distributions:

Simulated 3.013 1.931 39.07% 38.93% #DIV/0! #DIV/0! #DIV/0!

#VALUE! #DIV/0! #VALUE! #DIV/0! Number being served): #VALUE! #DIV/0! #VALUE! #DIV/0!

0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 Total Number of Customers in the System (waiting or being served)
0 1 2 3 4 5 6

Theoretical for CV=1 Simulation

Theoretical Results for CV = 1 Total number in the system Number in the waiting line n 0 1 2 3 4 5 6 P(n) Cumulative #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! #VALUE! q P(q) Cumulative n 0 1 2 3 4 5 6

0 1 2 3 4

#VALUE! #VALUE! #VALUE! #VALUE! #VALUE!

#VALUE! #VALUE! #VALUE! #VALUE! #VALUE!

Simulation results for last 1100 timeunits, Runs 2 to 12 Total number in the system Number in the waiting line Approx 95% P(n) Conf Interval Cumulative q P(q) Cumulative 0.0031 0.0020 0.0031 0.0165 0.0071 0.0197 0.0508 0.0146 0.0705 0 0.0705 0.0705 0.1472 0.0160 0.2177 1 0.1472 0.2177 #DIV/0! #DIV/0! #DIV/0! 2 #DIV/0! #DIV/0! 0.3917 0.0098 #DIV/0! 3 0.3917 #DIV/0! 0.3907 0.0280 #DIV/0! 4 0.3907 #DIV/0!

162049979.xls, Warning, p. 20 of 26

WARNING: YOU NEED TO ENABLE THE MACROS IN THIS FILE


Try these steps. If step 1 does not work, then go to step 2. STEP 1: Try to enable the macros
For Excel 2007, A. If you see the Security Warning in your menu bar, proceed with step B. If the Security Warning is not there, go to STEP 2. B. In the Security Warning, Click Options. C. In the Alert Window that appears, click Enable This Content and click OK.

For Excel 2003, A. Close this file. Then open it again. B. In the window that appears, click Enable Macros. If a window like this one does NOT appear, then go to STEP 2.

STEP 2: If Step 1 does not work


If you DID NOT get a Security Message, then your security setting is too high. Here is what you should do: For Excel 2007, A. Click the Microsoft Office Button at the top-left of the screen: B. Click Excel Options. C. Click Trust Center, then Trust Center Settings, and then Macro Settings. D. Click Disable all macros with notification E. Exit from Excel. Closing the file is not enough. On the menu bar, select File, and then

162049979.xls, Warning, p. 21 of 26 F. Open this file again and follow the instructions in STEP 1 to enable the macros. For Excel 2003, A. B. C. D. On the menu bar at the top of this page, select Tools, then Macro, then Security. On the Security Level tab, select Medium and click OK. Then exit from Excel. Closing the file is not enough. On the menu bar, select File Open this file again and follow the instructions in STEP 1 to enable the macros.

162049979.xls, Warning, p. 22 of 26

NABLE THE MACROS IN THIS FILE

elect File, and then Exit.

162049979.xls, Warning, p. 23 of 26

hen Security.

bar, select File, and then Exit.

Basic Inputs:

c R r

Number of Servers, S = Arrival Rate, l = Coefficient of Variation of Inter-arrival time, CV(a) = Service Rate Capacity of each server, m= units/hr Coefficient of Variation of Service time, CV(s) = Number Waiting in Queue (Nq) = Waiting Time (Tq) = hrs Utilization of Servers = Number of Customers Receiving Service (Ns) = customers being served): Number in the System (N) = Time in System (Tq + Ts) = units/hr hr

Agent Service 5 12 1 3 0.667 1.67 0.14 80% 4 5.67 0.47 15.0 0.3

The Waiting Line:

Average Average Service: Average Average The Total System (waiting line plus Average Average

I W

Total service capacity Avg. processing time

Specialist Service 4 12 0.5 2 0.667 -2.50 -0.21 150% 6 3.50 0.29 8.0 0.5

Combined Systems

1.5 5 1.334 0 -0.8372432509 -0.0697702709 230.00% 10 0 9.1627567491 0.7635630624 0 23 0.8333333333

units/hr

<== The Approximation hrs -4.2 mins p = R/Rp

units/hr hr

Rp = c x r 1/r

You might also like