0% found this document useful (0 votes)
219 views46 pages

Discrete Event Simulation

This document provides an overview of discrete event simulation. It defines key concepts like discrete events, state changes, and time jumps between events. It describes common examples like customer wait times. It outlines the typical components of a discrete event simulation model including the state, clock, event list, random number generator, and statistics tracking. It also discusses the different levels of a model from conceptual to computational. Finally, it covers different approaches to implementing a discrete event simulation like activity scanning, event scheduling, and process interaction.

Uploaded by

Charles Odada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
219 views46 pages

Discrete Event Simulation

This document provides an overview of discrete event simulation. It defines key concepts like discrete events, state changes, and time jumps between events. It describes common examples like customer wait times. It outlines the typical components of a discrete event simulation model including the state, clock, event list, random number generator, and statistics tracking. It also discusses the different levels of a model from conceptual to computational. Finally, it covers different approaches to implementing a discrete event simulation like activity scanning, event scheduling, and process interaction.

Uploaded by

Charles Odada
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

DISCRETE EVENT

SIMULATION
BY CHARLES ODADA
E222-01-0304/2015

Definitions
Discrete event simulation utilizes a mathematical/logical
model of a physical system that portrays state changes at
precise points in simulated time.
Between consecutive events, no change in the system is
assumed to occur; thus the simulation can directly jump in
time from one event to the next.
Both the nature of the state change and the time at which
the change occurs mandate precise description.
EXAMPLES: Customers waiting for service
The management of parts inventory

Supermarket Example

Components of a discrete event


simulation
State: The state of a system is a set of variables that captures the important system
properties that are to be studied
Clock: Simulation must keep track of the current simulation time. In the case of the discrete
event simulation the clock skips to the next event start time
Events list: List of pending events as a result of previously simulated event
Random-Number Generator: The simulation needs to generaterandom variablesof various
kinds, depending on the system model. This is accomplished by one or morePseudorandom
number generators. The use of pseudo-random numbers as opposed to true random
numbers is a benefit should a simulation need a rerun with exactly the same behavior.
Statistics: The simulation typically keeps track of the system'sstatistics, which quantify the
aspects of interest. In the bank example, it is of interest to track the mean waiting times.
Ending Conditions: theoretically a discrete-event simulation could run forever. So the
simulation designer must decide when the simulation will end. Typical choices are at time t
or after processing n number of events or, more generally, when statistical measure X
reaches the value x.

Further Definitions
Operation: A sequence of activities that changes the
state of the system
Activity: The smallest unit of work. Activities have finite
durations. Observable state changes are assumed to
happen at the beginning or ending of activities
Process: A sequence of events, operations, and
activities in chronological order corresponding to the
behavior of an entity in the real system

DES Model Development Steps


Howtodevelopamodel:
1)
2)
3)
4)
5)
6)

Determinethegoalsandobjectives
Buildaconceptualmodel
Convertintoaspecificationmodel
Convertintoacomputationalmodel
Verify
Validate

3 Model Levels
Conceptual
Veryhighlevel
Howcomprehensiveshouldthemodelbe?
Whatarethestatevariables,whicharedynamic,andwhichareimportant?

Specification
Onpaper
Mayinvolveequations,pseudocode,etc.
Howwillthemodelreceiveinput?

Computational
Acomputerprogram
GeneralpurposePLorsimulationlanguage?

Structure of Simulation Software


Three Levels of Software
1.simulation executive
1. also called simulation control program or simulator
2. controls execution of the model program
3. sequences the operations
4. modularity issue: separate generic control from details of the model

2.model program
1. implements the simulation model
2. executed by the simulation executive

3.utility routines
1. generate random numbers from common probability distributions
2. gather statistics
3. modularity issue: separate generic functions from model-specific behavior

Time in Simulation
In a simulation we deal with two notions of time:
1. simulation time -- the time on the simulation clock -- the virtual time
or logical time in the simulated world
2. run time -- the amount of processor time consumed
We require run times small enough to get a result within the resources
available. However, the simulation time is more important in terms of
the result and how the simulation is organized.

