Transcript 6

COMP155
Computer Simulation
September 10, 2008
Discrete Event Simulation
discrete event simulation:
state variable change
only at a discrete set of points in time
 events:
the set of points in time
at which state changes occur

Steps in a
Simulation
Study
from
Discrete-Event Simulation 4th ed.
Banks et.al.
Prentice Hall 2005
Example System
Drill
Press
Blank Part
Arrives
7
6
5
Queue

Finished Part
Departs
4
Part in Service
One type of entities: parts to be drilled
 multiple entities over time


One process: drilling a part
One resource: drill press
 required to complete drilling process
 one the drill press is in use for a part,
it is not released until that part is finished

(this is the example system in chapters 2 and 3)
Goals of Drill Press Study

What do we want to discover?
 How many parts can be processed




in some time frame?
What is average and maximum waiting time
for parts in the queue?
What is the maximum size of the queue?
What are the average and maximum
total time in system for parts?
What is the utilization ratio of the drill press?
Components of a Simulation/Model
Entities
 Attributes
 Resources
 Queues
 Global Variables
 Statistical Accumulators
 Events
 Simulation Clock

Entities
Things that move around, change status,
and interact with other entities
 Entities are dynamic objects:
arrive, move around, leave
 Usually represent “real” things

 DP system: entities are the parts
 May have “fake” entities for modeling “tricks”
○ Breakdown demon, break angel
May have multiple realizations (instances)
in system concurrently
 May have multiple types of entities
concurrently

Attributes

Characteristic of all entities: describe,
differentiate
 All entities of same type have same attribute “slots”
but different values

Possible Attributes:
○ Time of arrival, due date, priority, color
Notion of an attribute is same as in other CS
contexts (OO, UML, ER …)
 Arena defines certain automatic attributes,
developer adds application specific attributes

Resources

Resources are things that entities compete for
○ People, Equipment, Space

Entities seize a resource, use it, release it
 Better to think “resource is assigned to an entity”,
rather than an “entity belonging to a resource”

Resources may have several units of capacity
 examples
○ seats at a table in a restaurant
○ identical ticketing agents at an airline counter
 Number of units of resource may change during a
simulation run
Queues

A queue is a place for entities to wait when
they can’t move forward
 example: need to seize an unavailable resource

Queues have names
 name often tied to a corresponding resource

Queues generally have finite capacity
 need to model what happens if an entity arrives at
a full queue
Global Variables

Global Variables reflect characteristics
of whole system, not of specific entities
 Examples:
○ Travel time between all station pairs
○ Number of parts in system
○ Simulation clock (built-in Arena variable)
Entities can access and change variables
 Arena defines certain global variable,
developer adds application GVs

Statistical Accumulators

Used to record information needed for
output performance measures
 passive variables: used for recording,
but not for processing in simulation

Arena automatically handles
most statistical accumulators
 invisible to simulation logic
Variables vs. Accumulators

Global Variables:
 simulation clock
 number of parts in queue (now)

Statistical Accumulators:




number of parts drilled (so far)
total of queue waiting times (so far)
max time in queue (so far)
max time in system (so far)
Events
Something that happens at an instant of time
 May change attributes, variables or statistical
accumulators
 System maintains an event calendar

 used to determine next interesting instance in time

Discrete-event simulation
 by definition, nothing in system
changes between events
System Clock
Global variable maintained by Arena
to track simulation time
 Clock advances as events are processed

Experiment Design
A run or execution of a simulation gives
information about one set of conditions with
one set of random inputs
 Multiple runs are needed to deal with:

 randomness
 configuration changes
Randomness in Simulation
A single simulation run is not sufficient for
non-deterministic systems
 Drill press simulation: five replications:

Note
substantial
variability
across
replications
Comparing Alternatives

Goals may require comparison of different
system configurations
 particularly when simulation is used for design
 what is the fastest, cheapest or “best” design

Drill press system: What would happen if the
arrival rate were to double?
 Cut interarrival times in half
 Rerun the model for double-time arrivals
 Make five replications
Drill Press Simulation Results




Circles:
original arrival times
Triangles:
arrival rate doubled
solid:
replication 1
hollow:
replications 2-5
Assignment 3
Teams of 4
 Develop a simulation study using Arena
 Problems from IIE/RA annual contest

 IIE: Institute of Industrial Engineers
 RA: Rockwell Automation

Finished reports due September 29
Assignment 3: First Task

Goals of study
 informal list

Informal model of system
 block/flow diagram
 identify entities, resources, processes, queues