Discrete Event Simulation
Discrete Event Simulation
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
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
Determinethegoalsandobjectives
Buildaconceptualmodel
Convertintoaspecificationmodel
Convertintoacomputationalmodel
Verify
Validate
3 Model Levels
Conceptual
Veryhighlevel
Howcomprehensiveshouldthemodelbe?
Whatarethestatevariables,whicharedynamic,andwhichareimportant?
Specification
Onpaper
Mayinvolveequations,pseudocode,etc.
Howwillthemodelreceiveinput?
Computational
Acomputerprogram
GeneralpurposePLorsimulationlanguage?
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
3. Process interaction
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
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
Agriculture
10
18
36
Health
26
37
Services
35
44
Final
Payments
16
25
38
79
Total Input
36
37
44
79
196
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
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
Direct
Indirect (Businesses)
Induced (Households)
Type II Multipliers are derived from the Total Requirements Table with
Households
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
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
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 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
= 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
Breakdown of
Type II Income Multiplier Agricultural Sector
= $2.50