Você está na página 1de 14

239531713.xls.

ms_office, Instructions, page 1


Steady State Queuing Models 26 Oct 2007
John O. McClain 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: Descriptions Models
Finite Queue worksheet
Infinite Queue worksheet
Infinite Queue Approx. worksheet
Queue Simulation worksheet
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.
For CV 1, the average queue should converge to a value similar to the
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
Models included in this workbook
Definition of Steady State
Using the Models
Exponential Service and Interarrival Times
239531713.xls.ms_office, Instructions, page 2
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, 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 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:
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.
Q: Probability of more than 10 customers waiting
239531713.xls.ms_office, Instructions, page 3
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.
239531713.xls.ms_office, Instructions, page 4
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 the
probability 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 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, 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).
Q: Probability of more than 10 customers waiting
T: Probability of more than 0.5 time-units waiting
239531713.xls.ms_office, Instructions, page 5
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 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, l = 45, m = 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.)
239531713.xls.ms_office, Instructions, page 6
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 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 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, 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.3
Answers: 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%
239531713.xls.ms_office, Instructions, page 7
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.
239531713.xls.ms_office, Finite Queue, page 8
Steady-State, Finite Capacity Queues
Basic Inputs: Number of Servers, S = 1
Queue Capacity, M = 10
Arrival Rate, l = 10
Service Rate Capacity of each server, m = 5
Arrivals: Average Rate Joining System (Lambda-Bar) = 4.99878
Average Rate Leaving Without Service (balking) = 5.00122
Customers who Balk: Probability that System is Full (Pfull) = 50.01%
The Waiting Line: Average Number Waiting in Queue (Nq) = 9.003
Average Waiting Time (Tq) = 1.80107
Q: Probability of more than 0 customers waiting = 99.93%
Service: Average Utilization of Servers = 99.98%
Average Number of Customers Being Served (Ns) = 0.99976
The Total System (waiting line plus customers being served):
Average Number in the System (N) = 10.003
Average Time in System (Tq + Ts) = 2.00107
Probability Distribution: n = total number of customers in the system
q = number of customers in the waiting line
n P(n) Cumulative q P(q) Cumulative
0 0.0002 0.0002
1 0.0005 0.0007 0 0.0007 0.0007
2 0.0010 0.0017 1 0.0010 0.0017
3 0.0020 0.0037 2 0.0020 0.0036
4 0.0039 0.0076 3 0.0039 0.0075
5 0.0078 0.0154 4 0.0078 0.0154
6 0.0156 0.0310 5 0.0156 0.0310
7 0.0313 0.0623 6 0.0313 0.0622
8 0.0625 0.1248 7 0.0625 0.1248
9 0.1250 0.2498 8 0.1250 0.2498
10 0.2501 0.4999 9 0.2501 0.4998
11 0.5001 1.0000 10 0.5001 1.0000
0
0.1
0.2
0.3
0.4
0.5
0.6
0 1
Total Number of Customers in the System (waiting or being
Steady-
1 Servers, Queue Capacity = 10, Arrival Rate = 10, Service Rate = 5
239531713.xls.ms_office, Infinite Queue, page 9
Steady-State, Infinite Capacity Queues
Basic Inputs: Number of Servers, S = 2
Arrival Rate, l = 45
Service Rate Capacity of each server, m = 25
The Waiting Line: Average Number Waiting in Queue (Nq) = 7.674
Average Waiting Time (Tq) = 0.17053
Q: Probability of more than 20 customers waiting = 9.33%
T: Probability of more than 0.5 time-units waiting = 7%
Service: Average Utilization of Servers = 90.00%
Average Number of Customers Receiving Service (Ns) = 1.8
The Total System (waiting line plus customers being served):
Average Number in the System (N) = 9.474
Average Time in System (Tq + Ts) = 0.21053
An Option: Multiple Classes of Customers
Class fraction (Ignore) Nq (k) Tq (k)
highest priority = 1 0.2 0.82 0.187 0.0208
2 0.8 0.1 7.487 0.2080
3 0 0.1 0.000 0.0000
4 0 0.1 0.000 0.0000
Model is OK
239531713.xls.ms_office, Infinite Queue Approx., page 10
Approximate Formula for Steady-State, Infinite Capacity Queues
Basic Inputs: Number of Servers, S = 2
Arrival Rate, l = 45
Coefficient of Variation of Inter-arrival time, CV(a) = 0.562
Service Rate Capacity of each server, m = 25
Coefficient of Variation of Service time, CV(s) = 0.5
The Waiting Line: Average Number Waiting in Queue (Nq) = 2.186 <== The Approximation
Average Waiting Time (Tq) = 0.04857
Service: Average Utilization of Servers = 90.00%
Average Number of Customers Receiving Service (Ns) = 1.8
The Total System (waiting line plus customers being served):
Average Number in the System (N) = 3.986
Average Time in System (Tq + Ts) = 0.08857
Model is OK
239531713.xls.ms_office, Queue Simulation, page 11
Finite Capacity Queue Simulation (initially empty)
Number of Servers, S = 1
TRUE Queue Capacity, M = 4 Simulated n
Arrival Rate, l = 5 4.944 5,444
Animation is ON Coefficient of Variation of Inter-arrival time, CV(a) = 1 0.996
Service Rate Capacity of each server, m = 3 3.025 3,318
Coefficient of Variation of Service time, CV(s) = 0.3 0.300
Simulated time per repetition, RunLength = 100
Repetitions (200), nReps = 12
Number of repetitions to ignore, WarmUp = 1
Theoretical if CV=1 Simulated
Arrivals: Average Rate Joining System without Balking = 2.902 3.013
Average Rate Leaving Without Service (balking) = 2.098 1.931
Customers who Balk: Probability that System is Full (Pfull) = 41.96% 39.07%
Fraction who balk = 41.96% 38.93%
The Waiting Line: Average Number Waiting in Queue (Nq) = 2.826 3.083
Average Waiting Time (Tq) = 0.974 1.023
Probability of Queue more than 4 customers waiting = 0.0% 0.0%
Service: Average Utilization of Servers = 96.74% 99.69%
Average Number of Customers Being Served (Ns) = 0.967 0.997
Customers in the System (Number waiting + Number being served):
Average Number in the System (N) = 3.794 4.080
Average Time in System (Tq + Ts) = 1.307 1.354
Distributions:
n P(n) Cumulative q P(q) Cumulative n P(n)
Approx 95%
Conf Interval Cumulative q P(q) Cumulative
0 0.0326 0.0326 0 0.0031 0.0020 0.0031
1 0.0544 0.0870 0 0.0870 0.0870 1 0.0165 0.0071 0.0197 0 0.0197 0.0197
2 0.0906 0.1776 1 0.0906 0.1776 2 0.0508 0.0146 0.0705 1 0.0508 0.0705
3 0.1510 0.3287 2 0.1510 0.3287 3 0.1472 0.0160 0.2177 2 0.1472 0.2177
4 0.2517 0.5804 3 0.2517 0.5804 4 0.3917 0.0098 0.6093 3 0.3917 0.6094
5 0.4196 1.0000 4 0.4196 1.0000 5 0.3907 0.0280 1.0000 4 0.3907 1.0000
Number in the waiting line Total number in the system
Simulation results for last 1100 timeunits, Runs 2 to 12 Theoretical Results for CV = 1
Total number in the system Number in the waiting line
Service Times:
CV=0.3
Inter-Arrivals:
CV=1
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0 1 2 3 4 5
Total Number of Customers in the System (waiting or being
served)
Theoretical
for CV=1
Simulation

Simulate
Show Results
Run with Animation
239531713.xls.ms_office, Warning, p. 12 of 14
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
WARNING: YOU NEED TO ENABLE THE MACROS IN THIS FILE
239531713.xls.ms_office, Warning, p. 13 of 14
E. Exit from Excel. Closing the file is not enough. On the menu bar, select File, and then Exit.
F. Open this file again and follow the instructions in STEP 1 to enable the macros.
For Excel 2003,
A. On the menu bar at the top of this page, select Tools, then Macro, then Security.
B. On the Security Level tab, select Medium and click OK.
C. Then exit from Excel. Closing the file is not enough. On the menu bar, select File, and then Exit.
D. Open this file again and follow the instructions in STEP 1 to enable the macros.
239531713.xls.ms_office, Warning, p. 14 of 14

Você também pode gostar