Simulation and Modeling: Event-Oriented Discrete Event Systems, Study notes of Computer Science

An outline for a lecture on simulation and modeling, focusing on event-oriented discrete event systems. Topics include simulation modeling characteristics, concepts of time, des computation, data structures, and program code. Dynamic and static models, deterministic and stochastic systems, discrete and continuous models, and aggregates or individuals are discussed.

Typology: Study notes

Pre 2010

Uploaded on 09/17/2009

koofers-user-9y0
koofers-user-9y0 šŸ‡ŗšŸ‡ø

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Maria Hybinette, UGA
CSCI: 4210/6210
Simulation & Modeling
Event-Oriented Simulations
Maria Hybinette, UGA 2
Outline
!Simulation modeling characteristics
!Concept of Time
!A DES computation
!DES System = model + simulation executive
!Data structures
!Program (Code)
Maria Hybinette, UGA 3
Simulation Model Characteristics
Today we will look at:
!Static or dynamic models
!Stochastic, deterministic or chaotic models
!Discrete or continuous change/models
!Aggregates or Individuals
Computer Art: Brownian Tree -
fractal with a dendritic structure.
Generated stochastically
Maria Hybinette, UGA 4
Static Dynamic
Discrete Time
Continuous Time
Deterministic
Stochastic
Monte Carlo simulations
Maria Hybinette, UGA 5
Static or Dynamic Models
!Dynamic:
»State variables change over time
»System Dynamics, Discrete Event, Agent-Based
!Static:
»Snapshot at a single point in time
»Monte Carlo simulation, optimization models
yi
Response
Xi,p
…Xi,j
…
Xi,
3
Xi,2
n
.
.
.
3
2
1
Xi,
1
Repetitions
Inputs
Maria Hybinette, UGA 6
Deterministic, Stochastic or Chaotic
!Deterministic:
»Predictive behavior. The system is perfectly understood,
then it is possible to predict precisely what will happen.
»Repeatable
!Stochastic:
»behavior cannot be entirely predicted.
!Chaotic:
»deterministic model with a behavior that cannot be
entirely predicted. Depends so sensitively on the system’s
initial conditions so that in effect it cannot be predicted.
pf3
pf4
pf5

Partial preview of the text

Download Simulation and Modeling: Event-Oriented Discrete Event Systems and more Study notes Computer Science in PDF only on Docsity!

Maria Hybinette, UGA

CSCI: 4210/

Simulation & Modeling

Event-Oriented Simulations

Maria Hybinette, UGA 2

Outline

! Simulation modeling characteristics

! Concept of Time

! A DES computation

! DES System = model + simulation executive

! Data structures

! Program (Code)

Maria Hybinette, UGA 3

Simulation Model Characteristics

Today we will look at:

! Static or dynamic models

! Stochastic, deterministic or chaotic models

! Discrete or continuous change/models

! Aggregates or Individuals

C formapcuttaelr wAirtth: a Bdreonwdnriiatni (^) cT rseter (^) u-cture. Generated stochastically Maria Hybinette, UGA 4 Static Dynamic Discrete Time Continuous Time Deterministic Stochastic Mo nte Ca rlo sim ula tio ns

Static or Dynamic Models

! Dynamic:

Ā» State variables change over time

Ā» System Dynamics, Discrete Event, Agent-Based

! Static:

Ā» Snapshot at a single point in time

Ā» Monte Carlo simulation, optimization models

yi Response Xi,2 X 3 i, … Xi,j … Xi,p n . . . 3 2 1 Repetitions^ X 1 i, Inputs

Deterministic, Stochastic or Chaotic

! Deterministic:

Ā» Predictive behavior. The system is perfectly understood, then it is possible to predict precisely what will happen. Ā» Repeatable

! Stochastic:

Ā» behavior cannot be entirely predicted.

! Chaotic:

Ā» deterministic model with a behavior that cannot be entirely predicted. Depends so sensitively on the system’s initial conditions so that in effect it cannot be predicted.

Maria Hybinette, UGA 7

Discrete or Continuous Models

! Discrete model:

Ā» state variables change only at a countable

number of points in time.

  • These points in time are the ones at which the event occurs/change in state.

! Continuous model:

Ā» state variables change in a continuous way,

and not abruptly from one state to another.

Ā» infinite number of states.

Maria Hybinette, UGA 8 State variables Time Continuous: State variables change continuously as a function of time State variables = f( t ) State variables Time Discrete: State variables change at discrete times Maria Hybinette, UGA 9 Static Dynamic Discrete Time Continuous Time Deterministic Stochastic One or more random parameters Fixed inputs yield fixed outputs Fixed inputs yield different outputs System description at one point in time System state changes at distinct times System description as it changes in time Model allows system state to change at any time Mo nte Ca rlo sim ula tio ns Maria Hybinette, UGA 10

Simulation

Actual System Simulated System

! Simulated system imitates operations of actual system over time ! Artificial history of system can be generated and observed ! Internal (perhaps unobservable) behavior of system can be studied ! Time scale can be altered as needed ! Conclusion about actual system characteristics can be inferred inputs (t) Parameters outputs (t) outputs (t)

