Professional Documents
Culture Documents
3 General Principles 2022 S
3 General Principles 2022 S
2
3
Today’s questions
4
Example: Single-Channel Queue
5
Example Single-Channel Queue (cont)
relation? relation?
6
Example 1: Single-Channel Queue (cont)
7
1. Concepts in Discrete-Event Simulation
8
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
9
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
10
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
12
1. Concepts in Discrete-Event Simulation
Event notice
13
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.
15
16
17
18
19
Concepts in Discrete-event Simulation
20
A snapshot at simulation time t
*Set = list
21
2. World views for developing a model
22
Event Scheduling/Time Advance Algorithm
23
Event-Scheduling (2)
25
Effect of
Departure
and Arrival
event on
system
26
27
28
B: Total Busy Time
MQ: Maximum Queue Length
a*, s*: generated interarrival and service time
29
Event scheduling
mechanism
t1: “imminent
event”: next event
that will occur
Removal and
addition of
events from
the FEL list
30
● 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 31
2.1. Event Scheduling
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
33
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
34
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.
35
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
36
Table 3.6 Simulation Table for Dump Trucks
Operation
37
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
38
3.1.3. Manual Simulation Using Event Scheduling (13)
39
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
40
2.2. Process-interaction World View
41
2.2. Process-interaction World View
Event-scheduling approach
42
2.2. Process-interaction World View
Process-oriented approach
43
2.2. Process-interaction World View
44
2.2. Process-interaction World View
45
3.3 Summary
46