Computer Simulation
Arena Modeling
Dr. Jeff Hong
IELM Dept, HKUST
Fall 2010
Note 05: Arena Modeling 1
Case 1: The Darker Image
The Arena Model
Assign Self Self Service
Service Time Copying
Arrival Self Service?
0 T ru e
0 D epa rtu re
0 0
0 Fa ls e Assign Full Full Service
Service Time Copying
Proposal One 0
Assign Self
Service Time
0 T ru e
Arrival Self Service? Copy Machine Departure
0 0
0 0
Fa ls e Assign Full
Service Time
Proposal Two
Note 05: Arena Modeling 2
Launch Arena
Start
‐>All Programs
‐>Rockwell
Software
‐>Arena 10.0
‐>Arena 10.0
Note 05: Arena Modeling 3
Arena World View
Arena takes the process interaction world view.
Entities flow through a network of modules that describe
their logical behavior.
We describe the network by developing a process
flowchart.
Assign Self
Service Time
0 T ru e
Arrival Self Service? Copy Machine Departure
0 0
0 0
Fa ls e Assign Full
Service Time
Note 05: Arena Modeling 4
About Modules…
Arena contains a very large number of modules that are
organized into panels.
The panels are structured from high level to low level
concepts:
Basic Process
Advanced Process & Advanced Transfer
Blocks & Elements (a programming language)
Note 05: Arena Modeling 5
Entities
Entities are dynamic elements that pass through the
system.
Entities are distinguished by their attributes.
Ex: people, parts, information, paperwork, etc.
Entities must be Created to get them into the model,
and are Disposed when they leave.
Note 05: Arena Modeling 6
Queueing
Entities queue when they need processing.
In Arena…
An entity tries to Seize a Resource.
The time the entity uses the resource is the Delay.
If the resource is not available, the entity waits in a Queue.
The entity Releases the resource when processing is
complete.
Queues are created automatically by some modules
(e.g., Process).
Note 05: Arena Modeling 7
Resources
Resources have…
A Name (up to you)
A Capacity (number of identical units of this resource).
And can have a Schedule (how many available when).
Resources are automatically defined by some
modules (e.g., Process)
Resources can also be defined manually, and the
properties of all resources are changed, via the
Resources spreadsheet on the Basic Process panel.
Note 05: Arena Modeling 8
Basic Process Modules
Push (possibly) batches of entities into
the model with a (possibly) random time
Create 1
between.
0
Models Queue-Seize-Delay-Release of
Proc ess 1 Resource, or any part of this (like pure
Delay).
0
Make decisions about where to go next
based on conditions or chance.
Take entities out of the model and
Dispose 1 (perhaps) record statistics.
0
Note 05: Arena Modeling 9
Basic Process Modules
Assign values (especially Attributes)
when an entity passes through.
Assign 1
Record information when entities pass
Record 1
through, typically statistics on entities.
Combine multiple entities into a single
entity.
Batch 1
Split multiple entities that were combined,
0
Separate 1 or duplicate a single entity.
Original
0 Duplicate
Note 05: Arena Modeling 10
Simulate Proposal One (step by step)
Assign Self Self Service
Service Time Copying
Arrival Self Service?
0 T ru e
0 D epa rtu re
0 0
0 Fa ls e Assign Full Full Service
Service Time Copying
Note 05: Arena Modeling 11
Create arrival of jobs
2 3 6
4
7
5
Note 05: Arena Modeling 12
Determine types of jobs
Note 05: Arena Modeling 13
Assign service times to self service jobs
3
4
1
2
Note 05: Arena Modeling 14
Processing delay and queue for self service
jobs
1
4
2
3
5
7
Note 05: Arena Modeling 15
Assign service times to full service jobs
Note 05: Arena Modeling 16
Processing delay and queue for full service
jobs
1
2
Note 05: Arena Modeling 17
Departure
Note 05: Arena Modeling 18
Run: set model & run parameters
1
Note 05: Arena Modeling 19
Run to completion
Note 05: Arena Modeling 20
Report
Note 05: Arena Modeling 21
Simulate Proposal Two (sketch)
Assign Self
Service Time
0 T ru e
Arrival Self Service? Copy Machine Departure
0 0
0 0
Fa ls e Assign Full
Service Time
Note 05: Arena Modeling 22
Create arrival of jobs
Note 05: Arena Modeling 23
Determine types of jobs
Note 05: Arena Modeling 24
Assign service times to self service jobs
Note 05: Arena Modeling 25
Assign service times to full service jobs
Note 05: Arena Modeling 26
Processing delay and queue
Note 05: Arena Modeling 27
Departure
Note 05: Arena Modeling 28
Resource: set resource capacity (different
from Proposal One)
Note 05: Arena Modeling 29
Summary
The rest steps are similar with Proposal One (you
can finish them now).
So far,
you have learned Arena modeling;
you are familiar with basic process modules.
We now introduce another example.
Note 05: Arena Modeling 30
Case 2: Warehouse Design
A warehouse is open from 7:00am to 4:00pm. The
warehouse is equipped with two forklifts, four loading
bays and a parking lot.
Customer (with truck) comes to the warehouse. If there
is empty loading bay in the warehouse, the truck stops in
loading bay and waits for forklift to pick up goods,
otherwise, the truck joins the queue in the parking lot.
Forklift picks up goods for trucks in the loading bays
according to first come first serve rule, and unloads the
goods in the loading bay. Truck driver loads goods on
the truck, then the truck leaves.
Note 05: Arena Modeling 31
Warehouse
Current situation
Parking Lot Loading Bay
Note 05: Arena Modeling 32
Assumption
According to data analysis, we make the following
assumptions for the distributions of input variables:
Customers arrive from 7:00am to 4:00pm. Interarrival time for
customers follows an exponential distribution, with mean 20
minutes.
The pick up time of forklift follows a triangular distribution, with
parameters (20,35,60) minutes.
The loading goods time of truck driver follows a triangular
distribution, with parameters (5,10,20) minutes.
Note 05: Arena Modeling 33
Question
Build ARENA model to simulate the warehouse
Take a sample of ten days, simulate average number of
trucks in the parking lot, average time that customers
spend in the warehouse and the utilization of forklifts.
To improve the quality of service, the warehouse
suggests two proposals
proposal one:add a forklift
proposal two:add a loading bay
Which proposal is better for improving the service quality?
Note 05: Arena Modeling 34
Create: customer arrival
Note 05: Arena Modeling 35
Process: occupy loading bay
Note 05: Arena Modeling 36
Process: pick up orders
Note 05: Arena Modeling 37
Process: loading goods
Note 05: Arena Modeling 38
Process: departure
Note 05: Arena Modeling 39
Resource: set resource capacity
Note 05: Arena Modeling 40
Run: set model & run parameters
Note 05: Arena Modeling 41
Report
Note 05: Arena Modeling 42
Average total time spent in warehouse
Note 05: Arena Modeling 43
Average number of trucks in parking lot
Note 05: Arena Modeling 44
Utilization of forklift
Note 05: Arena Modeling 45
Extension 1: add a forklift
Note 05: Arena Modeling 46
Extension 2: add a loading bay
Note 05: Arena Modeling 47
Extension 3: schedule
Resource Schedules dictate when resources are
available.
Note 05: Arena Modeling 48
Schedule rule
Note 05: Arena Modeling 49
Extension 3: schedule (cont’d)
The forklift drivers need to have lunch (Suppose each
forklift driver take one-hour lunch break from 12-1 pm) .
Assume the resource schedule to be “ignore”.
Note 05: Arena Modeling 50
Extension 3: schedule (cont’d)
2 3
4
Note 05: Arena Modeling 51
Extension 3: schedule (cont’d)
1
2, right click, select
edit via dialog…
Note 05: Arena Modeling 52
Extension 3: schedule (cont’d)
Note 05: Arena Modeling 53
Extension 3: schedule (cont’d)
3
1
Note 05: Arena Modeling 54
Extension 3: schedule (cont’d)
3
1
Note 05: Arena Modeling 55
Extension 3: schedule (cont’d)
Note 05: Arena Modeling 56
Case 3: Simulate Arrival Situations
In this case, we will discuss three commonly
seen arrival situations in projects:
1. Joining the shortest queue
2. Balking
3. NSAP: non-stationary arrival process
Note 05: Arena Modeling 57
Joining the shortest queue
Imagine you go to McDonald’s, there are
three queues:
Counter A: 4 people
Counter B: 3 people
Counter C: 4 people
By probability? No!
Note 05: Arena Modeling 58
In Arena, …
Note 05: Arena Modeling 59
Drawbacks
Once customers (entities) join the queue, they
could not change.
Some counters will always be higher utilized.
Note 05: Arena Modeling 60
Balking
Sometimes, when customers see that the queue
is too long, then they decide not to join the
queue. This is called “balking”.
The difficulty of modeling balking is that not
everyone balk, and people balk at different
queue lengths.
Note 05: Arena Modeling 61
In Arena, …
Note 05: Arena Modeling 62
NSAP
You can find the arrival rate changes among
time.
NSAP: Non-stationary arrival process
Use the Create module to produce arrivals at the smallest
mean TBA (Time between arrival).
Use Decide to randomly accept only enough arrivals to get
the mean TBA we want. Generally accept smallest/current x
100%
Use Create-Assign to change the value of the current mean
TBA over time (hour by hour here).
e.g.,
Note 05: Arena Modeling 63
Time dependent
Note 05: Arena Modeling 64
In Arena, …
Note 05: Arena Modeling 65
Exercise
A fast food restaurant has 4 counters. Assume all
counters are the same, with service time uniformly
distributed between 1 and 3 minutes.
The restaurant operates from 8:00 am to 2:00 pm.
Interarrival time between each customers are
exponentially distributed with mean 1 minutes in the first
two hours, 5 minutes in the following two hours, and 0.5
minutes in the last two hours.
Note 05: Arena Modeling 66
Exercise (cont’d)
After customers come to front of counters, they will
decide whether to stay or not, depending on the total
number of people waiting in all 4 queues. Their tolerance
are normally distributed with mean 10 and variance 4.
After the customers buy the food, they will leave.
All customers will join the shortest queue.
Simulate 100 days to see the results.
Note 05: Arena Modeling 67