What is a Simulation Model?

! An abstraction of a real system

! Simplified assumptions are used to capture (only)

important behaviors

Actual System Parameters (^) EnvirSoynsmteemnt inputs (t) outputs (t) Model (simplified) Parameters (^) EnviroMnmodeenlt inputs (t) outputs (t)

System’s Modeling

System

Interactive

objects

System Environment

Placing the system boundary is the first difficult task in modeling

Maria Hybinette, UGA 19

How to Create a DES?

! DES Modeling raises the following questions?

Ā» How does each event affect system state and

attributes?

Ā» How are activities defined?

  • What events mark beginning and the end?
  • What condition (if any) most hold?

Ā» How are delays defined?

Ā» How is the simulation initialized?

Maria Hybinette, UGA 20

A Simulation Example

! Single-server Queue at a bank

! One possible problem formulation:

Ā» ā€œcustomer have to wait too long in my bankā€

! Objective:

Ā» Determine the effect of an additional cashier

! Data needed:

Ā» inter-arrival time of customers

Ā» Service times

Maria Hybinette, UGA 21

Simulation Results

Queue Length Time Maria Hybinette, UGA 22 Moving Image

Movie

! Series of still images, sufficient to convey

recognizable motion

System Snapshots

System Simulation

! Series of system snapshot

Ā» system state

Ā» activities in progress

Ā» end time

System Snapshots

Moving Image System Simulation

Maria Hybinette, UGA 25

Time

! Physical system: actual or imagined system being modeled

! Simulation : a system that emulates the behavior of a physical system

physical system simulation

main() { ... double clock; ... } ! physical time: time in the physical system Ā» Noon, December 31 , 1999 to noon January 1 , 2000 ! simulation time: representation of physical time within the simulation Ā» floating point values in interval [ 0. 0 , 24. 0 ] ! wallclock time: time during the execution of the simulation, usually output from a hardware clock Ā» 9 : 00 to 9 : 15 AM on September 10 , 1999 Maria Hybinette, UGA 26

Simulation Time

Simulation time is defined as a totally ordered set of values

where each value represents an instant of time in the

physical system being modeled.

! For any two values of simulation time T 1 representing

instant P 1 , and T 2 representing P 2 :

! Correct ordering of time instants

Ā» If T 1 < T 2 , then P 1 occurs before P 2 Ā» 9.0 represents 9 PM, 10.5 represents 10:30 PM

! Correct representation of time durations

Ā» T 2 - T 1 = k (P 2 - P 1 ) for some constant k Ā» 1.0 in simulation time represents 1 hour of physical time Maria Hybinette, UGA 27

Modes of Execution

! As-fast-as-possible execution (unpaced): no fixed

relationship necessarily exists between advances in

simulation time and advances in wallclock time

! Real-time execution (paced): each advance in simulation

time is paced to occur in synchrony with an equivalent

advance in wallclock time

! Scaled real-time execution (paced): each advance in

simulation time is paced to occur in synchrony with S * an

equivalent advance in wallclock time (e.g., 2 x wallclock

time)

Converting from wallclock to Simulation Time:

Simulation Time = W2S(W) = T 0 + S * (W - W 0 ) W = wallclock time; S = scale factor W 0 (T 0 ) = wallclock (simulation) time at start of simulation (assume simulation and wallclock time use same time units) Maria Hybinette, UGA 28

Discrete Event Simulation

Discrete event simulation: computer model for a

system where changes in the state of the system

occur at discrete points in simulation time.

Fundamental concepts:

  • system state (state variables)
  • state transitions (events)

A DES computation: can be viewed as a sequence of

event computations , with each event computation is

assigned a (simulation time) time stamp. Each event

computation can

  • modify state variables
  • schedule new events

Discrete Event Simulation

Computation

! Unprocessed events are stored in a pending event list

! Events are processed in time stamp order

example: air traffic at an airport

events: aircraft arrival, landing, departure

arrival 8: departure 9: landed 8: schedules^ arrival 9:30^ processed event^ current event unprocessed event schedules

Discrete Event Simulation

System

model of the

physical

system

Simulation Application

• state variables

• code modeling system behavior

• I/O and user interface software

Simulation Executive

• event list management

• managing advances in simulation time

calls to

schedule

events

calls to event

handlers

Independent

of the

simulation

application

Maria Hybinette, UGA 37

Summary

! Simulation modeling characteristics ! Time Ā» Important to distinguish among simulation time, wallclock time, and time in the physical system Ā» Paced execution (e.g., immersive virtual environments) vs. unpaced execution (e.g., simulations to analyze systems) ! DES computation: sequence of event computations Ā» Modify state variables Ā» Schedule new events ! DES System = model + simulation executive ! Data structures Ā» Pending event list to hold unprocessed events Ā» State variables Ā» Simulation time clock variable ! Program (Code) Ā» Main event processing loop Ā» Event procedures Ā» Events processed in time stamp order