Simulasi Random
Simulasi Random
Metoda:
a : multiplier
c : increment
m: modulus
1 x / F(x)
e for x 0
f ( x) 1.00 U=1 - exp(-x/beta)
0 elsewhere
U2
x /
1 e for x 0
F ( x)
0 elsewhere
0.50
U 1 e x / U1
x ln(1 U )
x1 x2
Discrete distribution:
• Basically the same as for the continuous case
• Example : a simulation to represent the number of
defective components on a circuit board, number of
drinks ordered from a drive-through window
How to generate random variates (cont.)
Discrete distribution:
5. Simple Spreadsheet Simulation
• System: ATM
• Entities: customers that arrive to the ATM for
processing
• Resource: ATM that serves the customers with
the capacity to serve one customer at a time
• The system controls that dictate how, when and
were activities are performed for this ATM
system
Arriving customers ATM queue ATM server Departing
(entities) (FIFO) (resource) customers
(entities)
8 7 6 5 4 3 2 1
Interarrival
time 4.8
minutes
Where
X ln(1 U )
i i
Z 2i (21Z 2i 1 3) mod(128)
U 2i Z 2i / 128 i 1,2,...,25
Z 20 122
X 2i 2.4 ln(1 U 2i )
Tabel. Summary of ATM System Simulation Output
Replication Average Time in Queu Average Time in System
1 1.94 minutes 4.26 minutes
2 0.84 minutes 2.36 minutes
Average 1.39 minutes 3.31 minutes
1 3 122
2 29 92
• Changing the seed values Z10 and Z20 causes the
spreadsheet program to recompute all values in the
spreadsheet.
• When we change the seed values Z1 0 and Z20
appropriately, we produce another replication of
the simulation.
• The heart of simulation is the generation of the
random variates that drive the stochastic events in
the simulation.
Summary