Computer Science, Informatik 4 Communication and Distributed Systems
Simulation Simulation
Modeling and Performance Analysis with Discrete-Event Simulation g y
- Dr. Mesut Güneş
Simulation Simulation Modeling and Performance Analysis with - - PowerPoint PPT Presentation
Computer Science, Informatik 4 Communication and Distributed Systems Simulation Simulation Modeling and Performance Analysis with Discrete-Event Simulation g y Dr. Mesut Gne Computer Science, Informatik 4 Communication and Distributed
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
Chapter 9. Input Modeling 3
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 4
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 5
Computer Science, Informatik 4 Communication and Distributed Systems
Raw Data Input Data
Output
System Performance Simulation
Chapter 9. Input Modeling 6
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 7
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 8
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 9
Computer Science, Informatik 4 Communication and Distributed Systems
distribution
histogram
Chapter 9. Input Modeling 10
g
Computer Science, Informatik 4 Communication and Distributed Systems
10 15
5 10 2 4 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 20 30 10 20 4 8 12 16 20 40 30 35 40
Chapter 9. Input Modeling 11
25 7 14 20
Computer Science, Informatik 4 Communication and Distributed Systems
Arrivals per Period Frequency 12
12 1 10 2 19 3 17 4 10
4 10 5 8 6 7 7 5 8 5
9 3 10 3 11 1
20 10 15 20 5 10
Chapter 9. Input Modeling 12
1 2 3 4 5 6 7 8 9 10 11
Computer Science, Informatik 4 Communication and Distributed Systems
3 23 0 ≤ x < 3 23 3 ≤ x < 6 10 6 ≤ x < 9 5 9 ≤ x < 12 1 12 ≤ x < 15 1 … 42 ≤ x < 45 1 …
Chapter 9. Input Modeling 13
144 ≤ x < 147 1
Computer Science, Informatik 4 Communication and Distributed Systems
Stanford University Mobile Activity Traces (SUMATRA)
network research community
connection information connection information
Environment Signaling Information)
y
information so that it is usable with a network simulator, e.g., ns-2?
N d b ll ti
Chapter 9. Input Modeling 14
number is too high for ns-2
Computer Science, Informatik 4 Communication and Distributed Systems
1600 1800
data by identifying user groups
600 800 1000 1200 1400
P e
l e
is kept in the group
5 30 40 50 200 400 600
C
p g p
5 10 15 20 10 20
C a l l s M
e m e n t s
communication
15000 20000 25000
f People
number movements is negligible!
5000 10000
Number of
Chapter 9. Input Modeling 15
negligible!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Number of Movements
Computer Science, Informatik 4 Communication and Distributed Systems
40 20 30 40 40 60 20 30 40 10 20 10 20
Chapter 9. Input Modeling 16
Strong Correlation Moderate Correlation No Correlation
10 20 30 40 10 20 30 40 10 20 30 40
Computer Science, Informatik 4 Communication and Distributed Systems
30 35 35 40
Positive Correlation Negative Correlation
20 25 30 20 25 30 35 5 10 15 5 10 15
Chapter 9. Input Modeling 17
5 10 15 20 25 30 35 5 10 15 20 25 30 35
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 18
Computer Science, Informatik 4 Communication and Distributed Systems
time or space time or space
component processes
memoryless
maximum values are known maximum values are known
Chapter 9. Input Modeling 19
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 20
Computer Science, Informatik 4 Communication and Distributed Systems
−
1
Chapter 9. Input Modeling 21
where j is the ranking or order number
Computer Science, Informatik 4 Communication and Distributed Systems
distributions Th li h l 1 if F i b f i t f il f
distributions with appropriate parameter values
F-1()
Chapter 9. Input Modeling 22
yj
Computer Science, Informatik 4 Communication and Distributed Systems
j Value
the largest:
j Value 1 99,55 2 99,56 3 99 62
the largest:
normal distribution with the sample mean (99.99 sec) and sample variance (0 28322 sec2)
3 99,62 4 99,65 5 99,79 6 99 98
and sample variance (0.28322 sec2)
6 99,98 7 100,02 8 100,06 9 100 17 9 100,17 10 100,23 11 100,26 12 100,27 12 100,27 13 100,33 14 100,41 15 100,47
Chapter 9. Input Modeling 23
,
Computer Science, Informatik 4 Communication and Distributed Systems
a p e (co ued) C ec e e e doo installation times follow a normal distribution.
100,4 100,6 100,8 99,6 99,8 100 100,2
Straight line, supporting the hypothesis of a normal distribution
99,2 99,4 99,2 99,4 99,6 99,8 100 100,2 100,4 100,6 100,8
normal distribution
0,2 0,25 0,3 0,35
Superimposed
0,05 0,1 0,15
Superimposed density function of the normal distribution
Chapter 9. Input Modeling 24
99,4 99,6 99,8 100 100,2 100,4 100,6
Computer Science, Informatik 4 Communication and Distributed Systems
the points to be scattered about the line p
points in the middle of the plot is more important.
sample sets sample sets
z Z and z1, z2, …, zn
approximately a straight line if X and Z are well represented by the same distribution
Chapter 9. Input Modeling 25
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 26
Computer Science, Informatik 4 Communication and Distributed Systems
1 2 2 2 1
= =
n i i n i i
1 2 2 2 1
−
= =
X n X f X f
n j j j n j j j
1
1 2 1
− = =
= =
n f S n f X
j j j j j j
Chapter 9. Input Modeling 27
where fj is the observed frequency of value Xj
Computer Science, Informatik 4 Communication and Distributed Systems
1
1 2 2 2 1
− − = =
= =
n X n m f S n m f X
n j j j c j j j
Chapter 9. Input Modeling 28
Computer Science, Informatik 4 Communication and Distributed Systems
Vehicle Arrival Example (continued): Table in the histogram of the example
= =
= = = = = = =
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
j j
3 64 364 X
20 25
99 ) 64 . 3 ( 100 2080 3.64 100 36
2 2
⋅ − = = = S X
10 15
Frequency
63 . 7 99 =
5 1 2 3 4 5 6 7 8 9 10 11
Number of Arrivals per Period
Number of Arrivals per Period
Chapter 9. Input Modeling 29
– Theoretically: Poisson with parameter λ μ = σ2 = λ
Computer Science, Informatik 4 Communication and Distributed Systems
X 1 ˆ = λ 1
X 1 ˆ = θ
2 2
2 2
Chapter 9. Input Modeling 30
After taking ln
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 31
Computer Science, Informatik 4 Communication and Distributed Systems
distributions
Statistical Decision State of the null hypothesis H0 True H0 False Reject H Type I Error Correct
Chapter 9. Input Modeling 32
Reject H0 Type I Error Correct Accept H0 Correct Type II Error
Computer Science, Informatik 4 Communication and Distributed Systems
− =
k i i
E E O
2 2
) ( χ
Expected Frequency Ei = n*pi
= i i
E
1
Observed Frequency in the i-th class where pi is the theoretical
Suggested Minimum = 5
2
Chapter 9. Input Modeling 33
Computer Science, Informatik 4 Communication and Distributed Systems
H0: The random variable, X, conforms to the distributional assumption with the parameter(s) given by the estimate(s). H Th d i bl X d t f H1: The random variable X does not conform.
2 1 , 2 − −
>
s k α
χ χ
bi i i d combining is necessary, and
Chapter 9. Input Modeling 34
i i i
Computer Science, Informatik 4 Communication and Distributed Systems
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
t ti lt
> 100 n
1/2 to n /5
Chapter 9. Input Modeling 35
testing result.
Computer Science, Informatik 4 Communication and Distributed Systems
H0: the random variable is Poisson distributed. H1: the random variable is not Poisson distributed.
! ) ( 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 7.87
22 12.2
! x
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
Combined because
8 5 2.0 9 3 0.8 10 3 0.3 > 11 1 0.1 100 100.0 27.68 11.62
min Ei = 5, e.g., E1 = 2.6 < 5, hence combine with E2 17 7.6
at the 0.05 level of significance.
2 2
Chapter 9. Input Modeling 36
2 5 , 05 . 2
Computer Science, Informatik 4 Communication and Distributed Systems
distribution with the empirical cdf, SN(x), of the N sample observations. p , ( ), p
D = max| F(x) - SN(x) | D max| F(x) SN(x) |
S l i ll
Chapter 9. Input Modeling 37
Computer Science, Informatik 4 Communication and Distributed Systems
statistic value.
i ifi l l h P i i fit
2 0 =
significance level, hence Poisson is a poor fit.
Chapter 9. Input Modeling 38
Computer Science, Informatik 4 Communication and Distributed Systems
families it suggests may be inappropriate.
appropriate input model.
Chapter 9. Input Modeling 39
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 40
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 41
Computer Science, Informatik 4 Communication and Distributed Systems
n ij
1
=
j
1
Δt Time interval length
Day 1 Day 2 Day 3 Number of Arrivals Time Period Estimated Arrival Rate (arrivals/hr)
For instance
Day 1 Day 2 Day 3 8:00 - 8:30 12 14 10 24 8:30 - 9:00 23 26 32 54 Time Period Rate (arrivals/hr)
For instance, 1/3(0.5)*(23+26+32) = 54 arrivals/hour
Chapter 9. Input Modeling 42
9:00 - 9:30 27 18 32 52 9:30 - 10:00 20 13 12 30
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 43
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 44
Computer Science, Informatik 4 Communication and Distributed Systems
p p g simulation.
products is required, salesperson
i Interval (Sales) PDF Cumulative Frequency, ci 1 1000 <= X <= 2000 0.1 0.10 2 2000 < X <=2500 0.65 0.75
more than 5000 units will be sold
3 2500 < X <= 4500 0.24 0.99 4 4500 < X <= 5000 0.01 1.00
more than 5000 units will be sold.
there is a 90% chance of selling
1,20
more than 2000 units, a 25% chance of selling more than 2500 units, and only a 1% chance of selling more than 4500 units.
0 60 0,80 1,00
cumulative probability of being less
0,20 0,40 0,60
Chapter 9. Input Modeling 45
than or equal to those goals for simulation input:
0,00 1000 <= X <= 2000 2000 < X <=2500 2500 < X <= 4500 4500 < X <= 5000
Computer Science, Informatik 4 Communication and Distributed Systems
Chapter 9. Input Modeling 46
Computer Science, Informatik 4 Communication and Distributed Systems
If th i t th l ti hi h ld b i ti t d d t k
into consideration
An increase in demand results in lead time increase, hence variables are dependent.
I fi it f d i bl
Chapter 9. Input Modeling 47
y are dependent.
Computer Science, Informatik 4 Communication and Distributed Systems
1 2
2 2 1 1
ε is a random variable
with mean 0 and is independent of X2
β 0, X1 and X2 are statistically independent
2 1 2 1 2 2 1 1 2 1
2 1
2 1 X
Chapter 9. Input Modeling 48
Computer Science, Informatik 4 Communication and Distributed Systems
2 1 2 1 2 1
2 1
⎪ ⎨ ⎧ < = ⇒ ⎪ ⎨ ⎧ < = ) ( β X X corr
where
⎪ ⎩ ⎨ > < ⇒ ⎪ ⎩ ⎨ > < ) , (
2 1
β X X corr
X1 and X2.
Chapter 9. Input Modeling 49
Computer Science, Informatik 4 Communication and Distributed Systems
1, 2, 3,
) , (
h t t h
X X corr
+
= ρ
Chapter 9. Input Modeling 50
Computer Science, Informatik 4 Communication and Distributed Systems
2, σ2 2
To estimate
2 2 see “Parameter Estimation”
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
Chapter 9. Input Modeling 51
2 1 2 1
Sample deviation
Computer Science, Informatik 4 Communication and Distributed Systems
Lead Time (X1) Demand (X2) 6,5 103 4,3 83 6,9 116 6,0 97
93 . 9 , 8 . 101 02 . 1 , 14 . 6
2 2 1 1
= = = = σ σ X X
6,0 97 6,9 112 6,9 104 5,8 106
Covariance
7,3 109 4,5 92 6,3 96
individually to see whether they are represented well by normal
Chapter 9. Input Modeling 52
individually to see whether they are represented well by normal distribution.
Computer Science, Informatik 4 Communication and Distributed Systems
Autoregressive order 1 model AR(1)
+
h h t t h
g g y g , ,
Chapter 9. Input Modeling 53
Computer Science, Informatik 4 Communication and Distributed Systems
1
−
t t t
2
X X are normally distributed with mean = and variance =
2/(1 φ2) 2 3 2
ε ε
2 :
1)
+ t t X
2 2 2
2 1
+
t t
1
t t +
2 2 2
Chapter 9. Input Modeling 54
1
t t +
Computer Science, Informatik 4 Communication and Distributed Systems
1 1
−
t t t t
1
−
t t
1 and , 1 with d distribute lly exponentia i.i.d. are , , where
3 2
< ≤ = … φ μ ε ε /λ
ε
1)
t t X
2 1
+
t t X
Chapter 9. Input Modeling 55
1
t t +
Computer Science, Informatik 4 Communication and Distributed Systems
1) Collecting the raw data 2) Id tif i th d l i t ti ti l di t ib ti 2) Identifying the underlying statistical distribution 3) Estimating the parameters 4) Testing for goodness of fit
Chapter 9. Input Modeling 56