No Slide Title

Download Report

Transcript No Slide Title

SIMULATION MODELING AND ANALYSIS
WITH ARENA
T. Altiok and B. Melamed
Chapter 2
Discrete Event Simulation
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
1
The DES Paradigm
• The DES (Discrete Event Simulation) model
possesses a state vector S consisting of system
variables needed to describe the system evolution
over time
• The system state at time t, S(t), is often a step
function whose jumps are triggered by events
• The DES model is driven by a clock and an
event list
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
2
The structure of a DES event list
Event List Head
Event 1
Time: 7.25
Event 2
Time: 11.2
Event 3
Time: 22.13
Event 4
Time: 22.11
Event List Tail
Other fields
A DES simulator executes the following algorithm:
1.
Set the simulation clock to an initial time (usually 0), and then generate
one or more initial events and schedule them.
2. If the event list is empty, then terminate the simulation run. Otherwise,
find the most imminent event and unlink it from the event list.
3. Advance the simulation clock to the time of the most imminent event,
and execute it (the event may stop the simulation).
4. Loop back to Step 2.
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
3
Example: A single FIFO machine
Job
Arrivals
FIFO
Buffer
Machine
Job
Departures
• Two event types: arrival and process completion
• State S(t): number of jobs in the system at time t
• State transitions
• arrival at time t: S(t) = n
S(t+ ) = n + 1
• process completion at time t: S(t) = n
S(t+ ) = n - 1
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
4
Example: Single machine with failures
Failures
FIFO
Buffer
Machine
Job
Arrivals
Job
Departures
Repairs
S(t) = (N(t),V(t))
N(t) = number of jobs in the buffer at time t = 0,1,2,..
V(t) = process status at time t (idle= 0, busy = 1, down = 2)
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
5
Single Machine With Failures (Cont.)
• State transitions:
• Job arrival: (n,v)
(n+1, v)
• Service process completion:
(n,1)
(0,0),
if n = 0
(n,1)
(n-1,1), if n > 0
• Failure occurrence: (n,1)
(n,2)
• Repair completion: (n,2)
(n,1)
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
6
Monte Carlo Sampling and Histories
• Sampling random values from specified distributions
uses random number generators (RNGs)
• RNGs generate pseudo random numbers, uniform
over (0,1), which are used to obtain values from any
distribution to
• The term “Monte Carlo” is attributed to von
Neumann & Ulam for their work on random
processes at Los Alamos
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
7
Monte Carlo Sampling and Histories
(Cont.)
• Performance evaluation produces estimates of
performance measures (utilization, average WIP
levels, etc.) from sample histories
• Performance measures are computed from multiple
runs (replications) of a DES model
• Performance measure estimates from distinct
replications form a statistical sample that is used to
compute grand averages and confidence intervals for
these performance measures
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
8
Example: Workstation Subject to
Failures and Inventory Control
Failures
Warehouse
Machine
Raw
Material
Job
Departures
Repairs
Demand
Arrivals
Unsatisfied
Demand
• A never-starving machine produces product for a warehouse
• Inventory is managed by an (R,r) policy: the machine stops
producing when R = 5 units are in the warehouse and resumes
production when the inventory drops to r = 2
• The machine fails randomly
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
9
Performance Measures and State
• Performance Measures
• probabilities of machine status
• machine throughput
• customer service level
• average finished inventory level
• System State
• S(t) = (V(t),K(t))
• V(t) = 0 (Idle), 1 (Busy), 2 (Down)
• K(t) = level of finished product in the warehouse
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
10
Example: Operational History of a
Machine Subject to Failure
Machine
Status
Idle
Busy
Down
Busy
Idle
Stock On-Hand
6
5
4
3
2
1
160
150
140
130
120
110
100
90
80
70
60
50
40
30
20
10
0
0
Time (Min)
• Here the reorder point is r = 2, the target level is R = 5, the
machine has 3 states: Idle, Busy, Down, and K(t) = stock on hand
• At time, t = 0, V(0) = 0 (machine is idle), and K(0) = 4
(warehouse has 4 units)
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
11
Sample System Behavior
Machine
Status
Idle
Busy
Down
Busy
Idle
Stock On-Hand
6
5
4
3
2
1
160
150
140
130
120
110
100
90
80
70
60
50
40
30
20
10
0
0
Time (Min)
• At time t = 35, a customer arrives demanding 3 units, and K(35) = 1.
• The reorder point r is down crossed and the machine becomes busy
replenishing the inventory to the target level R.
• Thereafter, the inventory level gradually increases, with no demand
arrivals of until time, t = 65, where K(65) = 4.
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
12
Sample System Behavior (Cont.)
Machine
Status
Idle
Busy
Down
Busy
Idle
Stock On-Hand
6
5
4
3
2
1
160
150
140
130
120
110
100
90
80
70
60
50
40
30
20
10
0
0
Time (Min)
• At time t = 69, a customer arrives and places a demand that depletes
the stock on-hand, so K(69) = 0 ; unsatisfied demand is unfulfilled.
• At time t = 75, the unit that started processing at time t = 65 is
completed, so K(75) = 0.
• At time t = 87, the machine fails and repair begins (Down state).
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
13
Sample System Behavior (Cont.)
Machine
Status
Idle
Busy
Down
Busy
Idle
Stock On-Hand
6
5
4
3
2
1
160
150
140
130
120
110
100
90
80
70
60
50
40
30
20
10
0
0
Time (Min)
• Repair is completed at time t = 119 and the machine enters the Busy
resuming processing the unit that was interrupted during failure.
• At time t = 101, a customer arrives with demand 1, so K(101) = 1.
• Thereafter, the inventory level gradually increases, with no demand
arrivals between times t = 127 and t = 157. Then the target level,
R = 5, is reached, and the machine production is suspended.
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
14
Distribution of Machine Status
• Consider the machine status over the time interval [0,T]
• TI is the total idle time over [0,T]
• TB is the total busy time over [0,T]
• TD is the total down time over [0,T]
• The probability distribution of machine status is estimated as
the ratios of time spent in a state to total simulation time,
• Pr{ machine idle} =
T
• Pr{ machine busy} =
T
• Pr{ machine down} =
35 + 8
I
=
T
B
T
T
D
T
165
= 0.261
(87 - 35) + (157 -119)
=
165
= 0.545
119 -87
=
165
= 0.194
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
15
Machine Throughput
• Throughput is the effective processing rate, namely,
the number of job completions (departures) per unit time
• CT be the number of job completions in the machine over the time
interval [0,T]
• Throughput is estimated as
o =
CT
T
=
9
= 0.0545
165
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
16
Customer Service Level
• Consider customers arriving at the warehouse over the
time interval [0,T], with product demands
• NS is the total number of arriving customers whose demand is totally
satisfied over [0,T]
• NT is the is the total number of arriving customers over [0,T]
• Jk is the unmet quantity of the demand of customer k
• M is the total number of customers with unmet demand over [0,T]
• The customer service level over [0,T] is estimated as
x=
Ns
NT
=
2
= 0.6667
3
• The customer average of unmet demand over [0,T] is estimated
M
as
J

J 
k 1
k
M
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
17
Distribution of Inventory Levels
• Consider the long-term probability that the number of finished
units in the warehouse, K, is at some given level, k, estimated as
total time spent with k units in stock
Pr{k units in stock} =
total time
• In particular, for k = 0, Pr{ stock-out} =
75-69
= 0.036
165
• The corresponding estimated distribution is given below
k
Pr{K = k }
0
1
2
3
4
5
0.036
0.279
0.218
0.121
0.297
0.048
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
18
Average Inventory on-hand
• The average inventory on-hand in the warehouse is estimated as
5
K =
å
k Pr{ K = k } = 2.506
k= 0
• This is a consequence of the general time average formula
T
ò K (t ) d t
K = 0
T
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
19
DES Modeling Languages and Tools
•
•
•
•
•
•
•
•
Arena/SIMAN
Promodel
Extend
G2
GPSS
SLAM
MODSIM
General purpose programming languages
Altiok / Melamed Simulation Modeling and Analysis with Arena
Chapter 2
20