Computer Science, Informatik 4 Communication and Distributed Systems
Simulation
“Discrete-Event System Simulation”
- Dr. Mesut Güneş
Simulation Discrete-Event System Simulation Dr. Mesut Gne Computer - - PowerPoint PPT Presentation
Computer Science, Informatik 4 Communication and Distributed Systems Simulation Discrete-Event System Simulation Dr. Mesut Gne Computer Science, Informatik 4 Communication and Distributed Systems Chapter 8 Input Modeling Computer
Computer Science, Informatik 4 Communication and Distributed Systems
Computer Science, Informatik 4 Communication and Distributed Systems
Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 3 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 4 Chapter 8. Input Modeling
Raw Data Input Data
Output
System Performance simulation
Computer Science, Informatik 4 Communication and Distributed Systems 5 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 6 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 7 Chapter 8. Input Modeling
distribution
histogram
Computer Science, Informatik 4 Communication and Distributed Systems 8 Chapter 8. Input Modeling
between 7 am and 7:05 am was monitored for 100 random workdays.
value in the data range
Arrivals per Period Frequency 12 1 10 2 19 3 17 4 10 5 8 6 7 7 5 8 5 9 3 10 3 11 1 Same data with different interval sizes
Computer Science, Informatik 4 Communication and Distributed Systems 9 Chapter 8. Input Modeling
1 144 ≤ x < 147 … 1 42 ≤ x < 45 … 1 12 ≤ x < 15 1 9 ≤ x < 12 5 6 ≤ x < 9 10 3 ≤ x < 6 23 0 ≤ x < 3
Computer Science, Informatik 4 Communication and Distributed Systems 10 Chapter 8. Input Modeling
network research community
connection information
Environment Signaling Information)
information so that it is usable with a network simulator, e.g., ns-2?
number is too high for ns-2
Stanford University Mobile Activity Traces (SUMATRA)
Computer Science, Informatik 4 Communication and Distributed Systems 11 Chapter 8. Input Modeling
data by identifying user groups
is kept in the group
communication
number movements is negligible!
5 10 15 20 10 20 30 40 50 200 400 600 800 1000 1200 1400 1600 1800
P e
l e C a l l s M
e m e n t s
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5000 10000 15000 20000 25000
Number of People Number of Movements
Computer Science, Informatik 4 Communication and Distributed Systems 12 Chapter 8. Input Modeling
Strong Correlation Moderate Correlation No Correlation
Computer Science, Informatik 4 Communication and Distributed Systems 13 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 14 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 15 Chapter 8. Input Modeling
time or space
component processes
memoryless
maximum values are known
Computer Science, Informatik 4 Communication and Distributed Systems 16 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 17 Chapter 8. Input Modeling
1
Computer Science, Informatik 4 Communication and Distributed Systems 18 Chapter 8. Input Modeling
distributions
distributions with appropriate parameter values
Computer Science, Informatik 4 Communication and Distributed Systems 19 Chapter 8. Input Modeling
the sample mean (99.99 sec) and sample variance (0.28322 sec2)
j Value j Value j Value 1 99.55 6 99.98 11 100.26 2 99.56 7 100.02 12 100.27 3 99.62 8 100.06 13 100.33 4 99.65 9 100.17 14 100.41 5 99.79 10 100.23 15 100.47
Computer Science, Informatik 4 Communication and Distributed Systems 20 Chapter 8. Input Modeling
0,05 0,1 0,15 0,2 0,25 0,3 0,35 99,4 99,6 99,8 100 100,2 100,4 100,6
installation times follow a normal distribution.
Superimposed density function of the normal distribution
99,2 99,4 99,6 99,8 100 100,2 100,4 100,6 100,8 99,2 99,4 99,6 99,8 100 100,2 100,4 100,6 100,8
Straight line, supporting the hypothesis of a normal distribution
Computer Science, Informatik 4 Communication and Distributed Systems 21 Chapter 8. Input Modeling
the points to be scattered about the line
points in the middle of the plot is more important.
sample sets
approximately a straight line if X and Z are well represented by the same distribution
Computer Science, Informatik 4 Communication and Distributed Systems 22 Chapter 8. Input Modeling
1 2 2 2 1
= =
n i i n i i
1
1 2 2 2 1
− − = =
= =
n X n X f S n X f X
n j j j n j j j
Computer Science, Informatik 4 Communication and Distributed Systems 23 Chapter 8. Input Modeling
1
1 2 2 2 1
− − = =
= =
n X n m f S n m f X
n j j j c j j j
Computer Science, Informatik 4 Communication and Distributed Systems 24 Chapter 8. Input Modeling
– Theoretically: Poisson with parameter λ μ = σ2 = λ
= =
= = = = = = =
k j j j k j j j
X f X f X f X f n
1 2 1 2 2 1 1
2080 and , 364 and ,... 1 , 10 , , 12 , 100 63 . 7 99 ) 64 . 3 ( 100 2080 3.64 100 364
2 2
= ⋅ − = = = S X
5 10 15 20 25 1 2 3 4 5 6 7 8 9 10 11
Number of Arrivals per Period Frequency
Computer Science, Informatik 4 Communication and Distributed Systems 25 Chapter 8. Input Modeling
X 1 ˆ = λ X 1 ˆ , ˆ = θ β
2 2
2 2
After taking ln
Computer Science, Informatik 4 Communication and Distributed Systems 26 Chapter 8. Input Modeling
distributions
State of the null hypothesis Statistical Decision Type II Error Correct Accept H0 Correct Type I Error Reject H0 H0 False H0 True
Computer Science, Informatik 4 Communication and Distributed Systems 27 Chapter 8. Input Modeling
=
− =
k i i i i
E E O
1 2 2
) ( χ
Observed Frequency in the i-th class Expected Frequency Ei = n*pi where pi is the theoretical
Suggested Minimum = 5
2
Computer Science, Informatik 4 Communication and Distributed Systems 28 Chapter 8. Input Modeling
H0: The random variable, X, conforms to the distributional assumption with the parameter(s) given by the estimate(s). H1: The random variable X does not conform.
combining is necessary, and
i i i
2 1 , 2 − −
>
s k α
χ χ
Computer Science, Informatik 4 Communication and Distributed Systems 29 Chapter 8. Input Modeling
testing result.
1
1
−
−
i i a a i
i i
Sample Size, n Number of Class Intervals, k 20 Do not use the chi-square test 50 5 to 10 100 10 to 20 > 100 n1/2 to n/5
Computer Science, Informatik 4 Communication and Distributed Systems 30 Chapter 8. Input Modeling
H0: the random variable is Poisson distributed. H1: the random variable is not Poisson distributed.
at the 0.05 level of significance.
! ) ( x e n x np E
x i
α
α −
= =
xi Observed Frequency, Oi Expected Frequency, Ei (Oi - Ei)2/Ei 12 2.6 1 10 9.6 2 19 17.4 0.15 3 17 21.1 0.8 4 19 19.2 4.41 5 6 14.0 2.57 6 7 8.5 0.26 7 5 4.4 8 5 2.0 9 3 0.8 10 3 0.3 > 11 1 0.1 100 100.0 27.68 7.87 11.62
Combined because
min Ei = 5, e.g., E1 = 2.6 < 5, hence combine with E2
2 5 , 05 . 2
22 17 12.2 7.6
Computer Science, Informatik 4 Communication and Distributed Systems 31 Chapter 8. Input Modeling
distribution with the empirical cdf, SN(x), of the N sample observations.
D = max| F(x) - SN(x) |
Computer Science, Informatik 4 Communication and Distributed Systems 32 Chapter 8. Input Modeling
statistic value.
level, hence Poisson is a poor fit.
2 0 =
Computer Science, Informatik 4 Communication and Distributed Systems 33 Chapter 8. Input Modeling
families it suggests may be inappropriate.
appropriate input model.
Computer Science, Informatik 4 Communication and Distributed Systems 34 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 35 Chapter 8. Input Modeling
period
=
n j ij
1
Day 1 Day 2 Day 3 8:00 - 8:30 12 14 10 24 8:30 - 9:00 23 26 32 54 9:00 - 9:30 27 18 32 52 9:30 - 10:00 20 13 12 30 Number of Arrivals Time Period Estimated Arrival Rate (arrivals/hr)
For instance, 1/3(0.5)*(23+26+32) = 54 arrivals/hour
Computer Science, Informatik 4 Communication and Distributed Systems 36 Chapter 8. Input Modeling
Computer Science, Informatik 4 Communication and Distributed Systems 37 Chapter 8. Input Modeling
simulation.
products is required, salesperson
more than 5000 units will be sold.
there is a 90% chance of selling more than 2000 units, a 25% chance of selling more than 2500 units, and only a 1% chance of selling more than 4500 units.
a cumulative probability of being less than or equal to those goals for simulation input:
1,00 0,01 4500 < X <= 5000 4 0,99 0,24 2500 < X <= 4500 3 0,75 0,65 2000 < X <=2500 2 0,10 0,1 1000 <= X <= 2000 1 Cumulative Frequency, ci Interval (Sales) i
0,00 0,20 0,40 0,60 0,80 1,00 1,20 1000 <= X <= 2000 2000 < X <=2500 2500 < X <= 4500 4500 < X <= 5000
Computer Science, Informatik 4 Communication and Distributed Systems 38 Chapter 8. Input Modeling
into consideration
dependent.
are dependent.
Computer Science, Informatik 4 Communication and Distributed Systems 39 Chapter 8. Input Modeling
2 2 1 1
2 1 2 1 2 2 1 1 2 1
ε is a random variable with mean 0 and is independent
2 1
2 1 X
Computer Science, Informatik 4 Communication and Distributed Systems 40 Chapter 8. Input Modeling
X1 and X2.
2 1 2 1 2 1
⎪ ⎩ ⎪ ⎨ ⎧ > < = ⇒ ⎪ ⎩ ⎪ ⎨ ⎧ > < = ) , (
2 1
β X X corr
Computer Science, Informatik 4 Communication and Distributed Systems 41 Chapter 8. Input Modeling
) , (
h t t h
X X corr
+
= ρ
Computer Science, Informatik 4 Communication and Distributed Systems 42 Chapter 8. Input Modeling
2, σ2 2
2, σ2 2, see “Parameter Estimation”
pairs (X11, X21), (X12, X22), … (X1n, X2n),
=
n j j j
1 2 2 1 1 2 1
2 1 2 1
Sample deviation
Computer Science, Informatik 4 Communication and Distributed Systems 43 Chapter 8. Input Modeling
individually to see whether they are represented well by normal distribution.
96 6,3 92 4,5 109 7,3 106 5,8 104 6,9 112 6,9 97 6,0 116 6,9 83 4,3 103 6,5 Demand (X2) Lead Time (X1)
93 . 9 , 8 . 101 02 . 1 , 14 . 6
2 2 1 1
= = = = σ σ X X
Covariance
Computer Science, Informatik 4 Communication and Distributed Systems 44 Chapter 8. Input Modeling
+
h h t t h
Computer Science, Informatik 4 Communication and Distributed Systems 45 Chapter 8. Input Modeling
2 :
1
−
t t t
2 3 2
ε ε
2 1
+
t t X
1
t t +
2 2 2
Computer Science, Informatik 4 Communication and Distributed Systems 46 Chapter 8. Input Modeling
1 1
− −
t t t t
1 and , 1 with d distribute lly exponentia i.i.d. are , , where
3 2
< ≤ = … φ μ ε ε /λ
ε
2 1
+
t t X
1
t t +
Computer Science, Informatik 4 Communication and Distributed Systems 47 Chapter 8. Input Modeling
1) Collecting the raw data 2) Identifying the underlying statistical distribution 3) Estimating the parameters 4) Testing for goodness of fit