Simulation
Simulation
Simulation?
Chapter 1
Simulation Is …
• Simulation – very broad term – methods and
applications to imitate or mimic real systems,
usually via computer
• Applies in many fields, industries
• Very popular, powerful
• Book covers simulation in general,
Arena simulation software in particular
• This chapter – general ideas, terminology,
examples of applications, good/bad things, kinds
of simulation, software options, how/when
simulation is used
Simulation with Arena, 6th ed. Chapter 1 – What Is Simulation? Slide 2 of 23
Systems
• System – facility or process, actual or planned
Examples abound …
– Manufacturing facility
– Bank operation
– Airport operations (passengers, security, planes, crews, baggage)
– Transportation/logistics/distribution operation
– Hospital facilities (emergency room, operating room, admissions)
– Computer network
– Freeway system
– Business process (insurance office)
– Criminal justice system
– Chemical plant
– Fast-food restaurant
– Supermarket
– Theme park
– Emergency-response system
– Shipping ports, berths
– Military combat, logistics
Simulation with Arena, 6th ed. Chapter 1 – What Is Simulation? Slide 3 of 23
Types of Models
• Physical (iconic) models
Tabletop material-handling models
Mock-ups of fast-food restaurants
Flight simulators
• Logical (mathematical) models
Approximations, assumptions about system’s operation
Often represented via computer program in appropriate
software
Exercise program to try things, get results, learn about
model behavior
Computer Simulation
• Methods for studying wide variety of models of
systems
Numerically evaluate on computer
Use software to imitate system’s operations,
characteristics, often over time
• Can use to study simple models, but should not
use if an analytical solution is available
• Real power of simulation – studying complex
models
• Simulation can tolerate complex models since we
don’t even aspire to an analytical solution
Chapter 2
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 1 of 57
Model Specifics
• Initially (time 0) empty and idle
• Base time units: minutes
• Input data (assume given for now …), in minutes:
Part Number Arrival Time Interarrival Time Service Time
1 0.00 1.73 2.90
2 1.73 1.35 1.76
3 3.08 0.71 3.39
4 3.79 0.62 4.52
5 4.41 14.28 4.46
6 18.69 0.70 4.36
7 19.39 15.52 2.07
8 34.91 3.15 3.36
9 38.06 1.76 2.37
10 39.82 1.00 5.38
11 40.82 . .
. . . .
. . . .
• Stop when 20 minutes of (simulated) time have
passed
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 4 of 57
Goals of Study:
Output Performance Measures
• Total production of parts over run (P)
• Average waiting time of parts in queue:
N N = no. of parts completing queue wait
∑ WQi WQi = waiting time in queue of ith part
i =1
Know: WQ1 = 0 (why?)
N
N > 1 (why?)
• Maximum waiting time of parts in queue:
max WQi
i =1,...,N
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 5 of 57
Goals of Study:
Output Performance Measures (cont’d.)
• Time-average number of parts in queue:
20
∫0 Q (t ) dt Q(t) = number of parts in queue
20 at time t
• Maximum number of parts in queue: max Q (t )
0≤t ≤20
• Average and maximum total time in system of
parts (a.k.a. cycle time):
P
∑TSi
i =1 , TSi = time in system of part i
max TSi
P i =1,...,P
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 6 of 57
Goals of Study:
Output Performance Measures (cont’d.)
• Utilization of machine (proportion of time busy)
{
20
∫ 0
B(t ) dt
, B(t ) = 10 ifif machine is busy at time t
20 machine is idle at time t
• Many others possible (information overload?)
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 7 of 57
Analysis Options
• Educated guessing
Average interarrival time = 4.08 minutes
Average service time = 3.46 minutes
So (on average) parts are being processed faster than they
arrive
– System has a chance of operating in a stable way in long run, i.e.,
might not “explode”
– If all interarrivals and service times were exactly at their mean, there
would never be a queue
– But data clearly exhibit variability, so a queue could form
If we’d had average interarrival < average service time, and
this persisted, then queue would explode
Truth — between these extremes
Guessing has its limits …
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 8 of 57
Analysis Options (cont’d.)
• Queueing theory
Requires additional assumptions about model
Popular, simple model: M/M/1 queue
– Interarrival times ~ exponential
– Service times ~ exponential, indep. of interarrivals
– Must have E(service) < E(interarrival)
– Steady-state (long-run, forever)
– Exact analytic results; e.g., average waiting time in queue is
µS2 µ A = E(interarrival time)
,
µ A − µS µS = E(service time)
Problems: validity, estimating means, time frame
Often useful as first-cut approximation
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 9 of 57
Mechanistic Simulation
• Individual operations (arrivals, service times) will
occur exactly as in reality
• Movements, changes occur at right “times,” in
right order
• Different pieces interact
• Install “observers” to get output performance
measures
• Concrete, “brute-force” analysis approach
• Nothing mysterious or subtle
But a lot of details, bookkeeping
Simulation software keeps track of things for you
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 10 of 57
Pieces of a Simulation Model
• Entities
“Players” that move around, change status, affect and are
affected by other entities
Dynamic objects — get created, move around, leave
(maybe)
Usually represent “real” things
– Our model: entities are parts
Can have “fake” entities for modeling “tricks”
– Breakdown demon, break angel
Though Arena has built-in ways to model these examples directly
Usually have multiple realizations floating around
Can have different types of entities concurrently
Usually, identifying types of entities is first thing to do in
building model
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 11 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 12 of 57
Pieces of a Simulation Model (cont’d.)
• (Global) Variables
Reflects a characteristic of whole model, not of specific
entities
Used for many different kinds of things
– Travel time between all station pairs
– Number of parts in system
– Simulation clock (built-in Arena variable)
Name, value of which there’s only one copy for whole
model
Not tied to entities
Entities can access, change variables
Writing on wall (rewriteable)
Some built-in by Arena, you can define others
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 13 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 14 of 57
Pieces of a Simulation Model (cont’d.)
• Queues
Place for entities to wait when they can’t move on (maybe
since resource they want to seize is not available)
Have names, often tied to a corresponding resource
Can have a finite capacity to model limited space — have
to model what to do if an entity shows up to a queue that’s
already full
Usually watch length of a queue, waiting time in it
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 15 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 16 of 57
Pieces of a Simulation Model (cont’d.)
• Statistical accumulators for simple processing
system
Number of parts produced so far
Total of waiting times spent in queue so far
No. of parts that have gone through queue
Max time in queue we’ve seen so far
Total of times spent in system
Max time in system we’ve seen so far
Area so far under queue-length curve Q(t)
Max of Q(t) so far
Area so far under server-busy curve B(t)
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 17 of 57
Simulation Dynamics:
Event-Scheduling “World View”
• Identify characteristic events
• Decide on logic for each type of event to:
Effect state changes for each event type
Observe statistics
Update times of future events (maybe of this type, other
types)
• Keep a simulation clock, future event calendar
• Jump from one event to the next, process,
observe statistics, update event calendar
• Must specify an appropriate stopping rule
• Usually done with general-purpose programming
language (C++, Java, Matlab, FORTRAN, etc.)
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 18 of 57
Events for the
Simple Processing System
• Arrival of a new part to system
Update time-persistent statistical accumulators (from last
event to now)
– Area under Q(t)
– Max of Q(t)
– Area under B(t)
“Mark” arriving part with current time (use later)
If machine is idle:
– Start processing (schedule departure), Make machine busy, Tally
waiting time in queue (0)
Else (machine is busy):
– Put part at end of queue, increase queue-length variable
Schedule next arrival event
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 19 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 20 of 57
Events for the
Simple Processing System (cont’d.)
• The End
Update time-persistent statistics (to end of simulation)
Compute final output performance measures using current
(= final) values of statistical accumulators
• After each event, event calendar’s top record is
removed to see what time it is, what to do
• Also must initialize everything
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 21 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 22 of 57
Simulation by Hand
• Manually track state variables, statistical
accumulators
• Use “given” interarrival, service times
• Keep track of event calendar
• “Lurch” clock from one event to next
• Will omit times in system, “max” computations
here (see text for complete details)
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 23 of 57
Simulation by Hand:
Setup
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 24 of 57
Simulation by Hand:
t = 0.00, Initialize
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [1, 0.00, Arr]
0.00 0 0 <empty> [–, 20.00, End]
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 25 of 57
Simulation by Hand:
t = 0.00, Arrival of Part 1
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [2, 1.73, Arr]
1 0.00 1 0 <empty> [1, 2.90, Dep]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
1 0.00 0.00 0.00
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 26 of 57
Simulation by Hand:
t = 1.73, Arrival of Part 2
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [1, 2.90, Dep]
2 1 1.73 1 1 (1.73) [3, 3.08, Arr]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
1 0.00 0.00 1.73
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 27 of 57
Simulation by Hand:
t = 2.90, Departure of Part 1
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [3, 3.08, Arr]
2 2.90 1 0 <empty> [2, 4.66, Dep]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
2 1.17 1.17 2.90
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 28 of 57
Simulation by Hand:
t = 3.08, Arrival of Part 3
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [4, 3.79, Arr]
3 2 3.08 1 1 (3.08) [2, 4.66, Dep]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
2 1.17 1.17 3.08
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 29 of 57
Simulation by Hand:
t = 3.79, Arrival of Part 4
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [5, 4.41, Arr]
4 3 2 3.79 1 2 (3.79, 3.08) [2, 4.66, Dep]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
2 1.17 1.88 3.79
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 30 of 57
Simulation by Hand:
t = 4.41, Arrival of Part 5
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [2, 4.66, Dep]
5 4 3 2 4.41 1 3 (4.41, 3.79, 3.08) [6, 18.69, Arr]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
2 1.17 3.12 4.41
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 31 of 57
Simulation by Hand:
t = 4.66, Departure of Part 2
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [3, 8.05, Dep]
5 4 3 4.66 1 2 (4.41, 3.79) [6, 18.69, Arr]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
3 2.75 3.87 4.66
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 32 of 57
Simulation by Hand:
t = 8.05, Departure of Part 3
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [4, 12.57, Dep]
5 4 8.05 1 1 (4.41) [6, 18.69, Arr]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
4 7.01 10.65 8.05
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 33 of 57
Simulation by Hand:
t = 12.57, Departure of Part 4
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [5, 17.03, Dep]
5 12.57 1 0 () [6, 18.69, Arr]
[–, 20.00, End]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
5 15.17 15.17 12.57
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 34 of 57
Simulation by Hand:
t = 17.03, Departure of Part 5
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [6, 18.69, Arr]
17.03 0 0 () [–, 20.00, End]
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 35 of 57
Simulation by Hand:
t = 18.69, Arrival of Part 6
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [7, 19.39, Arr]
6 18.69 1 0 () [–, 20.00, End]
[6, 23.05, Dep]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
6 15.17 15.17 17.03
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 36 of 57
Simulation by Hand:
t = 19.39, Arrival of Part 7
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [–, 20.00, End]
7 6 19.39 1 1 (19.39) [6, 23.05, Dep]
[8, 34.91, Arr]
Number of Total of Area under Area under
completed waiting waiting times in queue Q(t) B(t)
times in queue
6 15.17 15.17 17.73
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 37 of 57
Simulation by Hand:
t = 20.00, The End
System Clock B(t) Q(t) Arrival times of Event calendar
custs. in queue [6, 23.05, Dep]
7 6 20.00 1 1 (19.39) [8, 34.91, Arr]
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 38 of 57
Simulation by Hand:
Finishing Up
• Average waiting time in queue:
Total of times in queue 15.17
= = 2.53 minutes per part
No. of times in queue 6
• Time-average number in queue:
Area under Q(t ) curve 15.78
= = 0.79 part
Final clock value 20
• Utilization of drill press:
Area under B(t ) curve 18.34
= = 0.92 (dimension less)
Final clock value 20
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 39 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 40 of 57
Event-Scheduling Logic via
Programming
• Clearly well suited to standard programming
language (C, C++, Java, etc.)
• Often use “utility” libraries for:
List processing
Random-number generation
Random-variate generation
Statistics collection
Event-list and clock management
Summary and output
• Main program ties it together, executes events in
order
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 41 of 57
Simulation Dynamics:
Process-Interaction World View
• Identify characteristic entities in system
• Multiple copies of entities co-exist, interact,
compete
• “Code” is non-procedural
• Tell a “story” about what happens to a “typical”
entity
• May have many types of entities, “fake” entities
for things like machine breakdowns
• Usually requires special simulation software
Underneath, still executed as event-scheduling
• View normally taken by Arena
Arena translates your model description into a program in
SIMAN simulation language for execution
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 42 of 57
Randomness in Simulation
• Above was just one “replication” — a sample of
size one (not worth much)
• Made a total of five replications (IID):
Substantial variability
across replications
Comparing Alternatives
• Usually, simulation is used for more than just a
single model “configuration”
• Often want to compare alternatives, select or
search for best (via some criterion)
• Simple processing system: What would happen
if arrival rate doubled?
Cut interarrival times in half
Rerun model for double-time arrivals
Make five replications
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 44 of 57
Results: Original vs. Double-Time
Arrivals
• Original – circles
• Double-time – triangles
• Replication 1 – filled in
• Replications 2-5 – hollow
• Note variability
• Danger of making decisions
based on one (first)
replication
• Hard to see if there are
really differences
• Need: Statistical analysis
of simulation output data
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 45 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 46 of 57
Simulating with Spreadsheets:
Newsvendor Problem – Setup
• Rupert sells daily newspapers on street
Rupert buys for c = $0.55 each, sells for r = $1.00 each
• Each morning, Rupert buys q copies
q is a fixed number, same every day
• Demand during a day: D = max (X, 0)
X ~ normal (µ = 135.7, σ = 27.1), from historical data
X rounds X to nearest integer
• If D ≤ q, satisfy all demand, and q – D ≥ 0 left over,
sell for scrap at s = $0.03 each
• If D > q, sells out (sells all q copies), no scrap
But missed out on D – q > 0 sales
• What should q be?
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 47 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 49 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 55 of 57
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 56 of 57
Overview of a Simulation Study
• Understand system
• Be clear about goals
• Formulate model representation
• Translate into modeling software
• Verify “program”
• Validate model
• Design experiments
• Make runs
• Analyze, get insight, document results
More: Chapter 13
Simulation with Arena, 6th ed. Chapter 2 – Fundamental Simulation Concepts Slide 57 of 57
What We’ll Do ...
A Guided Tour
Through Arena • Start Arena
• Load, explore, run an existing model
Basically same as hand simulation in Chapter 2
Browse dialogs and menus
Run model
Chapter 3 Look at results
• Construct same model from scratch
• Use just these basic building blocks in case
study to address real operational question
• Tour menus, toolbars, drawing, printing
• Help system
• Options for running and control
Last revision March 9, 2014
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 1 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 2 of 70
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 3 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 4 of 70
Opening an Existing Model Flowchart and Spreadsheet Views
• File > Open … or button Why the .doe default filename • Model window split into two views
Navigate to desired disk/directory extension for Arena models? Flowchart view
Click > Open or double-click Model 03-01.doe – Graphics
– Process flowchart
Book example models: www.mhhe.com/kelton,
– Animation, drawing
Student Edition, BookExamples.zip, put where you want
– Edit things by double-clicking on them, get into a dialog
More examples (typical location on Windows 7): Spreadsheet view
C:\Users\Public\Public Documents\Rockwell Software\Arena\Examples
– Displays model data directly
• Model window (right side of Arena window) – Can edit, add, delete data in spreadsheet view
Where model is built – Displays all similar kinds of modeling elements at once
Resize, maximize, minimize, scroll/pan, zoom Many model parameters can be edited in either view
Can have multiple model windows open at once Horizontal splitter bar to apportion two views
• Cut, Copy, Paste within Arena, and between View > Split Screen (or push ) to see both flowchart and
spreadsheet views (otherwise, only get view for active
Arena and other applications (when sensible) module type)
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 5 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 6 of 70
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 15 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 16 of 70
Editing Flowchart Modules in
Create Flowchart Module (cont’d.)
Spreadsheet View
• Name – for module (type it in, overriding default) • Alternative to dialog for each instance of a
• Entity Type – enter descriptive name module type
Can have multiple Entity Types with distinct names • See all instances of a module type at once
• Time Between Arrivals area Convenient for seeing, editing many things at once
Specify nature of time separating consecutive arrivals
Type – pull-down list, several options
• Selecting a module in either flowchart or
Value – depends on Type … for Random (Expo) is mean
spreadsheet view also selects it in the other view
Units – time units for Value • Click, double-click fields to view, edit
• Entities per Arrival – constant, random variable, • Right-click in row to Edit via Dialog, define user
very general “Expression” (more later …) Data Tip (via Properties)
• Max Arrivals – choke off arrivals (from here) after • Right-click in expression fields to get Expression
this many arrivals (batches, not entities) Builder for help in constructing complex
• First Creation – time of first arrival (need not be 0) expressions with Arena variables (more later …)
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 17 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 18 of 70
• Our only edit – Initial Picture for animation • Enter Name – Drilling Center
Picked Picture.Blue Ball from default list • Type – picked Standard to define logic here
Menu option Edit > Entity Pictures ... to see, modify rather than in a submodel (more later …)
• Report Statistics check box at bottom
To get utilizations, queue lengths, queue waiting times, etc.
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 19 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 20 of 70
Process Flowchart Module (cont’d.) Process Flowchart Module (cont’d.)
• Logic area – what happens to entities here • Delay Type – choice of probability distributions,
Action constant or general Expression (more later …)
– Seize Delay Release – entity Seizes some number of units of a Resource
(maybe after a wait in queue), Delay itself there for processing time, then
• Units – time units for delay (don’t ignore)
Release units of Resource it had Seized – chose this option
Delay entity (red traffic light) – no Resources or queueing, just sit here for a time duration
• Allocation – how to “charge” delay in costing
Seize Delay (no Release … presumably Release downstream) (more later …)
Delay Release (if Resource had been Seized upstream)
– Priority for seizing – lower numbers ⇒ higher priority • Prompts on next line – change depending on
– Different Action choices could allow stringing together several Process choice of Delay Type – specify numerical
modules for modeling flexibility
parameters involved
Resources – define Resource(s) to be seized, released
– Double-click on row to open subdialog • Can also edit in spreadsheet view
– Define Resource Name, Quantity of units to be Seized/Released here Subdialogs (e.g., Resource here) become secondary
Not where you say there are multiple Resource units ... do that in Resource data module
spreadsheets that pop up, must be closed
– Several Resources present (Add) – entities must first Seize all
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 21 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 22 of 70
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 23 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 24 of 70
Animating Resources and Queues Dispose Flowchart Module
• Got queue animation automatically by • Represents entities leaving model boundaries
specifying a Seize in Process module • Name the module
Entity pictures (blue balls) line up here in animation • Decide on Record Entity Statistics (average,
• Don’t get Resource animation automatically maximum time in system of entities exiting here,
To add it, use Resource button in Animate toolbar … get costing information)
Resource Picture Placement dialog Check boxes for statistics collection and reporting:
– Identifier – link to Resource name in pull-down list Most are checked (turned on) by default
– Specify different pictures for Idle, Busy states Little or no modeling effort to say yes to these
For pre-defined “art” work, Open a picture library (.plb filename extension) But in some models can slow execution markedly
Moral – if you have speed problems, clear these if you don’t care
Scroll up/down on right, select (single-click) a picture on right, select Idle or Busy
state on left, then to copy picture
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 25 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 26 of 70
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 31 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 32 of 70
Running It Viewing Reports
• Plain-vanilla run: Click from Standard toolbar • Click Yes in Arena box at end of run
(like audio/video players) Opens new reports window (separate from model window)
First time or after changes: Check inside Arena window
Enters run mode — can move around but not edit Project Bar shows Reports panel, different reports (each
Speed up or slow down animation display via slider bar one would be a new window)
– Or tap > on keyboard to speed up, < to slow down Remember to close all reports windows before future runs
When done, asked if you want to see summary reports • Default installation shows Category Overview
Click to get out of run mode (can’t edit until you do) report – summarizes many things about run
Can pause run with or Esc key Reports have “pages” to browse ( and )
• Other run control, viewing, checking options Also, “table contents” tree at left for quick jumps via ,
• Times are in Base Time Units for model
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 33 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 34 of 70
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 51 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 52 of 70
View Menu View Menu (cont’d.)
• Zooming – discussed before • Split Screen – if checked, shows both flowchart,
Zoom Factor – step size when zooming spreadsheet views
• Views – canned Arena views of flowchart view • Runtime Elements Bar – if checked, displays
• Named Views – define, change, use views window allowing choice of what is displayed
during execution
• Rulers, Grid, Guides, Snap, Glue – align objects
Page breaks – shows page breaks if printed • Toolbars – decide which toolbars show up
• Data Tips – toggles display of Data Tips • Project/Status Bar – toggle to show up or not
• Connector Arrows – show entity-flow direction • Debug Bar – if checked, displays window of
debugging tools during run
• Layers – which objects show up in which mode
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 53 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 54 of 70
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 59 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 60 of 70
Help Menu Help Menu (cont’d.)
• One of several ways to get into Help system • Arena Product Manuals – detailed PDF reference
• Arena Help – TOC, Index, Search documents on Arena components
• What’s This? – adds ? to cursor, then click on • Activation – for licensing
things for brief description • Copy protection information for commercial,
• Release notes – recent changes, requirements research, and lab versions
• Arena Smart Files – subject-based index to many • About Arena... – version number, licensing
small but complete models that illustrate specific information, etc.
modeling techniques (very useful)
• List of attached modeling panels – select to get
Help on that one
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 61 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 62 of 70
• View > Toolbars (or right-click in a toolbar area) • Box, Polygon, Ellipse (fill, line, shade)
to decide which ones show up, which to hide • Text (font, size, style)
• Toolbars can be torn off (“floating” palettes), or • Colors for Lines, Fill, Text, Window Background
“docked” to an edge of screen
• Arena remembers Toolbars for next time • Line Width, Style, Arrow Style, Pattern
• View > Toolbars > Customize to alter how • Show Dimensions – shows sizes, lengths for
toolbars and buttons are displayed precise drawing
• See text for run-through description of toolbars • Best way to learn: play around on scratch model
and buttons (or, just experiment)
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 63 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 64 of 70
Printing Help!
• Print all or parts of flowchart view of active model • Extensive, comprehensive online system –
window – supports color including complete (electronic) manuals
• Usual Print, Print Preview, Print Setup (File menu) • Interlinked via hypertext for cross referencing
• Could consume many pages … also prints named
views separately • Multiple entry points, including Help menu
Print Preview, select only what you want for printing (described above), links to websites
• View > Page Breaks to show how pages will break • button for context-sensitive help
• Alternative to printing from Arena: Windows Click it, then click what you’re curious about
Snipping Tool or PrintScreen key – sends screen • button in most dialogs
to clipboard, paste into another application
Alt+PrintScreen – sends only active window to clipboard • button (What’s This?) in dialogs for info on
Could first pass through a paint application to crop, etc. things in that dialog
Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 65 of 70 Simulation with Arena, 6th ed. Chapter 3 – A Guided Tour Through Arena Slide 66 of 70
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 1 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 2 of 68
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 5 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 6 of 68
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 11 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 12 of 68
Part B Attributes Assign Module Prep A Process Module
• Name: Assign Part B Sealer and Arrive Time • Name: Prep A Process
• Add button: • Action: Seize Delay Release
Type: Attribute • Resources subdialog (Add button):
Attribute Name: Sealer Time Type: Resource (a pull-down option) If several Resources
were named (Add
New Value: WEIB(2.5, 5.3) Resource Name: Prep A button), entity would
have to Seize them all
• Add button: Quantity: 1 (default) before Delay could start.
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 15 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 16 of 68
Sealer Inspection-Result Decide Module Rework Process Module
• Decide module provides branch points • Name: Rework Process
By Condition (entity Attributes, global Variables) • Action: Seize Delay Release
By Chance (multi-sided, possibly-biased hypercoin flip) • Resources subdialog (Add button):
• Name: Failed Sealer Inspection Type: Resource (a pull-down option)
• Type: 2-way by Chance (default) Resource Name: Rework
• Percent True: 9 Quantity: 1 (default)
• Different exit points for True, False results – • Delay Type: Expression
connect appropriately downstream • Units: Minutes
− Note it’s percent true, not probability of true … so “9” means probability of 0.09 • Expression: EXPO(45) Had to use general Expression choice for
− We arbitrarily decided “true” meant part failed inspection … could have reversed (but would Delay Type since what we want (EXPO) is
change numerical results ... why? ... does this upset you? ... why?) not directly on Delay Type pull-down list.
− This is a rich, deep, versatile module … explore its Help button
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 17 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 18 of 68
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 19 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 20 of 68
Shipped Parts Record Module Dispose Modules
• Name: Record Shipped Parts • Three separate exit points for three separate part
• Type: Time Interval disposition (Shipped, Salvaged, Scrapped)
Records time elapsed up to now (TNOW) from when an • Could have directed all three exit types to a
entity attribute was marked with a time “stamp” upstream ...
Attribute Name is below ... single Dispose module
There are several other options for Type … explore via Separate ones gets animation counts of three dispositions
Record module’s Help button! Separate Dispose modules allows for differentially checking
• Attribute Name: Arrive Time boxes to Record Entity Statistics
Was defined upstream as clock value in Assign modules – Produces flow statistics separated by entity type (if Entities
Statistics Collection is checked in Run > Setup > Project
instantly after each entity was Created
Parameters), not by final disposition of part … so we did need our
• Tally Name: Record Shipped Parts Record modules and Arrive Time attribute
Determines label in reports Other two Record modules –
just like this except for Name
and Tally Name.
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 21 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 22 of 68
Run > Setup for Run Control Different Part A, B Entity Pictures
• Without this, model would run forever – no • Entity data module (just single-click on it in
defaults for termination rule Project Bar, edit via spreadsheet only)
That’s part of modeling, and generally affects results!
• Row for each Entity Type (Part A, Part B)
• Project Parameters tab:
Fill in Project Title, Analyst Name
• Pull down Initial Picture pull-down menu, select
Defaults for Statistics Collection, but we cleared check box
different pictures for each Entity Type
for Entities Edit > Entity Pictures to see, change list of pictures that’s
– Not needed for what we want (we installed our own Record presented here … more later
modules), and would slow execution
• Replication Parameters tab:
Replication length: 32, accept Hours default for Time Units
Base Time Units: Minutes for inputs without Time Units
option, internal arithmetic, and units on output reports
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 23 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 24 of 68
Running Model Viewing Results
• Check (if desired) • Counters during animation for modules
Find button to help find errors Create, Dispose, Decide – incremented when entity leaves
• Go (will automatically pre-Check if needed) Process – number of entities currently in module
Some graphics don’t show during run … will return when • Asked at end if you want to see reports
you End your run … control via View > Layers What you get depends on Run > Setup > Project Parameters
Status Bar shows run progress – replication number, – Looks like Rework area is bottleneck ... more later
simulation time, simulation status
Navigate through report with browsing arrows, tree at left
• Animation speed Tally, Time-Persistent, and Counter statistics
Slider bar at top, or increase (> key), decrease (< key) Avg, Min, Max, and 95% Confidence Interval half-widths
• Pause ( ) or Esc key; to resume – Confidence intervals are for steady-state expectations … Chapter 7
• Run > Step ( ) to debug – May not be produced if run is not long enough for reliable stats
• Run > Fast-Forward ( ) to turn off animation • Generally difficult/unreliable to draw conclusions
Run > Run Control > Batch Run (No Animation) is fastest from just one run … more later
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 25 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 26 of 68
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 31 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 32 of 68
Resource Failures (cont’d.) Frequencies
• Attach this Failure to correct Resource • Record time-persistent occurrence frequency of
Resource module, Failures column, Sealer row – click variable, expression, or resource state
Get pop-up Failures window, pick Failure Name Sealer Use here to record % of time rework queue is of length 0,
Failure from pull-down list (0, 10], (10, 20], … for info on number of racks needed
Choose Failure Rule from Wait, Ignore, Preempt (as in • Statistic data module (Advanced Process panel)
Schedules)
Five Types of statistics, of which Frequencies is one
• Can have multiple Failures (separate names) Specify Name (Rework Queue Stats),
acting on a resource Frequency Type (Value)
• Can re-use defined Failures for multiple Specify Expression to track and categorize
Resources (operate independently if they involve – Right-click in field to get to Expression Builder
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 35 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 36 of 68
Utilizations – Fine Points Model 4-3: Enhancing the Animation
• Two utilizations reported for each Resource • Get “Spartan” generic default animation for some
Instantaneous Utilization is time-average of ratio of number things (queues, connector-animation movement)
of units that are busy to number of units that are scheduled
– By definition, counts periods when zero units are scheduled as Usually sufficient for verification, validation
zero-utilization periods
• Often want to customize, enhance it a bit
Scheduled Utilization is average number busy divided by
average number available More realism, impact
– No division-by-zero problem, assuming there were ever any units of
Resource scheduled at all (if not, it shouldn’t be in model)
• Pull animation away from logic in model window
Useful for big models, complex animation
• Identical for fixed-capacity Resource
Named Views for model logic, animation, or close-ups
• Can differ for Resources on a variable Schedule
If Resource capacity varies among several different positive • Default animation objects are connected to model
values, it’s better to use Scheduled Utilization logic and move with the module
More issues, even finer points – see text Identifiers, physical location (Shift-drag to decouple)
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 37 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 38 of 68
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 47 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 48 of 68
Altering Animation – Routes Altering Animation – Entity Pictures
• Route button from Animate Transfer toolbar • Part B arrivals are in batches of four parts/batch
Options for appearance of entities as they travel route But constant travel time to Prep B implies they travel “on
Get cross hairs; click in origin, destination Station Markers top of each other” so it looks like just one part B
– Intermediate clicks for corners along route Try – change Route time from 2 to EXPO(2), see
Can drag around endpoints, corners later separation along route
Alternatively, use Route animation to create both Station • Create a dishonest illusion to animate batch
markers and Route animation Assign module just after Part B Arrive
– Click for beginning Station marker Add assignment of Entity Picture to Picture.Batch B
– Intermediate clicks for route corners
Edit > Entity Pictures to draw new picture
– Double-click for ending Station marker
– Copy Picture.Part B and rename it Picture.Batch B
– Then go back and double-click on the two Station markers to define
their logical Identifiers – Double-click on picture, use Picture Editor to get four circles
When batch arrives to Prep B, change to single circle
– Add Assign module after Prep B Arrival Station
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 49 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 50 of 68
Finding and Fixing Model Errors Finding and Fixing Model Errors (cont’d.)
• If error prevents model from running, Arena will • Module Break – stop when entity reaches module
try to detect and lead you to it in Check or Run • Debug Bar
Undefined (or inconsistently spelled) Variables, Attributes, View > Debug Bar
Resources
Breakpoints, Calendar, Active Entity, Watch
Unconnected modules
Run Controller
Duplicate names
Examples – see text
Examples – see text
• Highlight Active Module – selects active module
during run animation
• View > Layers while running – change what
shows during run animation
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 51 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 52 of 68
Input Analysis: Specifying Model
Deterministic vs. Random Inputs
Parameters, Distributions
• Structural modeling: what we’ve done so far • Deterministic: nonrandom, fixed values
Logical aspects – entities, resources, paths, etc. Number of units of a resource
• Quantitative modeling Entity transfer time (?)
Numerical, distributional specifications Interarrival, processing times (?)
Like structural modeling, need to observe system’s • Random (a.k.a. stochastic): model as a
operation, take data if possible distribution, “draw” or “generate” values from to
drive simulation
Transfer, Interarrival, Processing times
What distribution? What distributional parameters?
Causes simulation output to be random, too
• Don’t just assume randomness away – validity
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 53 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 54 of 68
Using Data:
Collecting Data
Alternatives and Issues
• Generally hard, expensive, frustrating, boring • Use data “directly” in simulation
System might not exist Read actual observed values to drive model inputs
(interarrivals, service times, part types, …)
Data available on wrong things – might have to change – Arena ReadWrite module ... see Model 10-2
model according to what’s available All values will be “legal” and realistic
Incomplete, “dirty” data But can never go outside your observed data
Too much data (!) May not have enough data for long or many runs
• Sensitivity of outputs to uncertainty in inputs Computationally slow (reading disk files)
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 57 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 58 of 68
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 63 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 64 of 68
Cautions on Using Normal Distributions Nonstationary Arrival Processes
• Probably most familiar distribution – normal “bell • Events (often arrivals), rate varies over time
curve” used widely in statistical inference Lunchtime at fast-food restaurants
• But it has infinite tails in both directions … in Rush-hour traffic in cities
particular, has an infinite left tail so can always Telephone call centers
(theoretically) generate negative values
Seasonal demands for a manufactured product
Many simulation input quantities (e.g., time durations) must
be positive to make sense – Arena truncates negatives to 0 • It can be critical to model nonstationarity for
• If mean µ is big relative to standard deviation σ, model validity
then P(negative) value is small … one in a million Ignoring peaks, valleys can mask important behavior
But in simulation, one in a million can happen Can miss rush hours, etc.
See text, Model 4-5 • Good model: Nonstationary Poisson process
• Moral – avoid normal as input distribution
Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 65 of 68 Simulation with Arena, 6th ed. Chapter 4 – Modeling Basic Operations and Inputs Slide 66 of 68
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Setup (cont’d.) Modeling Panels
• Output performance measures • Basic Process
Number of calls attempted, rejected, completed Highest, fastest modeling level, usually the place to start
By call type – total time in system • Advanced Process
By resource – time on hold, number of calls on hold Smaller building elements, other functions, more detail
Resource utilization – of personnel, trunk lines • Advanced Transfer
• Terminating or steady-state Entity movement, material handling
Time frame of interest for each replication • Blocks, Elements
– Terminating – specific starting, stopping conditions (this model) Lowest modeling level, SIMAN simulation language
Stopping conditions could be of several forms – fixed time, count, condition (here) Repeats some capabilities of higher-level panels
– Steady-state – output performance measures are a limit as Some functions available only here
simulated time → ∞
– Choice usually depends on intent of study, not on model logic
• Other special-purpose panels
License-dependent
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 7 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 8 of 51
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Data Structure Arrivals, Direct to Service
• Re-use data in several places • Create attempted calls
Define once, global to whole model Entity type Incoming Call, change later
Redefine once – modeling generality, user efficiency Max Arrivals = MaxCalls, Variable initialized to 999999
At 6pm (time 600 minutes) change this to 1 to stop arrivals ... later
• Arena (global) Variables –
Entities per Arrival = CallsPerArrival, Variable
Store numbers (not formulas) initialized to 1
Define, initialize in Variable data module (Basic Process) – At 6pm (time 600 minutes) change this to 0 to kill arrivals ... later
Can change during run (Assign module, other ways) • Entity data module
Scalar, 1-d array (vector), 2-d array (matrix) Incoming Call Entity Type already there
• Arena (global) Expressions For Initial Picture, select Picture.Black Ball
Store formulas (as well as numbers, but can’t change) • Record module for an attempted call
– Use math ops, numbers, random variates, Attributes, Variables, ... Add 1 to Counter Name Attempted Calls
Define in Expression data module (Advanced Process) Results – Category Overview report, User Specified
Scalar, 1-d array (vector), 2-d array (matrix) More detailed description – mouse over modules, read Data Tips that pop up
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 9 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 10 of 51
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Arrivals, Direct to Service (cont’d.) Arrivals, Direct to Service (cont’d.)
• Decide module – Trunk Line Available? • Decide module – Determine Call Type
Type = 2-way by Condition Alternate strategy –
Queue module from
Three-sided coin flip – Type = N-way by Chance
– Select (logical) Expression for “If”
NR() is number of units of that resource that are busy now Blocks panel ... – Add button for more sides of coin
details in text
MR() is number of units of that resource that exist now – Get new exit point for each Add, plus one for Else
False – Record rejected call counter, Dispose – Note that probabilities are entered as percentages (0-100, not 0-1)
True:
– Last entry is “else”
– Seize a unit of Trunk Line Resource – Release later
Resources data module for Trunk Line and other Resource levels • Direct call to one of tech support, sales, or order-
– Increment Variable Total WIP for number of active calls
Used in stopping rule at or after 6pm to sense if system is empty
status areas
– Store module to animate entity during next Delay module Backed each area with colored box
Alternative way to organize – Submodels
Add Storage animation separately, identify with this logical storage by name
Storage data module – entry made there by Store module
– Delay module to listen to initial recording, make selection
Could have used Process module, but this is simpler, faster
– Unstore module to make entity animation disappear
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 11 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 12 of 51
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Tech-Support Calls Sales Calls
• Assign module • Assign module – change Entity Type, Picture
Change Entity Type for separating out in results • Process module
Change Entity Picture for animation
Seize-Delay-Release
• Store – Delay – Unstore for recording, product
type selection Seize a unit of Sales Resource
• Decide module for product type • Sales calls priority over order-status calls that
Different three-sided coin flip seek a person?
Direct to appropriate Process module for that product type Queue data module, Process Sales Call.Queue
• Process modules for tech-support service – Type = Lowest Attribute Value Not the only
Attribute Name = Sales Call Priority way to do this
Seize-Delay-Release Undefined for sales calls, so has value 0 ... will set to 1 for order-status calls that
Seize a unit from appropriate multi-unit Resource seek a person, putting sales calls ahead in the queue
Use Tech Time defined in Expression data module – Shared queue (with order-status calls seeking a person)
• Proceed to system exit logic ... later • Proceed to system-exit logic
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 13 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 14 of 51
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Order-Status Calls System Exit
• Assign module – change Entity Type, Picture • All calls of all types come here when finished
• Delay block (Blocks panel) for robo-chat • Release module – release the unit of Trunk Line
Includes Store/Unstore logic – alternative to earlier method
– No automatic entry in Storage data module, so must enter manually
resource seized upstream
• Decide module • Assign module – decrement Total WIP variable
No sales person required – go directly to system-exit logic • Record module – increment Completed Calls
Sales person required: counter
– Assign module – set Sales Call Priority Attribute to 1 so
these will have lower priority than real sales calls • Dispose of call
– Seize module for a unit of Sales resource
Define Queue Name = Process Sales Call.Queue – shared with sales calls
Process module does not allow for specifying a shared queue, so can’t use here
– Delay for conversation with sales person
– Release the unit of Sales resource
• Proceed to system-exit logic
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 15 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 16 of 51
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Arrival-Cutoff Logic Run > Setup
• Used to “choke off” arrival stream at 6pm • Replication Parameters tab (other tabs as usual)
• Create a single logical (or “fake”) entity at time • Base Time Units = Minutes
600 min. (6pm) • Replication Length = Infinite (the default)
Overkill on making sure just one is created
– Time Between Arrivals = 999999 min., Max Arrivals = 1 • Terminating Condition field:
• Assign module to set Variable MaxCalls to 1 TNOW >= 600.0 && Total WIP == 0
Recall use of MaxCalls for Max Arrivals in Create module Arena Greater than Logical Variable we Equality
for attempted calls Creative use of such clock or equal to 600 “and” maintained test for
Variable minutes, (6pm) in model zero
• Also in this Assign module, set “logical” (a.k.a. “fake”)
entities enhances modeling Base Time Units
CallsPerArrival to 0 flexibility, power, detail It’s 6pm or later and there are no calls in the system.
Since Create module will always schedule next arrival, and
Could have used NR(Trunk Line)
this makes the “size” of the next illegal arrival zero instead of Total WIP
• Dispose of this single logical entity
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 17 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 18 of 51
Model 5-1: Simple Call Center Model 5-1: Simple Call Center
Animation Animation (cont’d.)
• Place three Storage animations • Variable animations for WIP at tech calls, sales
Initial Recording Delay, Tech Call Recording Delay, Order For tech calls, Arena variable to animate is
Status Delay Process Product Type 1 Tech Call.WIP, etc. –
Select proper Identifier in each from pull-down list pull-down list
Graphic behaves like Queue animations For sales calls, must include order-status calls seeking a
real person:
• Four Queue animations
NR(Sales) + NQ(Process Sales Call.Queue)
Three tech-support call product types, sales
Came with four Process modules specifying Seize
• Plot number of trunk lines busy,
NR(Trunk Line)
• Resource animations for three tech-support
types, sales Resources • Labeling, background boxes as in model logic
Multi-unit Resource animations, as in Models 4-3, 4-4
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 19 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 20 of 51
Model 5-1: Simple Call Center Model 5-2: Enhanced Call Center
Results (one replication ... sample of size only one!!) Changes
• Trunk-lines-busy plot • Incoming calls’ arrival rate varies over day
Starts, ends at 0 – startup, termination logic Probabilistic model – Nonstationary Poisson process
Capped at 26 during run – More in Section 12.3
• 734 attempted calls (User Specified section) Instead of a constant rate (= 1 / mean interarrival time),
specify a rate function
643 of them completed, the other 91 rejected
– Arena supports piecewise-constant rate function – “step” functions
• Sometimes see mixture of sales (green), order- Easy to specify, strong theoretical support In Arena, rates MUST be
entered in arrivals per
status (blue) entities in sales queue – Rate-function specification:
HOUR, regardless of
model’s Base Time Units or
• Other “usual” outputs Caution – it’s
easy to time intervals
generate this
Times in system – separated out by call type incorrectly ...
Queue lengths, times in queue – separated out by resource see text for
details
Resource utilizations – normalized to [0, 1] by capacity
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 21 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 22 of 51
Model 5-2: Enhanced Call Center Model 5-2: Enhanced Call Center
Changes (cont’d.) Changes (cont’d.)
• Sales-staff size varies over day • 4% of tech-support calls cannot be handled
Data in text, Schedule data module, Sales Schedule during the call, need offline back-office research
• Tech-support staff are partially cross-trained, Original call ends, same original talk-time distribution, gives
work complicated schedule: up its trunk line, but not counted (yet) as completed
Case sent to back office (outside model boundaries), takes
EXPO (60) minutes to resolve
– Offline research may be carried over night, completed on a later day
Will use Arena Answer goes back to same tech-support person who took
Sets concept to
implement this
original call, with higher priority than incoming calls, but still
cross training might have to queue for this person
This tech-support person requests a trunk line for outgoing
call, higher priority than incoming calls, but still might have
to queue, talks for TRIA (2 ,4 ,9) min., call is now completed
Track number of each product type after research is done
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 23 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 24 of 51
Model 5-2: Enhanced Call Center Model 5-2: Enhanced Call Center
Data Structure Data Structure (cont’d.)
• Resources, Schedules • Sets – collect same-type items together
Resource, Schedule data modules Set, Advanced Set data modules (Basic, Advanced
Trunk Line – fixed capacity at 26 Process panels, resp.)
– Refer to items in set by original name, or index (subscript) in set
Sales – on Schedule Sales Schedule
Resource set for each tech-support product type
11 individual tech-support people on individual schedules – Members are those tech-support resources qualified
– Caution – must fill out each schedule to all 22 half-hour periods, – Individual resources already defined – Resource data module
with leading/trailing 0’s if necessary ... use Edit via Dialog or
– Overlapping membership – some resources in multiple sets
Spreadsheet, not graphical schedule editor
– Sets are ordered – here, put most versatile tech-support people at
– Ignore option to avoid shifting back schedule over multiple days bottom, to “save” them for other calls ... Preferred Order in Seize
– Include costing data for people in Resource data module – Will Seize from a set in model
Define nonstationary arrival-rate function in Schedule Counter set – one for each hour
module – Arrival Schedule – Count number of rejected calls in each hour
– Enter trailing 0’s in Edit via Dialog or Spreadsheet, not graphical – Individual counters already defined – Statistic data module
schedule editor – Use results later to decide when to increase staffing
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 25 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 26 of 51
Model 5-2: Enhanced Call Center Model 5-2: Enhanced Call Center
Modifying the Model Modifying the Model (cont’d.)
• Call-arrivals, termination, Run > Setup • Tech-support calls
Create module Same through Determine Product Type Decide
– Type = Schedule, Schedule Name = Arrival Schedule
Add Assign modules for each product type thereafter
Delete the entire arrival-cutoff section from Model 5-1 – Entity Type to distinguish product type in reports
– Arrival Schedule cuts off arrivals at 6pm, via 0 rate – Entity Picture to distinguish product type in animation
Delete Total WIP variable used to terminate Model 5-1 – Attribute Tech Call Type (1, 2, or 3 by product type) for routing
– Use built-in NR(Trunk Line) instead in Terminating Condition Process modules, Resources subdialogs
– Delete Assign modules used to manage Total WIP
– Type = Set
Record module for rejected calls – Set Name = Product 1, etc.
– Index into Counter Set Rejected Calls with index – Selection Rule = Preferred Order, to select earlier entries in set first
AINT((TNOW/60) + 1) Recall – we put more versatile tech-support people lower in the set list
which is 1 for first hour, 2 for second hour, etc. (AINT truncates – Save Attribute = Tech Agent Index
decimals toward zero) Entity attribute, carried along, in case of back-office research to send back to this
same tech-support person for return call
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 27 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 28 of 51
Model 5-2: Enhanced Call Center Model 5-2: Enhanced Call Center
Modifying the Model (cont’d.) Modifying the Model (cont’d.)
• Back office, returned tech-support calls – all new • Statistic data module
Entry via True branch (4%) in Decide module Ten Counter-type statistics, discussed earlier
Backoffice Research and Return Call?
Release this call’s trunk line – going offline now Four Time-Persistent statistics to track expressions
– Backoffice Research WIP to track total number of cases in
Delay (with storage) for EXPO (60) back-office research research, via NSTO(Backoffice Research Storage)
Increment Tech Return WIP(Tech Call Type) – Tech 1 Total Online WIP Stat, etc., to track number of that
– 1-dim. Variable array – defined in Variable data module product type in back office via Expression Tech 1 Total Online
– Tech Call Type is 1, 2, or 3, assigned in earlier Assign module WIP, etc., defined in Expression data module as
Decide module Product Type? based on Entity Type Process Product Type 1 Tech Call.WIP + Tech Return WIP(1), etc.
Seize the same tech-support person – higher priority
• No changes needed in sales-calls or order-status-
Then seize a trunk line (higher priority), make return call
calls section of Model 5-1
Then release this trunk line, tech-support person
Decrement Tech Return WIP(Tech Call Type)
Send entity to final Record, after trunk-line release there
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 29 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 30 of 51
Model 5-2: Enhanced Call Center Model 5-3: Overall Call-Center Stats
Modifying the Model (cont’d.) Setup
• Animation • Develop overall operational-cost measure
Delete Tech 1, Tech 2, and Tech 3 resource animations Two cost categories – staffing/resource, and poor service
Change variables in three tech-support WIP displays to • Develop overall measure of service, % of calls
track total number of tech-support calls of that type present
rejected
New back-office storage animation, variable animation for
number present • Add options for increased staffing, improvement
A new queue for each tech-support product type for return • Make 5 replications, focus on weekly costs
calls waiting for service IID replications, so will not carry over back-office research
Added a resource animation (from a .plb library) for each
individual tech-support person
– Grouped by product type, colors for capabilities
• Results
Most rejected calls in hours 5-8 ... increase staff then ... ?
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 31 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 32 of 51
Model 5-3: Overall Call-Center Stats Model 5-3: Overall Call-Center Stats
Staffing/Resource Costs Staffing/Resource Costs (cont’d.)
• Resource data module – hourly costs for people • Increase sales, tech-support staff noon-4pm
$20/hr. for each sales staffer Variable New Sales = number of new sales staff
$18/hr. – $20/hr. for each tech-support, depending on skill – $17/hr., 4 hrs./day, 5 days/week, so $340/week for each add’l. staff
– Schedule data module to add capacity – edit via dialog or
These salary costs paid when on duty, busy or idle
spreadsheet, not graphical editor
Summing, get $12,820/week (details in text) – Resource (Sales) already exists in Resource data module
View all this existing staff as fixed Variables New Tech 1, etc., and New Tech All for
number of new tech-support people qualified as named
– $16/hr. for each one-product staff, $18/hr. for each all-product staff
$320/week for each single-product staff, $360/week for each all-product staff
– New entries in Resource data module
Larry, Moe, Curly, Hermann for 1, 2, 3, All, resp.
– Schedule data module to add capacity – dialog or spreadsheet edit
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 33 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 34 of 51
Model 5-3: Overall Call-Center Stats Model 5-3: Overall Call-Center Stats
Staffing/Resource Costs (cont’d.) Customer-Dissatisfaction Costs
• Maybe increase number of trunk lines beyond 26 • Incur cost for caller wait on hold, past a threshold
$98/week flat fee for each trunk line 3 min. for tech, 1 min. for sales, 2 min. for order-status
• Define Expression New Res Cost for all resource Beyond threshold, incur per-min. costs of
$0.368 for tech, $0.818 for sales, $0.346 for order-status
costs: – In practice, such costs are difficult to estimate
New Sales*340 Three new Assign modules (orange backing) accumulate
+ (New Tech 1 + New Tech 2 + New Tech 3)*320 “excess” (beyond threshold) wait times on hold
+ New Tech All*360 – Tech support (other two are similar): Variable
+ 98*MR(Trunk Line) Excess Tech Wait Time increased by
MAX(ENTITY.WAITTIME - 3, 0)
This does not depend on simulation results, only on setup ENTITY.WAITTIME is built-in Arena attribute holding all wait times (including in
queues) so far ... luckily, there were none before the preceding Process module
At end, multiply excess wait times by per-min. costs,
multiplied by 5 (to put on a weekly basis)
5 × $0.368 = $1.84 for tech, 5 × $0.818 = $4.09 for sales,
5 × $0.346 = $1.73 for order-status
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 35 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 36 of 51
Model 5-3: Overall Call-Center Stats Model 5-3: Overall Call-Center Stats
Overall Output Performance Measures Replication Conditions
• Statistic data module, Total Cost entry • Run > Setup > Replication Parameters,
Type = Output, computed only at end of replication Initialize Between Replications
New Res Cost Statistics? System? Details in text
+ Excess Sales Wait Time * 4.09
+ Excess Status Wait Time * 1.73 Default is both – only way to get truly IID replications
+ Excess Tech Wait Time * 1.84 – Destroys overnight tech-support research jobs, but to do otherwise
would complicate model – so accept
+ 12820
• Statistic data module, Percent Rejected entry • Run > Setup > Project Parameters
Counter Total Rejected Calls accumulated in new Turned off all but Costing Statistics Collection, for speed
Record module in call-arrival area (orange backing) – Costing required to get ENTITY.WAITTIME
– Already accumulating hour by hour, but this is total over the day
Type = Output
100 * NC(Total Rejected Calls) / NC(Attempted Calls)
– NC is Arena function that returns the value of that counter
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 37 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 38 of 51
Model 5-3: Overall Call-Center Stats Model 5-4: (s, S) Inventory Simulation
Results Setup
• Results from five replications • Different kind of model – not queueing
Base Case – no additional staff, still 26 trunk lines • Use Blocks and Elements panels exclusively –
Total Cost = $22,242.55 ± $1,439.47 Avg. over 5 replications SIMAN simulation language
95% Conf. int. half-widths
Percent Rejected = 11.96% ± 1.39% Mostly just to demonstrate this capability
Add 3 of each of five staff types, 3 more trunk lines Could be done with higher-level panels we’ve been using
Total Cost = $23,683.35 ± $616.00 Is this “better?” (Exercise 5-17)
Percent Rejected = 1.61% ± 1.52% • Company carries a single discrete item (widgets)
• Use in Chapt. 6 for statistically valid experiments in inventory
Statistical precision • I(t) = inventory level (an integer) at time t days
Compare several alternatives, select best past the beginning of the simulation; I(0) = 60
Search for configuration that minimizes cost, subject to
upper limit on percent rejected • Run simulation for 120 round-the-clock days
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 39 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 40 of 51
Model 5-4: (s, S) Inventory Simulation Model 5-4: (s, S) Inventory Simulation
Customer Demands Against Inventory Inventory Review, Replenishment
• Customer interarrival times ~ EXPO (0.1) day • “Take inventory” just past midnight each day
(round the clock) So at exactly times 0, 1, 2, ..., 119 (not 120 ... see below)
First arrival not at time 0 but after an interarrival time past 0
Two managerially-chosen constant integers s = 20 and
• Demand size is discrete random variable S = 40 (must have s < S if we change these values)
1, 2, 3, 4 with respective probabilities If I(t) ≥ s, do nothing until next inventory evaluation exactly
0.167, 0.333, 0.333, 0.167
24 hours later
• If enough items are physically on hand in If I(t) < s, order S – I(t) items from supplier (order “up to” S)
inventory to satisfy a demand, customer gets
demand and leaves Order does not arrive instantly from supplier, but after a
delivery lag (a.k.a. lead time) ~ UNIF(0.5, 1.0) day, so
• If demand > number of items on hand, customer sometime during the last half of the day of ordering
gets whatever is there and the rest of the demand – In the meantime, inventory level could fall further from additional
is backlogged (I(t) becomes negative) demands, so inventory level will not necessarily pop up to S when
If I(t) was already negative, it just goes more negative the order arrives, but to something less than S
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 41 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 42 of 51
Model 5-4: (s, S) Inventory Simulation Model 5-4: (s, S) Inventory Simulation
Cost Structure Cost Structure (cont’d.)
• Average ordering cost per day • During periods when I(t) = 0 there’s neither
When an order is placed, incur a fixed cost of $32, plus an holding nor shortage cost incurred
incremental cost of $3 per item ordered
If no order is placed at the beginning of a day, there’s no
• Overall performance measure
ordering cost, not even the fixed cost = Average total cost per day
At end of simulation, divide total of ordering costs by 120 = sum of average ordering, holding, and
• Average holding cost per day shortage costs per day
Whenever I(t) > 0, incur $1 per day per item on hand • Don’t evaluate inventory at time 120
Average holding cost = We might order and incur an ordering cost then, but order
will never arrive
• Average shortage cost per day
We’ll fudge this, but an Exercise asks you to do it right
Whenever I(t) < 0, incur $5 per day per item in backlog
Average shortage cost =
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 43 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 44 of 51
Model 5-4: (s, S) Inventory Simulation Model 5-4: (s, S) Inventory Simulation
Data Structure Data Structure (cont’d.)
• Use Blocks, Elements panels exclusively • Expressions element
Even for Variables, Expressions, Attributes, Entities,
statistics collection, and run control Define Interdemand Time, Demand Size, Evaluation
• Variables Element (initialized, or default to 0 Interval, Delivery Lag
initially) – Cumulative probabilities in DISC function for Demand Size
Inventory Level = I(t), changes during run, initialized
to 60
• Attributes, Entities elements
Little s = s = 20 Just to define these objects
Big S = S = 40 • Project, Replicate elements
Total Ordering Cost accumulator
Similar to Run > Setup
Setup Cost = 32
Incremental Cost = 3 • DStats element
Unit Holding Cost = 1 Request accumulation of integrals for total holding,
Unit Shortage Cost = 5 shortage costs
Days to Run = 119.9999 (The Fudge)
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 45 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 46 of 51
Model 5-4: (s, S) Inventory Simulation Model 5-4: (s, S) Inventory Simulation
Data Structure (cont’d.) Logic for Customer Demands
• Outputs element • Create block for arrival
Two entries, both of Data type “Output” so that they’re Entity Type is Customer
executed only at end of run, and reported Uses Interdemand Time Expression
Avg Ordering Cost computed First Creation after an Interdemand Time
Avg Total Cost added up • Assign block to decrement Inventory Level by
– OVALUE returns most recent value
a Demand Size
– DAVG returns time-persistent average
Demand Size was defined as an Expression
Backlogging naturally happens
• Dispose block for customer exit
If backlogged, is accounted for automatically in the (simple)
definition and tracking of Inventory Level
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 47 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 48 of 51
Model 5-4: (s, S) Inventory Simulation Model 5-4: (s, S) Inventory Simulation
Inventory Evaluation Placing an Order
• Create block for Inventory Evaluator entities • If we exit the Branch block via the top “If” branch,
First Creation at time 0 – evaluate inventory at start of run it must be that I(t) < s so we want to order up to S
Interval is Evaluation Interval, defined as Expression • Assign block
• Branch block – somewhat like Decide module Define Order Quantity Attribute
To determine whether to place an order now – Could have made this a Variable in this model with these
Add “branches,” each evaluated as true or false parameters, but it’s more general for it to be an Attribute ... why?
Clone of incoming entity sent out along each “true” branch, Increment Total Ordering Cost Variable
but at most Max Number of Branches will be sent out • Delay block for Delivery Lag
– So we set Max Number of Branches to 1 (default is ∞)
• Assign block to increment Inventory Level by
First branch of type “If” – if “true” we want to order the Order Quantity
Second branch of type “Else” – if “true” it means that the
first branch was “false” so we don’t order – just Dispose • Dispose block
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 49 of 51 Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 50 of 51
Simulation with Arena, 6th ed. Chapter 5 – Modeling Detailed Operations Slide 51 of 51