Time in Simulation
Event time: The simulation time at which an event
occurs
Techniques for changing the time on the simulation
clock:
1. Fixed time increment -- time slicing -- periodic
scan
Event executed at end of interval rather than at precise
time
Some intervals may have no events, wasting CPU time
2. Variable time increment -- event scan

Implementation of Discrete Event


Simulation
Operationally, a discrete-event simulation is a
chronologically non-decreasing sequence of event
occurrences.
Event record: A pairing of an event with its event time
Future event list (FEL) (or just event list): A list
ordered by non-decreasing simulation time (e.g., in a
priority queue)
Event (list) driven simulation: Simulation where time
is advanced to the time given by the first event record
from the event list

Requirements for support of discrete-event


simulation:
1. Maintain a future event list
2. Enable event record creation and insertion into and deletion from
event list
3. Maintain simulation clock
4. For stochastic simulations, provide utilities to generate random
numbers from common probability distributions

Approaches to Discrete Event


Simulation
Three general approaches:
1. Activity scanning
2. Event scheduling

An event is a change in an object state, occurring at an


instant, and initiates an activity precluded prior to that
instant. An event is said to be determined if the only
condition on event occurrence can be expressed strictly as a
function of time. Otherwise, the event is contingent.

An object activity is the state of an object between two


events describing successive state changes for that object.

A process is the succession of states of an object over a span


(or the contiguous succession of one or more activities).

3. Process interaction

Event, Activity and Process

Activity Scanning
Basic building block is the activity
Model program's code segments consist of sequences of activities
(operations) waiting to be executed
An activity sequence's conditions must be satisfied before it is
executed
Simulation executive moves from event to event executing those
activity sequences whose conditions are satisfied

Event Scheduling
Basic building block is the event
Model program's code segments consist of event routines waiting to be
executed
Event routine associated with each event type -- performs required
operations for that type
Simulation executive moves from event to event executing the
corresponding event routines

Process Interaction
Basic building block is the process
System consists of a set of interacting processes
Model program's code for each process includes the operations that it
carries out throughout its lifetime
Event sequence for system consists of merging of event sequences for
all processes
Future event list consists of a sequence of event nodes (or notices)
Each event node indicates the event time and process to which it
belongs

Process Interaction
Simulation executive carries out the following tasks:
1. Placement of processes at particular points of time in the list
2. removal of processes from the event list
3. activation of the process corresponding to the next event node from
the event list
4. rescheduling of processes in the event list

Process Interaction
Typically, a process object can be in one of several states: active -process is currently executing
There is only one such process in a system.
ready -- process is in event list, waiting for activation at a certain time
idle (or blocked) -- process is not in event list, but eligible to be
reactivated by some other entity (e.g., waiting for a passive resource)
terminated -- process has completed its sequence of actions, is not in
event list, and cannot be reactivated

Input Output Analysis


Input-output analysis is one of a set of related methods which show
how the parts of a system are affected by a change in one part of that
system.
Input-Output analysis can be used to predict changes in overall
economic activity as a result of some change in the local economy

Components of I/O Analysis


1. Transactions Table
2. Direct Requirements Table
3. Total Requirements Table

Transactions Table
A transactions table shows the monetary flows of goods and services
in a local economy
Represents monetary flows for a given time period, usually one year
Total outlays = Total output
Intermediate purchases are goods and services purchased and used in
the local production process
Final demands are purchases for final consumption
Final payments are payments for factors or inputs outside
intermediate production process

Transactions Table Example


Purchasing Sectors ($
million)
Agriculture Health Services Final
Total
Demands Output
Selling Sectors
($ million)

Agriculture

10

18

36

Health

26

37

Services

35

44

Final
Payments

16

25

38

79

Total Input

36

37

44

79

196

Direct Requirements Table


Direct requirements are the purchases of resources
(inputs) by a sector from all sectors to produce one
dollar of output
Creates a production recipe

Direct Requirements Table

Multipliers
Multipliers measure total change throughout the
economy from one unit change for a given sector.
Three Types of Multipliers are calculated from Model
1. Output
2. Employment
3. Income
These multipliers exist on three levels
Type 1, Type 2, Type 3

