Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Discrete-Event Simulation
Modeling
(PART I)
MAIN
Law (2015), Simulation Modeling and
Analysis, Chapter 1
SUPPORTING
Banks, et al. (2014), Discrete-Event System
Simulation, Chapter 3
1
Classification of Simulation
2
Types of Simulation Modeling
4
State of a System
5
Fundamental Terms
System: a collection of entities (e.g.: people and
machines) that interact together over time to
accomplish one or more goals.
Measures of performance (or Performance
Indicator): output response of the system, as the
objective of the study for the system. It can be used
to compare one system to another.
System state: the collection of variables necessary
to describe the system at a particular point of time.
Event: an instantaneous occurrence that changes
the state of a system.
Parameter: an intrinsic character of a system’s
component
6
Fundamental Terms
Entity: any object or component in the system which
requires explicit representation in the model (e.g., a
customer, a machine)
Attributes: the properties of a given entity (e.g., the
priority of a waiting customer, the routing of a job
through a shop, the arrival time of a customer)
List: a collection of (permanently or temporarily)
associated entities ordered in some logical fashion
(e.g., FCFS, by-priority)
Event list: a list of future events, ordered by time of
occurrence.
7
Example of Fundamental Terms
Example: notice a single server queuing system!
State variables of the system state: number of
customer in system, number of customer in queue
(queue length), server status (busy or idle).
Events: arrival of customer, customer entering
service, departure of customer from service.
Measures of performance: average queue length,
average waiting time, average time in system,
maximum queue length, maximum waiting time,
server utilization.
Parameter: (distribution of) service times,
(distribution of) arrival rate [inter-arrival times]
8
Example of Fundamental Terms
Exercise:
Identify state variables, events, and measures
of performance in the following systems:
A teaching-learning classroom
An automatic-teller-machine (ATM) center
An inventory warehouse
A field of battle-tank combat
9
Time-Advance Mechanism
10
Next-event Time Advance
Time
0 3 4 6.5 7.5 9 14
12
Fixed Increment Time Advance
Time
0 Dt 2Dt 3Dt 4Dt 5Dt
13
General Logic for Discrete-Event Simulation
Initialization:
- Initialize random generator (seed)
- Initialize system state
- Initialize event list
Stopping criteria:
- Time-based or condition-based
Report:
- Compute and write measures of
performance of interest
14
First simulation example
16
SSQS: Intuitive explanation example
17
SSQS: Intuitive explanation example
Interarrivaltimes are from Exponential Distribution with b = 2
Service times are from Exponential Distribution with b = 1.5
(Time unit in minute)
18
SSQS: Intuitive explanation example
Recall:
inverse transform method to generate Exponential random
variates X with parameter b is:
- Generate U as IID U(0,1)
- Return X = - b * ln(1 – U)
Interarrival times:
A1 = 0.4, A2 = 1.2, A3 = 0.5, A4 = 1.7, A5 = 0.2, A6 = 1.6, A7 = 0.2,
A8 = 1.4, A9 = 1.9, …
Service times:
S1 = 2.0, S2 = 0.7, S3 = 0.2, S4 = 1.1, S5 = 3.7, S6 = 0.6, …
19
SSQS: Intuitive explanation example
20
SSQS: Intuitive explanation example
Optional:
• Customers in System = Customers in Queue +
Customer in Service
21
SSQS: Intuitive explanation example
Identified events:
– Event Customer Arrival
This event will increase the number of customers in
queue
– Event Customer Entering Service
This event will decrease the number of customers in
queue, and change the server status from idle to busy
– Event Customer Departure
This event will change the server status from busy to
idle
22
SSQS: Intuitive explanation example
Arrival event generates next Arrival event Departure event may generate EnterService event immediately
23
SSQS: Intuitive explanation example
24
SSQS: Intuitive explanation example
25
SSQS: Intuitive explanation example
26
SSQS: Intuitive explanation example
27
SSQS: Intuitive explanation example
28
SSQS: Intuitive explanation example
29
SSQS: Intuitive explanation example
31
SSQS: Intuitive explanation example
D i
dˆ AVG i 1
n
Di = Time when customeri enter service – Time when customeri enter queue
32
SSQS: Intuitive explanation example
S Di = 5.7
34
SSQS: Intuitive explanation example
35
SSQS: Intuitive explanation example
36
SSQS: Intuitive explanation example
37
SSQS: Intuitive explanation example
Estimating qAVG:
𝑇
0 𝑄 𝑡 𝑑𝑡 [Time average of Q(t)]
𝑞𝐴𝑉𝐺 = =
𝑇
[Total Area under Q(t) graph]
/ (divided-by)
[Total obeservation time]
38
SSQS: Intuitive explanation example
Estimating qAVG:
Using the same logic to compute “time-average” statistic, the estimator for u
can be derived as follow
𝑇
0 𝐵 𝑡 𝑑𝑡
𝑢=
𝑇
[Time average of B(t)] = [Total Area under B(t) graph] / [Total obeservation time]
40
SSQS: Intuitive explanation example
Estimating expected server utilization
41
Statistical Counter in Simulation
42
43
43
44
44
45
45
46
46
SSQS: Intuitive explanation example
47
SSQS: Stopping the simulation run
– Time based:
Run simulation for some fixed amount of simulated-time
(simulation-run length)
48
49
Etc.
58
(EMPTY)
To add new event, create the new event data in EventToAdd, then Add the EventToAdd data to EventList
When CurrentEvent is executed (in this case ARRIVAL), it generate EnterService (because the server is
IDLE and C1 is the front-most in the queue. Arrival-event also generate next arrival-event
When CurrentEvent is executed (in this case ENTSRV), it generate DEPARTURE event
Next, add this subroutine (at Area 3) to get input from worksheet and to
clear every output from previous simulation run.
Adjust the ranges (or cells’ positions) to suit your I/O interface design!
66
Please adjust the range (or cells’ locations) to suit your worksheet design
72
75
SSQS: Discussion
From the result of simulation run examples, we can compare
with analytical result from M/M/1 queuing model:
If the inter-arrival times follow Exponential distribution with
mean 1.0, and the service times follow Exponential distribution
with mean 0.5, then from Queuing Theory we get:
– steady-state average waiting time in-queue: 0.5 minutes
– steady-state average number in queue: 0.5 customers
– steady-state server utilization: 50%
76
SSQS: Discussion
If the inter-arrival times follow Exponential
distribution with mean 1.0, and the service times
follow Exponential distribution with mean 0.7, then
from Queuing Theory we get:
– steady-state average waiting time in queue: 1.633 minutes
– steady-state average number in queue: 1.633 customers
– steady-state server utilization: 70%
77
SSQS: Discussion
POINTS TO NOTIFIY
– Simulation result is only estimate; but result from
analytical model is exact.
– The choice of stopping rule cannot be chosen
arbitrarily.
– Interpretation of simulation output must be
analyzed using statistical procedures for
estimation.
78
79