Lecture 5: Discrete Event Simulation
description
Transcript of Lecture 5: Discrete Event Simulation
COMP155Computer 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
One type of entities: parts to be drilledmultiple entities over time
One process: drilling a part One resource: drill press
required to complete drilling processone 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)
Blank PartArrives
Finished PartDeparts
DrillPress
Part in Service
4
Queue
567
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 partsMay 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, differentiateAll 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 capacityexamples
○ 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 forwardexample: need to seize an unavailable resource
Queues have namesname 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 entitiesExamples:
○ 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 measurespassive variables: used for recording,
but not for processing in simulation
Arena automatically handles most statistical accumulatorsinvisible to simulation logic
Variables vs. Accumulators Global Variables:
simulation clocknumber 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 simulationby 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:randomnessconfiguration changes
Randomness in Simulation A single simulation run is not sufficient for
non-deterministic systems Drill press simulation: five replications:
Notesubstantialvariabilityacrossreplications
Comparing Alternatives
Goals may require comparison of different system configurationsparticularly when simulation is used for designwhat is the fastest, cheapest or “best” design
Drill press system: What would happen if the arrival rate were to double?Cut interarrival times in halfRerun the model for double-time arrivalsMake 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 EngineersRA: 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