Professional Documents
Culture Documents
ability to model balking and reneging, we issues as the role of initial conditions and
find we can model balking and reneging the distinction between transient and
(as well as finite queue length, which is a steady-state behavior.
special case of balking). Simulation using dedicated software
Approaches to Teaching Queuing packages is flexible, powerful, and widely
Instructors use three approaches in used for modeling queues, and it is often
teaching about queuing: analytical queu- the best technology for computing quanti-
ing theory, dedicated simulation software, tative results. Many simulation packages
and spreadsheet simulation. are available, such as SLAM, GPSS, Ex-
Queuing theory is widely taught in tend`, and Arena [Swain 1997]. However,
business school OR/MS survey courses, simulation packages hide the mechanics of
and students can use it to quickly compute queues, are expensive and time-
a handful of steady-state performance consuming to learn, and are not widely
measures. As presented in the textbooks used in survey courses on MS/OR, al-
for management science survey courses, though Liberatore and Nydick [forthcom-
queuing theory is limited because the ing] argue that they should be.
models are simplified to make them ana- Spreadsheet simulation is increasingly
lytically tractable, the results apply only to popular. Any spreadsheet model (includ-
steady-state behavior, and the number of ing those built by people with no knowl-
performance measures that can be com- edge of management science) can be simu-
puted is small. (Some queuing theory re- lated using techniques that can be found
sults go beyond these limitations, for ex- in such textbooks as Ragsdale [1998] or
ample, those of Rothkopf and Oren [1979], Winston and Albright [1997]. One pro-
but they are not described in introductory grams one or more spreadsheet cells to
texts.) Because deriving results using provide a sample value from a specified
queuing-theory models requires mathe- distribution. By recalculating the work-
matics beyond the scope of the survey sheet, one can generate a new set of sam-
course, they are presented as black box ples, and the program computes the corre-
formulas, and students do not gain the in- sponding changes in the model
sights MS/OR professionals obtain by automatically. By repeatedly recalculating
studying the underlying theory. Further- the worksheet, one can generate a distri-
more, simple performance measures, such bution of stochastic input values and cor-
as the 95th percentile of waiting time or responding stochastic output values. We
the fraction of customers who wait more recommend use of simulation add-in
than five minutes, often cannot be com- packages (for example, @RISK, Crystal
puted using queuing theory. Ball, INSIGHT.xla), which simplify sam-
Queuing theory is not particularly use- pling, manage iterations, track results, and
ful for understanding what actually tran- compute statistics.
spires in queues: their dynamics, the effect Evans and Olson [1998] distinguish
of variability, human behavior while wait- three classes of spreadsheet simulation
ing in line, and such important technical models: activity-driven, event-driven, and
MayJune 1999 89
GROSSMAN
INTERFACES 29:3 90
TEACHERS FORUM
Figure 1: In this template for a basic two-server queue, we provide the entries in bold. Students
use the bold entries to compute the italicized entries.
management science to influence the man- stories or on small-scale projects from lo-
agement of their firms. Plane [1994a], cal industry). At this time, we recognized
Grossman [1997], Powell [1997], Savage that examples that purport to be from
[1997], and Sonntag and Grossman [forth- functional areas of business but are obvi-
coming] discuss the issues and opportuni- ously irrelevant to the practice of manage-
ties and how end-user modelers differ ment damage the credibility of the course
from expert consultant modelers (also [Sprague and Sprague 1976] and therefore
known as practitioners). started to cull bogus examples. In winter
The transition from a traditional course 1998, we eliminated all algorithm-focused
to an end-user modeling course took three content and almost all the remaining bo-
years. In winter 1996 we adopted Excel gus examples (we retained a few introduc-
(which had the best LP solver at that time) tory toy models); refined the teaching of
and the simulation add-in @RISK, elimi- spreadsheet modeling; incorporated con-
nated all other software, rewrote the tent from finance, organizational behavior,
course notes, and instituted a community- accounting, marketing and MIS; focused
based term project. In winter 1997, we our lectures and class discussions on busi-
again rewrote the course notes, eliminated ness issues beyond the analytical results;
algebraic modeling in favor of spreadsheet and reoriented the term project toward
modeling, added process-driven spread- achieving practical consulting results for
sheet queuing simulation, reduced the client companies. We had at last
algorithm-focused content, started to cull achieved a full end-user modeling course,
bogus examples, reduced LP output analy- and teaching ratings increased to be
sis (for example, reduced costs, objective- among the best of the required courses.
function-coefficient ranges, and shadow- (We converted the evening MBA course
price ranges) in favor of direct sensitivity during the spring and summer of 1998.
analysis, added demonstrations of how to This transition was easy, given our experi-
make effective technical presentations, and ence with the undergraduate course.)
added real cases (based on student success As we gained experience teaching end-
MayJune 1999 91
GROSSMAN
INTERFACES 29:3 92
TEACHERS FORUM
tion software. We find spreadsheet queu- ately observe and understand the mechan-
ing simulations useful for teaching stu- ics of queues and the experiences of cus-
dents what transpires in real queues. tomers in queues. Users quickly realize
Pedagogical Benefits of Spreadsheet (Figure 3) which columns contain the ac-
Queuing Simulation tivities of the servers and that by examin-
We find that performing queuing simu- ing the start time and end time of each
lations in spreadsheets offers six benefits: server, they can easily see when servers
explicitness, immediacy, insight, flexibility, are busy and when they are idle. Since the
active modeling, and accessibility. These spreadsheet simulation logic preferentially
benefits apply not only to students, but assigns customers to the lowest-indexed
also to instructors with expertise in queu- (leftmost) server, the pattern of start and
ing theory. end times and blank cells in the server col-
Spreadsheets show the experiences of umns provides the user with a clear non-
individual customers and servers explic- numerical indication of how customers are
itly. In contrast to queuing theory (and routed to servers and the effect of busy
most stand-alone simulation packages), servers. When someone raises a question
spreadsheets retain and display the experi- about the behavior of the queue or of cus-
ences of individual customers. This makes tomers, it is easy to replace selected ran-
spreadsheet simulation more informative dom values for interarrival time or service
and more effective in helping students to time with appropriate fixed values. This
develop intuition and genuine under- allows the instructor to quickly and con-
standing about queues than a comparable cretely share one students observation
series of runs using queuing theory. They with the entire class and facilitates explo-
are also much less mysterious than queu- ration of the spreadsheet model.
ing theory, whose results the uninitiated Spreadsheets help users to develop their
must take on faith. intuition regarding why queues behave as
With spreadsheets, users can immedi- they do. Geoffrion [1976] argues that the
Figure 2: In the data worksheet for a two-server basic queue, the user specifies the facility start
time and close time. The user enters on this page any data required for the interarrival time
distribution and service time distribution, which can be parameters for a native Excel discrete
distribution (shown here) or for spreadsheet add-in probability distribution formulas.
MayJune 1999 93
GROSSMAN
Figure 3: In the simulation worksheet (with cell formulas) for a two-server basic queue, the cus-
tomer stochastic interarrival times are in column B, arrival times are in column C, and service
times are in column D. We assign each customer to a server in columns E, F, G, and H, with
start and finish time indicated in the column corresponding to the assigned server. We assign
customers to the first available server and to the lowest-indexed server if multiple servers are
available. In columns I and J we compute two common performance measures, waiting time
and time in system. We compute another performance measure, the percentage of customers
who wait at least six minutes, in cell K5 with intermediate calculations in column K. We can
see the experience of customer 3 in row 14. Customer 3 arrives one minute (stochastic, cell B14)
after the arrival of customer 2 at 9:04 (cell C13), arriving at 9:05 (cell C14). Customer 3 starts
service at server 2 at 9:07 (cell G14) upon the completion of service for customer 2 (cell H13).
After the stochastic service time of three minutes (cell D14) has passed, our customer completes
service at 9:10 (cell H14). The simulation worksheet displays the word closed and blank cells
for would-be customer 13 who arrived after the facility had closed at 10:00.
true purpose of management science is in- theory formulas quantify the delay, they
sight, not numbers. A classic result of do not explain why these delays occur nor
queuing theory (and of operations man- why they increase as variability increases.
agement in general) is that process vari- Consider a two-server spreadsheet queu-
ability causes delays. Although queuing ing simulation, with fixed service times of
INTERFACES 29:3 94
TEACHERS FORUM
11 minutes and fixed interarrival times of the user be interested in, say, the percent-
six minutes. We can instantly demonstrate age of cycle times that are greater than
that the queuing system moves in lock- five minutes for those customers who had
step, with customers never waiting. We to wait at least two minutes, he or she can
can introduce variability by making the easily compute it. However, as Evans and
service times probabilistic with a mean of Olson [1998] point out, our process-driven
11 minutes, and the impact on system per- approach to spreadsheet queuing simula-
formance is visible immediately. We can tion is not suitable for computing such
recalculate the worksheet a few times to time-dependent performance measures as
demonstrate the types of things that can the average queue length. (We can com-
happen with variability: sometimes there pute the length of the queue at a given
are no queues, sometimes there are large moment in time, which allows us to model
queues, and once a queue builds it tends balking. We could probably compute the
to persist. Users can observe these results distribution on queue length only by using
and articulate for themselves the reason a macro; some business school students
that variability is the driver. Such insights and managers could program this.)
are difficult to acquire with dedicated The use of a template to formalize ones
simulation packages, even those with ani- knowledge entails an experience of active
mation capabilities. modeling. Calls to teach modeling, as op-
Also, as Evans and Olson [1998] indi- posed to models, date back at least to
cate, spreadsheet queuing simulation Morris [1967]. Powell [1995] distinguishes
forces users to examine the transient be- between the science of models (which
havior (starting with an empty system) as were good at teaching) and the art and
distinct from steady-state behavior. craft of modeling (which were not so
Spreadsheet simulation provides the in- good at teaching). In the Magnanti report,
structor with a means of presenting a con- Jordan et al. [1997] recommend that teach-
crete example of this distinction, and it ers place more emphasis on the use of
strengthens the users ability to interpret spreadsheets as a vehicle for modeling, es-
steady-state queuing theory results. pecially for end-users. A paper template is
Spreadsheets allow students to consider a beginners tool for modeling, and our
a wide range of models and performance approach to process-driven spreadsheet
measures. Spreadsheet queuing simula- simulation provides an explicit, concrete
tions can be programmed to consider vari- linkage between models and modeling.
ous situations, including those for which Spreadsheet users can access the power
no closed-form solutions exist, such as of queuing simulation without the invest-
balking and reneging. Spreadsheet queu- ment required to use simulation packages.
ing simulations can also be used to com- All our students know how to use spread-
pute a wide range of custom performance sheets, and we can teach them to use our
measures about a queue, including perfor- spreadsheet queuing engines in one class
mance measures that cannot be computed period, whereas our elective course on
using queuing theory (Figure 3). Should simulation (using Arena) takes an entire
MayJune 1999 95
GROSSMAN
INTERFACES 29:3 96
TEACHERS FORUM
gramming approach different from model- ing simulation with a known number of
ing a one-server queue because the next customers (as in Evans and Olson [1998]),
available server must be identified. Like- this issue is trivial. For a terminating
wise, modeling a queue with three or simulation that ends at a particular time,
more servers requires a different program- we need to use good modeling judgment.
ming approach from modeling a queue for An informal (but effective) approach is to
two servers, because simple IF statements use enough but not too many. Too many
are unsuitable for identifying which of customer rows will unnecessarily increase
many servers is available next. No use of run times. If we include too few customer
macros is required. The only advanced rows, then any replications with unusually
programming consists of a five-line Excel short interarrival time outcomes could
function (written by an MBA student) contain inaccuracies because customers
used in the extension that considers balk- might cease to arrive before the store
ing and finite queue length. closes. It is easy to program a flag that an-
nounces when a replication has this diffi-
culty. It is easy to program the spread-
The teaching community
sheet to compute performance measures
should take responsibility for only for customers who arrive before clos-
improving student ing. (When using spreadsheet add-ins, one
programming. computes each performance measure once
on the worksheet, and the add-in repli-
The overall size of a spreadsheet pro- cates that performance measure automati-
gram can be a poor measure of the incum- cally.) If the goal is to use the spreadsheet
bent complexity. The guts of our models simulation solely as a tool to facilitate
are concentrated in a single row, and once thinking and discussion about queues,
a row has been programmed, all other then this issue is not a concern.
rows are trivially programmed using a Performance measures computed for a
spreadsheet fill-down editing feature single replication of the worksheet differ
(appendix). from performance measures computed for
We have built models with as many as multiple replications. The variance of
12 servers and find no inherent limitation waiting time (or any other higher moment
to the number of servers that can be of a distribution) can be computed for a
programmed. single replication, but the variance of wait-
Because each row in the spreadsheet ing time across replications cannot easily
queuing simulations corresponds to a sin- be determined from simulation add-in
gle customer, we must determine the output, because the variance across repli-
right number of customer rows to in- cations is not equal to the mean of the rep-
clude. For a nonterminating simulation, lication variances. The instructor must
this issue is identical to that faced when make this distinction clear to students.
using stand-alone simulation software, so This issue arises in other models, such as
we wont address it here. For a terminat- the activity-based inventory simulation
MayJune 1999 97
GROSSMAN
INTERFACES 29:3 98
TEACHERS FORUM
MayJune 1999 99
GROSSMAN
Savage [1997] observes that an algebraic ing engines on the world wide web (but
curtain forms a barrier to ordinary peo- not the development of the software itself)
ples understanding of models that are came from the Learning Enhancement En-
best on technical grounds. Savage recom- velope of the Province of Alberta, Canada.
mends that spreadsheets be used to in- Robert A. Willis did most of the HTML
crease their access to tools. This obser- programming. Stephen G. Powell, Michael
vation also applies to queuing H. Rothkopf, three anonymous referees,
models. Jaydeep Balakrishnan, Astrid Eckstein,
The availability of cheap, fast comput- and Grant Oh provided useful sugges-
ing means that computational efficiency is tions. Edward Silver and Thomas
no longer a concern for many practical Rohleder assisted in many ways.
business problems. Spreadsheets allow
APPENDIX
technically unsophisticated people to use Access to Software via the World Wide
management science without having to Web
master the intricacies of algebraic formula- You can freely download from http:
tion and algorithmic details. Spreadsheets //www.ucalgary.ca/;grossman/
allow instructors to teach the use of man- simulation/a number of spreadsheet
queuing simulation models (in Excel 5.0
agement science tools without teaching the
format):
underlying science, creating new opportu-
The spreadsheet shown in Figures 2, 3,
nities for end-user application. The use of and 4, and
spreadsheets as a vehicle for end-user A family of spreadsheet queuing simu-
modeling will play a key role in the future lation engines. These engines are ready for
of management science and is an exciting simulation replications and need only mi-
and important new area of research. nor modifications to customize them to a
Acknowledgments particular situation. We provide engines
for one through 12 servers for basic
Max Bayer introduced the use of a pa-
queues and for queues with balking, re-
per template to teach the dynamics of neging, and balking and reneging.
queuing at the University of Calgary in A list of resources for performing man-
the 1980s, and S.T. (Van) Enns and Don agement science in spreadsheets, including
Kerr programmed this one-server model textbooks, courses, and vendor contacts
in a spreadsheet no later than 1992. Enns for spreadsheet add-in simulation soft-
ware, is available via the INFORMS Edu-
programmed an approximate three-server
cation Forum,
queue with balking in the DOS version of http://www.informs.org/informed/.
Lotus 1-2-3 in 1992. Programming the Computations
Support for developing the spreadsheet Worksheet
queuing engines came from the Canadian We designed the computations work-
Natural Sciences and Engineering Re- sheet to facilitate programming and ease
of maintenance. Figures 3 and 4 show rep-
search Council Grant OGP0172794.
resentative cell formulas.
Rebecca Tsang did most of the program- Columns B and D contain cell formulas
ming, with some help from Sherry L. Oh. that compute sample values from specified
Support for putting the spreadsheet queu- probability distributions. As Ragsdale
[1998] and Winston and Albright [1997] two time values to get a third time value
describe, these formulas can be spread- and to display time values in hr:min
sheet add-in functions, or they can be code format.
that applies the built-in uniform (0,1) dis- In programming, it is important to
tribution to the inverse cumulative of the avoid mixing data types and the ensuing
desired distribution. error messages. When customers arrive
Columns C and E convert the sampled before the facility is open, their arrival
interarrival time (in minutes) into Excel se- times are numeric (serial time values),
rial time. (Excel serial time represents whereas if customers arrive after the facil-
12:00 a.m. as zero and 12:01 a.m. as ity is closed, their arrival times are text (ei-
1/1440.) This allows us to directly add ther closed or a null character). To avoid
Figure 4: In the computations worksheet (with cell formulas) for a two-server basic queue, the
user programs a formula to sample interarrival time in column B. The interarrival time is con-
verted from minutes to Excel serial time by dividing by 1,440 in column C. The user programs
a formula to sample service time in column D. The service time is converted from minutes to
Excel serial time by dividing by 1,440 in column E. The arrival time for each customer is shown
in column F and is computed as the sum of interarrival time and the previous customers ar-
rival time. The earliest time at which the customer can begin service at each server is computed
in columns G and H. The customer starts service at the minimum of columns G and H, shown
in column I, and receives service from the corresponding server shown in column J.
mixing data types, we check for text in a bers 1 and 2 in cells F7 and H7, and
cell before performing calculations. For ex- change E12 to be
ample, to compute customer 3s arrival
time by adding the interarrival time (se- 4 IF (Computations!$J12 4 F7, Computa-
rial) to customer 2s arrival time (which tions!I12, 99).
could be serial or text), we use this for- On the computations worksheet shown in
mula in cell F14: Figure 4, place the label Potential Start
in cells G5 and H5, the label Server# in
4 IF (ISTEXT (F13), 99, IF (F13 ` C14 . 4
cells G6 and H6, and the numbers 1 and 2
close_time, closed, F13 ` C14)).
in cells G7 and H7, and change G12 to be
The ISTEXT function causes the cell to 4 IF (ISTEXT ($F12), 99, MAX (OFFSET
display a null character if the previous (Simulation!$F$11:$F11, 0, 2*(G$7-1)),
customers arrival time (cell F13) is text start_time, $F12)).
(corresponding to the facility being
closed). Otherwise, we check to see if cus- References
tomer 3 is the first customer to arrive after Caine, D. J. and Robson, A. J. 1993, Spread-
the facility is closed, in which case F14 dis- sheet modelling: Guidelines for model devel-
plays closed. If customer 3 arrives be- opment, Management Decision, Vol. 31, No.
fore the facility is closed, F14 displays his 1, pp. 3844.
arrival time. Camm, J. D. and Evans, J. R. 1996, Management
We compute customer 3s server and Science: Modeling, Analysis and Interpretation,
start time in cells G14, H14, I14, and J14. South-Western College Publishing, Cincin-
Cell G14 computes customer 3s start time, natti, Ohio.
Chase, R. B. and Aquilano, N. J. 1992, Produc-
if he starts at server 1. This is the maxi-
tion and Operations Management, sixth edition,
mum of customer 3s arrival time, the time Richard D. Irwin, Chicago, Illinois.
the facility opens, and the time server 1 Clauss, F. J. 1996, Applied Management Science
becomes available. Similarly, cell H14 and Spreadsheet Modeling, Duxbury Press, Bel-
computes customer 3s start time, if he mont, California.
starts at server 2. Cell I14 computes cus- Conway, D. G. and Ragsdale, C. T. 1997, Mod-
tomer 3s actual start time, which is the eling optimization problems in the unstruc-
minimum of cells G14 and H14. Cell J14 tured world of spreadsheets, Omega, Vol.
computes customer 3s server using the 25, No. 3, pp. 313322.
following code (using MATCH rather than Cragg, P. B. and King, M. 1993, Spreadsheet
IF to improve scaling): modelling abuse: An opportunity for OR?,
Journal of the Operational Research Society, Vol.
4 IF (ISTEXT (F14), 99, MATCH (I14, 44, No. 8, pp. 743752.
G14:H14, 0)). Evans, J. R. and Olson, D. L. 1998, Introduction
to Simulation and Risk Analysis, Prentice Hall,
ISTEXT displays a null character if the fa- Upper Saddle River, New Jersey.
cility is closed, and MATCH displays the Geoffrion, A. M. 1976, The purpose of mathe-
server whose potential start time (G14 or matical programming is insight not num-
bers, Interfaces, Vol. 7, No. 6, pp. 8192.
H14) is equal to the earliest start time
Grossman, T. A. 1997, End-user modeling,
(I14); if tied, it displays the lowest-indexed OR/MS Today, Vol. 24, No. 5 (October), p. 10.
server. Grossman, T. A.; Tran, K.; and Ursu, G. D.
Ragsdale has suggested a way to im- 1997, Prospects and techniques for dynamic
prove scaling. On the simulation work- discrete event simulation in spreadsheets,
sheet shown in Figure 3, place the label Proceedings of the International Association of
Server# in cells E7 and G7 and the num- Science and Technology for Development Interna-
tional Conference on Applied Modelling and ment at AgrEvo Canada Inc., Interfaces.
Simulation, Banff, Canada, July, available at Sprague, L. G. and Sprague, C. R. 1976, Man-
http://www.ucalgary.ca/;grossman agement Science? Interfaces, Vol. 7, No. 6,
/simulation/index.html. pp. 5762.
Hesse, R. 1997, Managerial Spreadsheet Modeling Swain, J. J. 1997, 1997 Simulation software sur-
and Analysis, Richard D. Irwin, Chicago, vey, OR/MS Today, Vol. 24, No. 5 (October),
Illinois. pp. 3846.
Jordan, E.; Lasdon, L.; Lenard, M.; Moore, J.; Thesen, A. and Travis, L. E. 1992, Simulation for
Powell, S.; and Willemain, T. 1997, Report Decision Making, West Publishing, St. Paul,
of the operating subcommittee of the IN- Minnesota.
FORMS business school education task Winston, W. L. 1996, Simulation Modeling Using
force, OR/MS Today, Vol. 24, No. 1 (Febru- @RISK, Duxbury Press, Belmont, California.
ary), pp. 3641, available at http: Winston, W. L. and Albright, S. C. 1997, Practi-
//www.informs.org/informed cal Management Science: Spreadsheet Modeling
/magnanti.html. and Applications, Duxbury Press, Belmont,
Lawrence, J. A. and Pasternack, B. A. 1998, Ap- California.
plied Management Science: A Computer-
Integrated Approach for Decision Making, John
Wiley and Sons, New York.
Liberatore, M. J. and Nydick, R. L. forthcoming,
Breaking the mold: A new approach for
teaching the first MBA management science
course, Interfaces.
Morris, M. 1967, On the art of modeling,
Management Science, Vol. 13, No. 12 (August),
pp. B-707B-717.
Plane, D. R. 1994a, Spreadsheet power,
OR/MS Today, Vol. 21, No. 6 (December), pp.
3238.
Plane, D. R. 1994b, Management Science: A
Spreadsheet Approach, Boyd and Fraser,
Danvers, Massachusetts.
Powell, S. G. 1995, Six key modeling heuris-
tics, Interfaces, Vol. 25, No. 4, pp. 114125.
Powell, S. G. 1997, The teachers forum: From
intelligent consumer to active modeler: Two
MBA success stories, Interfaces, Vol. 27, No.
3 (May-June), pp. 8898.
Ragsdale, C. T. 1998, Spreadsheet Modeling and
Decision Analysis, second edition, South-
Western College Publishing, Cincinnati,
Ohio.
Rothkopf, M. and Oren, S. 1979, A closure ap-
proximation for the nonstationary M/M/S
queue, Management Science, Vol. 25, No. 6,
pp. 522534.
Savage, S. L. 1997, Weighing the pros and
cons of decision technology in spreadsheets,
OR/MS Today, Vol. 24, No. 1 (February), pp.
4245.
Sonntag, C. and Grossman, T. A. forthcoming,
End-user modeling improves R&D manage-