Type 1 Multipliers
Include direct or initial spending
Include indirect spending or businesses buying and
selling to each other
The multiplier is direct plus indirect effect divided by
direct effect

Type 2 Multipliers
Include direct or initial spending
Include indirect spending or businesses buying and
selling to each other
The multiplier is direct plus indirect effect divided by
direct effect

Type III Multipliers


Type III Multipliers are modified Type II multipliers.
Therefore, Type III Multipliers also include the direct,
indirect, and induced effects.
Type III Multipliers adjust Type II Multipliers based on
spending patterns amongst different income groups.

Type I Multipliers include:


Direct
Indirect (Business Spending)
Type I Multipliers are derived from the
Total Requirements Table: Total requirements
coefficients show the sum of direct and indirect
purchases required to produce a dollar of output.

Total Requirements Table


Purchasing Sectors ($
million)

Agriculture

Health

Services

Selling Sectors
($ million)

Agriculture

1.446

0.268

0.085

Health

0.199

1.163

0.090

Services

0.258

0.110

1.043

Total

1.903

1.541

1.218

Explaining the Health Sector


Type I Multiplier
For a $1.00 change in final demand sales in the local
economy, the total direct and indirect impacts are
$1.541

Type II Multipliers include:

Direct

Indirect (Businesses)

Induced (Households)

Type II Multipliers are derived from the Total Requirements Table with
Households

Transactions Table with


Households
Ag
Selling Sectors
($ million)

Ag

Purchasing Sectors ($
million)
Health Services HouseFinal
Total
holds Demands Output

10

16

36

Health

10

16

37

Services

28

44

Households

10

19

Final
Payments

13

19

28

60

Total Input

36

37

44

19

60

196

Total Requirements Table


with Households
Purchasing Sectors

Selling Sectors

Agriculture

Health

Services Households

Agriculture

1.536

0.369

0.197

0.429

Health

0.386

1.370

0.318

0.879

Services

0.388

0.256

1.203

0.619

Households

0.279

0.311

0.341

1.319

Total

2.589

2.307

2.059

3.245

Explaining the Health Sector


Type II Multiplier
For a $1.00 change in final demand sales in
the local economy, the total direct, indirect
and induced impacts are $2.307

Multipliers
Direct requirements represent direct or initial spending
Direct and indirect effects include the direct spending
plus the indirect spending or businesses buying and
selling to each other
Direct, indirect and induced effects include direct and
indirect plus household spending earned from direct and
indirect effects

Other Multipliers
Employment Multipliers
Type I
Type II
Type III

Income Multipliers
Type I
Type II
Type III

Example Type I Employment Multiplier


Agricultural Sector Type I Employment Multiplier = 1.43
When the Agricultural Sector realizes a 1 employee change,
total employment in the study area changes by 1.43 jobs from
direct and indirect linkages

Example
Type II Employment Multiplier
Agricultural Sector Type II Employment Multiplier = 2.25
When the Agricultural Sector realizes a 1 employee
change, total employment in the study area changes by
2.25 jobs from direct, indirect and induced linkages

Breakdown of
Type II Employment Multiplier Agricultural Sector

Direct Effects = 1.00


Indirect Effects = 0.43
Induced Effects = 0.82
Total

= 2.25

Example
Type I Income Multiplier
Agricultural Sector Type I Income Multiplier = 1.96
When the Agricultural Sector realizes a $1.00 change in
income, total income in the study area changes by
$1.96 from direct and indirect linkages

Example Type II Income Multiplier


Agricultural Sector Type II Income Multiplier = 2.50
When the Agricultural Sector realizes a $1.00 change in
income, total income in the study area changes by
$2.50 from direct, indirect and induced linkages

Breakdown of
Type II Income Multiplier Agricultural Sector

Direct Effects = $1.00


Indirect Effects = $0.96
Induced Effects = $0.54
Total

= $2.50

Caution When Using Multipliers


Multiplier values include direct effects
Do not aggregate sector multipliers to derive
an aggregate multiplier
Be cautious of large multipliers
Be cautious in using a multiplier from another
study area

Verification and Validation of


Simulation Models

You might also like