lecture 5: discrete event simulation

21
COMP155 Computer Simulation September 10, 2008

Upload: nanji

Post on 05-Jan-2016

68 views

Category:

Documents


1 download

DESCRIPTION

COMP155 Computer Simulation September 10, 2008. Lecture 5: Discrete Event Simulation. 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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture 5: Discrete Event Simulation

COMP155Computer Simulation

September 10, 2008

Page 2: Lecture 5: Discrete Event Simulation

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

Page 3: Lecture 5: Discrete Event Simulation

Steps in a Simulation

Study

from Discrete-Event Simulation 4th ed. Banks et.al. Prentice Hall 2005

Page 4: Lecture 5: Discrete Event Simulation

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

Page 5: Lecture 5: Discrete Event Simulation

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?

Page 6: Lecture 5: Discrete Event Simulation

Components of a Simulation/Model

Entities Attributes Resources Queues Global Variables Statistical Accumulators Events Simulation Clock

Page 7: Lecture 5: Discrete Event Simulation

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

Page 8: Lecture 5: Discrete Event Simulation

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

Page 9: Lecture 5: Discrete Event Simulation

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

Page 10: Lecture 5: Discrete Event Simulation

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

Page 11: Lecture 5: Discrete Event Simulation

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

Page 12: Lecture 5: Discrete Event Simulation

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

Page 13: Lecture 5: Discrete Event Simulation

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)

Page 14: Lecture 5: Discrete Event Simulation

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

Page 15: Lecture 5: Discrete Event Simulation

System Clock

Global variable maintained by Arena to track simulation time

Clock advances as events are processed

Page 16: Lecture 5: Discrete Event Simulation

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

Page 17: Lecture 5: Discrete Event Simulation

Randomness in Simulation A single simulation run is not sufficient for

non-deterministic systems Drill press simulation: five replications:

Notesubstantialvariabilityacrossreplications

Page 18: Lecture 5: Discrete Event Simulation

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

Page 19: Lecture 5: Discrete Event Simulation

Drill Press Simulation Results Circles:

original arrival times Triangles:

arrival rate doubled

solid: replication 1

hollow:replications 2-5

Page 20: Lecture 5: Discrete Event Simulation

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

Page 21: Lecture 5: Discrete Event Simulation

Assignment 3: First Task Goals of study

informal list Informal model of system

block/flow diagram identify entities, resources, processes, queues