General Principles in Discrete-Event Simulation: Book: Jerry Bank's Chapter 3 Kelton's Chapter 2
General Principles in Discrete-Event Simulation: Book: Jerry Bank's Chapter 3 Kelton's Chapter 2
2
Objectives
3
1. Concepts in Discrete-Event Simulation
4
1. Concepts in Discrete-Event Simulation
● Entities:
- dynamic objects in the simulation, which move around in
the system, affect the state of the system
- all entities have to be created.
- most entities represent real things in a simulation, but you
also can create “fake” ones
5
1. Concepts in Discrete-Event Simulation
● Attributes:
- a common characteristic of all entities, but with a specific
value that can differ from one entity to another
- attribute values are tied to specific entities
6
1. Concepts in Discrete-Event Simulation
● Events:
- An instantaneous occurrence that changes the state of a
system
What events may take place in the Example of Single-Channel Queue?
……
…..
● Activities:
- A duration of time of specified length, which is known
when it begins (although it may be specified deterministic or
in statistical distribution)
- This duration is characterized and defined by the modeler
8
1. Concepts in Discrete-Event Simulation
Event notice
9
1. Concepts in Discrete-Event Simulation
● Delay:
- A duration of time of unspecified indefinite length, which is not
known until it ends
- Not specified by the modeler ahead of time, but rather
determined by system conditions.
- Quite often, a delay's duration is measured and is one of the
desired outputs of a model run.
11
2.1. Event-Scheduling
12
2.1. Event-Scheduling
15
Execution of the departure event 16
● List processing: the
management of the FEL.
– the removal of the
imminent event.
– the addition of a new
event to the list, and
– occasionally removal
of some event
( cancellation of an
event).
● Scheduling a future
event: at the instant an
activity begins, its
duration is computed or
drawn as a sample from a
statistical distribution
● efficiency of searching
of the list depends on the
logical organization of
the list and on how the
search is conducted 17
2.1. Event Scheduling
Imminent event
current value of
simulated time
System snapshot at
different simulating
time
19
2.1. Event Scheduling
● A discrete-event simulation: the modeling over time of a system all of whose state
changes occur at discrete points in time - those points when an event occurs.
Traveling
Loading
Scale
Loader Weighing
queue queue
First-Come
First-Come First-Served
First-Served
■ The distributions of loading time, weighing time, and travel time are
given in Tables 3.3, 3.4, and 3.5, respectively, from Table A.1.
Table 3.3 Distribution of Loading Time for the Table 3.4 Distribution of Weighing Time for the
Dump Trucks Dump Trucks
22
3.1.3. Manual Simulation Using Event Scheduling (10)
– Event notices :
● (ALQ, t, DTi ), dump truck i arrives at loader queue (ALQ) at time t
● (EL, t, DTi), dump truck i ends loading (EL) at time t
● (EW, t, DTi), dump truck i ends weighing (EW) at time t
23
3.1.3. Manual Simulation Using Event Scheduling (11)
Example (Cont.)
– Lists:
● Loader queue: all trucks waiting to begin loading, ordered on a first
come, first served basis
● Weigh queue : all trucks waiting to be weighed, ordered on a first come,
first served basis
– It has been assumed that five of the trucks are at the loaders and one is at the
scale at time 0.
24
Table 3.6 Simulation Table for Dump Trucks
Operation
Truck 4 begins to load,
Truck 3 joins the weigh queue
schedule an EL event for future
(because the scale is occupied.)
time 10
At time 0,
5 trucks at
the loaders
and 1 is at
the scale
The imminent
event is an EL
event with
time 5, hence
clock is
advanced to
time t=5
25
Table 3.6 Simulation Table for Dump Trucks
Operation
26
3.1.3. Manual Simulation Using Event Scheduling (12)
Example
(Cont.)
– This logic for the occurrence of the end-loading event
● When an end-loading (EL) event occurs, say for truck j at time t , other events
may be triggered.
● If the scale is idle [W(t)=0], truck j begins weighing and an end-weighing
event (EW) is scheduled on the FEL.
● Otherwise, truck j joins the weigh queue.
● If at this time there is another truck waiting for a loader, it will be removed
from the loader queue and will begin loading by the scheduling of an end-
loading event (EL) on the FEL.
– In order to estimate the loader and scale utilizations, two cumulative statistics are
maintained:
● BL = total busy time of both loaders from time 0 to time t
● BS = total busy time of the scale from time 0 to time t
27
3.1.3. Manual Simulation Using Event Scheduling (13)
28
2.1. Event-Scheduling
● Advantages:
- allow us to control everything; have complete flexibility
with regards to attributes, variable and logic flow; know the
state of everything anytime
- easily to be coded up in any programming language or with
macros in a spreadsheet
● Disadvantages:
- become very complicated for large models with lots of
different kinds of events, entities and resources
29
2.2. Process-interaction World View
30
2.2. Process-interaction World View
Event-scheduling approach
31
2.2. Process-interaction World View
Process-oriented approach
32
2.2. Process-interaction World View
33
2.2. Process-interaction World View
34
3.3 Summary
35