Академический Документы
Профессиональный Документы
Культура Документы
Graphical Spreadsheet
Simulation of Queues
Armann Ingolfsson
School of Business
University of Alberta
Edmonton, Alberta T6G 2R6, Canada
Armann.Ingolfsson@UAlberta.Ca
The queueing simulation and their graphical representations were implemented in Microsoft Excel 97,
and any specific instructions below refer to this software package.
grossman@UCalgary.ca
Abstract
1. Introduction
27
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
An activity-driven simulation describes the activities that occur during fixed intervals of time (for
example, an hour, day, or week), typically using one
row of the spreadsheet for each time interval. The
activity-driven approach (often used in textbook
inventory models) seems to have first been used for
queueing by Clauss (1996) for ship unloading. However, we think this approach oversimplifies most
queueing systems, unless the simulation time intervals are made very small - which makes the spreadsheet model very large.
Steady state queueing theory results are not particularly useful for understanding what actually transpires in queues: their dynamics, the effect of variability, human behavior while waiting in line, and
such important technical issues as the role of initial
conditions and the distinction between transient and
steady-state behavior.
Simulating queues using dedicated software packages is flexible, powerful and widely used. It is often the best technology for computing quantitative
results. Many simulation packages are available,
such as SLAM, GPSS, Extend+, and Arena. However, simulation packages hide the mechanics of
queues, are expensive and time-consuming to learn,
and are not widely used in survey courses on OR/
MS, although Liberatore and Nydick (1999) argue
that they should be.
28
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
Cust. #
Interarriv
al Time
Arrival
Time
(hr:min)
Service
Time
(min)
(min)
start
1
2
3
4
5
1
1
1
3
3
9:00
9:01
9:02
9:03
9:07
9:10
Server #1
Start
(hr:min)
End
(hr:min)
9:01
9:04
3
9
9
9
9
9:04
9:13
9:13
9:22
Server #2
Start
(hr:min)
End
(hr:min)
9:02
9:11
9:11
9:20
Wait
Time
(hr:min)
Total
Time
(hr:min)
0:00
0:00
0:01
0:04
0:03
0:03
0:09
0:10
0:13
0:12
Figure 1: A two-server queueing simulation template. The entries in bold are included on the template.
Students use the bold entries to compute the italicized entries.
Pasternack (1998) contain single-server processdriven models. Evans and Olson (1998) describe oneand two-server process-driven models. Grossman
(1999) discusses in detail the use of process-driven
spreadsheet queueing simulations. Evans (2000) uses
a single-server process-oriented queueing model
similar to Figure 1. He presents live graphs of average performance measures, including average number in queue, average percent idle time, and average
waiting time per customer, and indicates that individual replications demonstrate different times to
converge to the long-term average value.
29
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
INFORMS
up by vertical lines to show when the server finished serving one customer and immediately began
serving the next customer.
When the simulation is replicated (that is, the spreadsheet is recalculated, by pressing the F9 key), the
customer graph is updated instantly and automatically. The updated graph reflects new samples from
the interarrival and service time distributions, and
the corresponding customer arrival times, service
start times, and service end times.
31
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
Figure 5: Customer and server graphs. When viewed in a web browser, the Figure will cycle through
three different replications of the simulation.
It is easy to program the spreadsheet queueing simulation graphs. However, some non-standard techniques are required. We summarize here the steps
required to program the graphs in Microsoft Excel
97.
INFORMS
2.Select the columns corresponding to all the servers and plot them using Excel's built-in clustered
bar chart. Instruct Excel that the data is organized in rows, rather than columns.
3.Format one of the series to have an overlap of
100.
Students can see for themselves the impact of variability by observing multiple replications of two
models that differ only in the variance of service
time. This in turn leads to student insights into why
queues form -- particularly when utilization (arrival
rate divided by total service rate) is significantly
lower than 100%. Likewise, the simulation model
can quickly be programmed to have a very brief
interarrival time, or a very long service time (or one
can hit F9 several times until such an effect occurs)
so students can observe. This helps students understand why queues persist after forming. These insights are not possible with queueing theory formulas, and are harder to obtain with simulation animations.
33
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
= A(t)/t
(1)
Now let
F(t) = area of shaded region from 0 to t in Figure 6
= total system time for all customers
(2)
(3)
One very real problem that anyone who tries to apply queueing theory is often faced with is imperfect
data. Figure 7 shows a particularly troublesome part
of a real dataset that one of us has used as the basis
for an assignment. The Figure shows the times at
which customers arrived to a "water kiosk" in a third
world country, entered service ("arrival at tap"), and
34
INFORMS
Arrival
Time
8:21
8:25
?
8:28
?
?
?
8:33
8:34
8:35
?
8:36
?
8:39
will have to make sure the arrival time of a customer is always less than or equal to the "arrival at
tap" time for that customer, if it is known.
The missing departure times can also be estimated
fairly easily. One can estimate the average service
time, using customers for which both "arrival at tap"
and "departure time" are available. Then one can
estimate the missing departure times as "arrival at
tap" plus the average service time (2 minutes and 34
seconds in this case).
The tricky part is estimating the missing "arrival at
tap" times. These should be estimated in a way that
is consistent with the queue discipline (first-comefirst-serve) and the number of servers (two). This is
Arrival at Departur
Tap
e Time
8:21
8:27
8:26
8:32
?
8:30
8:31
8:34
?
8:30
?
8:31
8:31
?
?
8:41
?
8:37
8:41
8:49
?
8:36
8:42
?
?
8:40
8:41
8:43
Some of the missing data are easy to estimate, particularly the arrival times. For example, a reasonable estimate for the missing arrival time for customer 72 would be the average of the arrival times
of customers 71 and 73. When several arrival times
in a row are missing (such as for customers 74-76)
one can estimate the missing times such they are
equally spaced between the last known arrival time
and the next known arrival time. In addition, one
35
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
Figure 8: Customer gr
36
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
9. Conclusions
We discussed the use of spreadsheet queueing simulation graphs to enhance student understanding of
queues and of simulation. Use of this technique
seems to increase student interest in elective courses
in simulation.
We look forward to using the server graph in research work with call center managers exploring the
possibility of mixed inbound-outbound call centers
where outbound calls are made during periods of
37
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
10. Appendix
.MaximumScale = [close_time]
.MajorUnit = 1 / 24 / 60 * 5 * X
End With
Next I
End Sub
38
INFORMS Transcations on Education 2:2 (27-39)
INFORMS
11. References
Plane, D. R. (1994), Management Science, a Spreadsheet Approach, Boyd and Fraser, Danvers, MA.
Powell, S. G. (1998), "The studio approach to teaching the craft of modeling," Annals of Operations
Research, vol. 82, no. 1, pp.29-47.
Tufte, E. R. (1983), The Visual Display of Quantitative Information, Graphics Press, Cheshire, CT.
39
INFORMS Transcations on Education 2:2 (27-39)
INFORMS