Professional Documents
Culture Documents
kr
DISCRETE-EVENT
SYSTEM
SIMULTI!N
"err# $ank% "ohn S. Car%on II
$arr# L. Nel%on Da&'( M. N'col
Th'r( E('t'on
http://tolerance.ajou.ac.kr
)art I. Intro(uct'on to D'%crete-E&ent
S#%te* S'*ulat'on
Ch.+ Intro(uct'on to S'*ulat'on
Ch., S'*ulat'on E-a*ple%
Ch.. /eneral )r'nc'ple%
Ch.0 S'*ulat'on So1t2are
http://tolerance.ajou.ac.kr
Ch. + Intro(uct'on to S'*ulat'on
S'*ulat'on
Mo(el 5u'l('n4 re<u're% %pec'al tra'n'n4. It '% an art that '% learne(
o&er t'*e an( throu4h e-per'ence. @urther*ore3 '1 t2o *o(el% are
con%tructe( 5# t2o co*petent 'n('&'(ual%3 the# *a# ha&e
%'*'lar't'e%3 5ut 't '% h'4hl# unl'kel# that the# 2'll 5e the %a*e.
S'*ulat'on '% u%e( 'n %o*e ca%e% 2hen an anal#t'cal %olut'on '%
po%%'5le3 or e&en pre1era5le3 a% ('%cu%%e( 'n Sect'on +.,. Th'%
*'4ht 5e part'cularl# true 'n the %'*ulat'on o1 %o*e 2a't'n4 l'ne%
2here clo%e(-1or* <ueue'n4 *o(el% are a&a'la5le.
http://tolerance.ajou.ac.kr
+.0 rea% o1 ppl'cat'on 8+9
7SC87'nter S'*ulat'on Con1erence9 : http://222.2'nter%'*.or4
Manu1actur'n4 ppl'cat'on%
Se*'con(uctor Manu1actur'n4
Con%truct'on En4'neer'n4
M'l'tar# ppl'cat'on
Mo(el'n4 lea(er%h'p e11ect% an( recru't t#pe 'n an r*# recru't'n4 %tat'on
Cu'ck-re%pon%e replen'%h*ent
http://tolerance.ajou.ac.kr
+.0 rea% o1 ppl'cat'on 809
=u*an S#%te*%
/)SS/=
TM
or %pec'al-purpo%e %'*ulat'on %o1t2are
+.++ Step% 'n a S'*ulat'on Stu(# 8+9
http://tolerance.ajou.ac.kr
+.++ Step% 'n a S'*ulat'on Stu(# 8,9
Ver'1'e(I
!nce the# jo'n the 2a't'n4 l'ne3 the# are e&entuall# %er&e(.
Ser&'ce t'*e% are o1 %o*e ran(o* len4th accor('n4 to a
pro5a5'l't# ('%tr'5ut'on 2h'ch (oe% not chan4e o&er t'*e.
The %#%te* capac't# ha% no l'*'t3 *ean'n4 that an#
nu*5er o1 un't% can 2a't 'n l'ne.
@'nall#3 un't% are %er&e( 'n the or(er o1 the'r arr'&al 8o1ten
calle( @I@!: @'r%t In3 @'r%t out9 5# a %'n4le %er&er or
channel.
http://tolerance.ajou.ac.kr
rr'&al% an( %er&'ce% are (e1'ne( 5# the ('%tr'5ut'on o1
the t'*e 5et2een arr'&al% an( the ('%tr'5ut'on o1 %er&'ce
t'*e%3 re%pect'&el#.
@or an# %'*ple %'n4le- or *ult'-channel <ueue3 the
o&erall e11ect'&e arr'&al rate *u%t 5e le%% than the total
%er&'ce rate3 or the 2a't'n4 l'ne 2'll 4ro2 2'thout 5oun(.
Note that the %er&er ha% onl# t2o po%%'5le %tate% : 't '%
e'ther 5u%# or '(le.
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8D9
Departure
E&ent
Re*o&e the 2a't'n4
un't 1ro* the <ueue
$e4'n %er&'c'n4 the
un't
$e4'n
%er&er '(le
t'*e
nother
un't
2a't'n4I
Ye% No
@'4. ,., Ser&'ce-ju%t-co*plete( 1lo2
('a4ra*
http://tolerance.ajou.ac.kr
The arr'&al e&ent occur% 2hen a un't enter% the %#%te*.
%%u*pt'on%
N !nl# one checkout counter.
N Cu%to*er% arr'&e at th'% checkout counter at ran(o* 1ro* +
to G *'nute% apart. Each po%%'5le &alue o1 'nterarr'&al t'*e
ha% the %a*e pro5a5'l't# o1 occurrence3 a% %ho2n 'n Ta5le ,.E.
N The %er&'ce t'*e% &ar# 1ro* + to E *'nute% 2'th the
pro5a5'l't'e% %ho2n 'n Ta5le ,.F.
N The pro5le* '% to anal#:e the %#%te* 5# %'*ulat'n4 the arr'&al
an( %er&'ce o1 ,A cu%to*er%.
Checkout Counter
rr'&al Departure
http://tolerance.ajou.ac.kr
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8+D9
http://tolerance.ajou.ac.kr
E-a*ple ,.+ 8Cont.9
The r'4ht*o%t t2o colu*n% o1 Ta5le% ,.E an( ,.F are u%e( to
4enerate ran(o* arr'&al% an( ran(o* %er&'ce t'*e%.
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8+E9
http://tolerance.ajou.ac.kr
E-a*ple ,.+ 8Cont.9 Ta5le ,.G
The 1'r%t ran(o* ('4't% are H+.. To o5ta'n the corre%pon('n4 t'*e
5et2een arr'&al%3 enter the 1ourth colu*n o1 Ta5le ,.E an( rea( G
*'nute% 1ro* the 1'r%t colu*n o1 the ta5le.
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8+F9
http://tolerance.ajou.ac.kr
E-a*ple ,.+ 8Cont.9 Ta5le ,.H
The 1'r%t cu%to*erO% %er&'ce t'*e '% 0 *'nute% 5ecau%e the ran(o*
('4't% G0 1all 'n the 5racket E+-GD
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8+G9
http://tolerance.ajou.ac.kr
E-a*ple ,.+ 8Cont.9
0
) ( ) (
s
s sp S E
(min) 2 . 3 ) 05 . 0 ( 6 ) 10 . 1 ( 5 ) 25 . 0 ( 4 ) 30 . 0 ( 3 ) 20 . 0 ( 2 ) 10 . 0 ( 1 ) ( + + + + + S E
The e-pecte( %er&'ce t'*e '% %l'4htl# lo2er than the a&era4e %er&'ce
t'*e 'n the %'*ulat'on. The lon4er the %'*ulat'on3 the clo%er the
a&era4e 2'll 5e to ) (S E
http://tolerance.ajou.ac.kr
arrivals of numbers
arrivals between times all of sum
arrivals between time average
(min) 5 . 4
2
8 1
2
) (
+
b a
A E
The lon4er the %'*ulat'on3 the clo%er the a&era4e 2'll 5e to ) ( A E
E-a*ple ,.+ 8Cont.9
http://tolerance.ajou.ac.kr
(r'&e-'n re%taurant 2here carhop% take or(er% an( 5r'n4 1oo( to the
car.
%%u*pt'on%
N Car% arr'&e 'n the *anner %ho2n 'n Ta5le ,.++.
N T2o carhop% 5le an( $aker - 5le '% 5etter a5le to (o the jo5 an(
2ork% a 5't 1a%ter than $aker.
N The ('%tr'5ut'on o1 the'r %er&'ce t'*e% '% %ho2n 'n Ta5le% ,.+, an(
,.+..
http://tolerance.ajou.ac.kr
E-a*ple ,., 8Cont.9
The ro2 1or the 1'r%t cu%to*er '% 1'lle( 'n *anuall#3 2'th the
ran(o*-nu*5er 1unct'on RND89 'n ca%e o1 E-cel or another
ran(o* 1unct'on replac'n4 the ran(o* ('4't%.
1ter the 1'r%t cu%to*er3 the cell% 1or the other cu%to*er% *u%t 5e
5a%e( on lo4'c an( 1or*ula%. @or e-a*ple3 the >Clock T'*e o1
rr'&al? 8colu*n D9 'n the ro2 1or the %econ( cu%to*er '%
co*pute( a% 1ollo2%:
D, P D+ Q C,
The lo4'c to co*puter 2ho 4et% a 4'&en cu%to*er can u%e the
E-cel *acro 1unct'on I@893 2h'ch return% one o1 t2o &alue%
(epen('n4 on 2hether a con('t'on '% true or 1al%e.
I@8 con('t'on3 &alue '1 true3 &alue '1 1al%e9
http://tolerance.ajou.ac.kr
I
s
A
b
l
e
i
d
l
e
?
A
b
l
e
s
e
r
v
i
c
e
b
e
g
i
n
(
c
o
l
u
m
n
F
)
I
s
B
a
k
e
r
i
d
l
e
?
B
a
k
e
r
s
e
r
v
i
c
e
b
e
g
i
n
(
c
o
l
u
m
n
I
)
N
o
t
h
i
n
g
I
s
i
t
t
i
m
e
o
f
a
r
r
i
v
a
l
?
c
l
o
c
k
=
0
I
n
c
r
e
m
e
n
t
c
l
o
c
k
I
s
t
h
e
r
e
t
h
e
s
e
r
v
i
c
e
c
o
m
p
l
e
t
e
d
?
e
n
e
r
a
t
e
r
a
n
d
o
m
d
i
g
i
t
f
o
r
s
e
r
v
i
c
e
(
c
o
l
u
m
n
!
)
"
o
n
v
e
r
t
r
a
n
d
o
m
d
i
g
i
t
t
o
r
a
n
d
o
m
n
u
m
b
e
r
f
o
r
s
e
r
v
i
c
e
t
i
m
e
(
c
o
l
u
m
n
e
n
e
r
a
t
e
r
a
n
d
o
m
d
i
g
i
t
f
o
r
s
e
r
v
i
c
e
(
c
o
l
u
m
n
!
)
"
o
n
v
e
r
t
r
a
n
d
o
m
d
i
g
i
t
t
o
r
a
n
d
o
m
n
u
m
b
e
r
f
o
r
s
e
r
v
i
c
e
t
i
m
e
(
c
o
l
u
m
n
#
)
$
t
o
r
e
c
l
o
c
k
t
i
m
e
(
c
o
l
u
m
n
%
o
r
&
)
N o N o
N o
N o
'
e
s
'
e
s
'
e
s
'
e
s
http://tolerance.ajou.ac.kr
E-a*ple ,., 8cont.9
The lo4'c re<u're% that 2e co*pute 2hen 5le an( $aker 2'll
5eco*e 1ree3 1or 2h'ch 2e u%e the 5u'lt-'n E-cel 1unct'on 1or
*a-'*u* o&er a ran4e3 MB89.
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8,F9
)))) 9 : 1 $ ( ), 9 : 1 $ ( (
, " " ), 9 : 1 $ ( 10 ( , 10 ), 9 : 1 $ ( 10 ( 10
K K MAX H H MAX MIN
K K MAX I! H H MAX I! ! > >
I1 the 1'r%t con('t'on 85le '(le 2hen cu%to*er +A arr'&e%9 '% true3
then the cu%to*er 5e4'n% '**e('atel# at the arr'&al t'*e 'n D+A.
!ther2'%e3 a %econ( I@89 1unct'on '% e&aluate(3 2h'ch %a#% '1 $aker
'% '(le3 put noth'n4 8..9 'n the cell. !ther2'%e3 the 1unct'on return%
the t'*e that 5le or $aker 5eco*e% '(le3 2h'che&er '% 1'r%t Rthe
*'n'*u* or MIN89 o1 the'r re%pect'&e co*plet'on t'*e%S.
%'*'lar 1or*ula appl'e% to cell I+A 1or >T'*e Ser&'ce $e4'n%? 1or
$aker.
http://tolerance.ajou.ac.kr
E-a*ple ,., 8Cont.9
@or %er&'ce t'*e% 1or 5le3 #ou coul( u%e another I@89 1unct'on to
*ake the cell 5lank or ha&e a &alue:
/+A P I@8@+A T A3ne2 %er&'ce t'*e3 UU9
=+A P I@8@+A T A3 @+AQ/+A3 UU9
,.+ S'*ulat'on o1 Cueue'n4 S#%te*% 8,G9
http://tolerance.ajou.ac.kr
The anal#%'% o1 Ta5le ,.+0 re%ult% 'n the 1ollo2'n4:
!&er the E,-*'nute per'o( 5le 2a% 5u%# HAV o1 the t'*e.
$aker 2a% 5u%# onl# EHV o1 the t'*e. The %en'or't# rule
keep% $aker le%% 5u%# 8an( 4'&e% 5le *ore t'p%9.
In an 8M3N9 'n&entor# %#%te*3 the e&ent% that *a# occur are: the
(e*an( 1or 'te*% 'n the 'n&entor#3 the re&'e2 o1 the 'n&entor#
po%'t'on3 an( the rece'pt o1 an or(er at the en( o1 each re&'e2
per'o(.
,., S'*ulat'on o1 In&entor# S#%te*% 8,9
http://tolerance.ajou.ac.kr
E-a*ple ,.. The Ne2%paper Seller;% )ro5le*
The paper %eller 5u#% the paper% 1or .. cent% each an(
%ell% the* 1or DA cent% each. 8The lo%t pro1't 1ro* e-ce%%
(e*an( '% +F cent% 1or each paper (e*an(e( that coul(
not 5e pro&'(e(.9
,
_
,
_
,
_
,
_
papers scrap of
sale from salvage
demand e"cess
from profit lost
newspapers
of t
sales from
revenue
#ofit
cos
!n (a# + the (e*an( '% 1or EA ne2%paper%. The re&enue 1ro* the %ale o1
EA ne2%paper% '% W.A.AA.
The pro1't 1or the ,A-(a# per'o( '% the %u* o1 the (a'l# pro1't%3
W+F0.HA. It can al%o 5e co*pute( 1ro* the total% 1or the ,A (a#% o1
the %'*ulat'on a% 1ollo2%:
Not'ce that the 5e4'nn'n4 'n&entor# on the %econ( (a# o1 the th'r(
c#cle 2a% :ero. n or(er 1or , un't% on that (a# le( to a %horta4e
con('t'on. The un't% 2ere 5ackor(ere( on that (a# an( the ne-t
(a# al%o. !n the *orn'n4 o1 (a# 0 o1 c#cle . there 2a% a 5e4'nn'n4
'n&entor# o1 H un't%. The 0 un't% that 2ere 5ackor(ere( an( the +
un't (e*an(e( that (a# re(uce( the en('n4 'n&entor# to 0 un't%.
The ('rect on-%'te co%t o1 the repa'rper%on '% W+D per hour.
Note that there are 'n%tance% 2here *ore than one 5ear'n4
1a'l% at the %a*e t'*e.
Th'% '% unl'kel# to occur 'n pract'ce an( '% (ue to u%'n4 a
rather coar%e 4r'( o1 +AA hour%.
It 2'll 5e a%%u*e( 'n th'% e-a*ple that the t'*e% are ne&er
e-actl# the %a*e3 an( thu% no *ore than one 5ear'n4 '%
chan4e( at an# 5reak(o2n. S'-teen 5ear'n4 chan4e% 2ere
*a(e 1or 5ear'n4% + an( ,3 5ut onl# +0 5ear'n4 chan4e%
2ere re<u're( 1or 5ear'n4 ..
,.. !ther E-a*ple% o1 S'*ulat'on 8.9
http://tolerance.ajou.ac.kr
E-a*ple ,.D 8Cont.9
Co%t o1 repa'rper%on% P
0E 5ear'n4% ,A *'nute%/5ear'n4 W+D/EA *'nute% P
W,.A
S'nce the propo%e( *etho( u%e% *ore 5ear'n4% than the current
*etho(3 the %econ( %'*ulat'on u%e% ne2 ran(o* ('4't% 1or
4enerat'n4 the a(('t'onal l'1et'*e%.
The ran(o* ('4't% that lea( to the l'&e% o1 the a(('t'onal 5ear'n4%
are %ho2n a5o&e the %la%he( l'ne 5e4'nn'n4 2'th the +D
th
replace*ent o1 5ear'n4 ..
cla%%'c %'*ulat'on
pro5le* '% that o1 a
%<ua(ron o1 5o*5er%
atte*pt'n4 to (e%tro#
an a**un't'on (epot
%hape( a% %ho2n 'n
@'4ure ,.G.
http://tolerance.ajou.ac.kr
E-a*ple ,.E 8Cont.9
The a'*'n4 po'nt '% the (ot locate( 'n the heart o1 the
a**un't'on (u*p.
X
$
+ $ X
In th'% e-a*ple the a'*'n4 po'nt can 5e con%'(ere( a% 8A3 A9Y that
'%3 the &alue 'n the hor':ontal ('rect'on '% A3 an( %'*'larl# 1or the
&alue 'n the &ert'cal ('rect'on.
X
$ X
%
$ %
2here 8B3Y9 are the %'*ulate( coor('nate% o1 the 5o*5 a1ter 't ha%
1allen
an(
600
X
300
%
i
$ X 600
i
$ % 300
http://tolerance.ajou.ac.kr
E-a*ple ,.E 8Cont.9
@or E-cel3 u%e the Ran(o* Nu*5er /enerat'on tool 'n the
nal#%'% Took)ak ((-In to 4enerate an# nu*5er o1 nor*al
ran(o* &alue% 'n a ran4e o1 cell%.
The ta5le o1 ran(o* nor*al nu*5er% '% u%e( 'n the %a*e
2a# a% the ta5le o1 ran(o* nu*5er%.
Taken to4ether3 8-DA03 +HG9 '% a *'%%3 1or 't '% o11 the
tar4et.
The lea( t'*e '% the t'*e 1ro* place*ent o1 an or(er unt'l
the or(er '% rece'&e(.
'
i
i
0
http://tolerance.ajou.ac.kr
E-a*ple ,.F 8Cont.9
the ent't'e% that pa%% throu4h the %#%te* an( the ent't'e% that
repre%ent %#%te* re%ource%
Cu'te o1ten3 a (ela#O% (urat'on '% *ea%ure( an( '% one o1 the
(e%'re( output% o1 a *o(el run.
cu%to*erO% (ela# 'n a 2a't'n4 l'ne *a# 5e (epen(ent on the
nu*5er an( (urat'on o1 %er&'ce o1 other cu%to*er% ahea( 'n
l'ne a% 2ell a% the a&a'la5'l't# o1 %er&er% an( e<u'p*ent.
..+Concept% 'n D'%crete-E&ent S'*ulat'on 8D9
=o2 lon4 to 2a'tI
http://tolerance.ajou.ac.kr
..+Concept% 'n D'%crete-E&ent S'*ulat'on 8E9
Dela# ct'&'t#
7hat %o
calle(
a con('t'onal 2a't an uncon('t'onal 2a't
co*plet'on a %econ(ar# e&ent a pr'*ar# e&ent
*ana4e*ent
5# plac'n4 an e&ent
not'ce on the @EL
5# plac'n4 the
a%%oc'ate( ent't# on
another l'%t3 not the @EL3
perhap% repre-%ent'n4 a
2a't'n4 l'ne
S#%te* %tate3 ent't# attr'5ute% an( the nu*5er o1 act'&e ent't'e%3 the
content% o1 %et%3 an( the act'&'t'e% an( (ela#% currentl# 'n pro4re%%
are all
1unct'on% o1 t'*e an( are con%tantl# chan4'n4 o&er t'*e.
S#%te* %tate
E&ent%
rr'&al e&ent
ct'&'t'e%
to conta'n all e&ent not'ce% 1or e&ent% that ha&e 5een %che(ule( to
occur at a 1uture t'*e.
In @'4ure ..,3 '1 t P A3 then the %tate 8D3 +3 E9 *'4ht repre%ent the
'n't'al nu*5er o1 cu%to*er% at three ('11erent po'nt% 'n the %#%te*.
=o2 1uture e&ent% are 4enerate(I
7hen the CL!C[ '% e&entuall# a(&ance( to the t'*e o1 th'% en(-o1-
(o2nt'*e e&ent3 a runt'*e '% 4enerate( an( an en(-o1-runt'*e
e&ent
%che(ule( on the @EL.
,. Run len4th T
E
'% (eter*'ne( 5# the %'*ulat'on 't%el1. /enerall#3 T
E
'% the
t'*e o1
occurrence o1 %o*e %pec'1'e( e&ent E.
E-9 the t'*e o1 the +AAth %er&'ce co*plet'on at a certa'n %er&'ce center.
the t'*e o1 5reak(o2n o1 a co*ple- %#%te*.
the t'*e o1 ('%en4a4e*ent or total k'll 'n a co*5at %'*ulat'on.
the t'*e at 2h'ch a ('%tr'5ut'on center %h'p% the la%t carton 'n a (a#O%
or(er%.
In ca%e ,3 T
E
'% not kno2n ahea( o1 t'*e. In(ee(3 't *a# 5e one o1 the
%tat'%t'c% o1 pr'*ar# 'ntere%t to 5e pro(uce( 5# the %'*ulat'on.
..+.+. The E&ent-Sche(ul'n4/T'*e-(&ance( l4or'th* 8F9
http://tolerance.ajou.ac.kr
7orl( &'e2%
: the e&ent-%che(ul'n4 2orl( &'e23 the proce%%-'nteract'on 2orl( &'e23 an(
the
act'&'t#-%cann'n4 2orl( &'e2.
The proce%%-'nteract'on approach
So*e act'&'t'e% *a# re<u're the u%e o1 one or *ore re%ource% 2ho%e
capac't'e% are l'*'te( 8<ueue'n49.
..+.,. 7orl( V'e2% 8+9
http://tolerance.ajou.ac.kr
The proce%%-'nteract'on approach 8Cont.9
t each clock a(&ance3 the con('t'on% 1or each act'&'t# are checke(
an(3
'1 the con('t'on% are true3 then the corre%pon('n4 act'&'t# 5e4'n%.
Three-pha%e approach
: to co*5'ne pure act'&'t#-%cann'n4 approach 2'th the 1eature% o1
e&ent
%che(ul'n43 &ar'a5le t'*e a(&ance.
: e&ent% are con%'(ere( to 5e act'&'t'e% o1 (urat'on-:ero t'*e un't%.
..+.,. 7orl( V'e2% 8.9
http://tolerance.ajou.ac.kr
The act'&'t#-%cann'n4 approach 8Cont.9
)ha%e : Re*o&e the '**'nent e&ent 1ro* the @EL an( a(&ance the
clock
to 't% e&ent t'*e. Re*o&e an# other e&ent% 1ro* the @EL
that
ha&e the %a*e e&ent t'*e.
)ha%e $ : E-ecute all $-t#pe e&ent% that 2ere re*o&e( 1ro* the @EL.
)ha%e C : Scan the con('t'on% that tr'44er each C-t#pe act'&'t# an(
act'&ate an# 2ho%e con('t'on% are *et. Re%can unt'l no
a(('t'onal C-t#pe act'&'t'e% can 5e4'n or e&ent% occur.
..+.,. 7orl( V'e2% 809
http://tolerance.ajou.ac.kr
EBM)LE .., 85le an( $aker3 $ack 4a'n9
E&ent% :
rr'&al 89
Departure 8D9
ct'&'t'e% :
In't'al con('t'on%
LC8A9 P A3 LS8A9 P +
a
\
: the 4enerate( 'nterarr'&al t'*e
%
\
: the 4enerate( %er&'ce t'*e%
The %'*ulat'on 'n Ta5le ..+ co&er% the t'*e 'nter&al RA3 ,+S.
..+... Manual S'*ulat'on U%'n4 E&ent Sche(ul'n4 8.9
http://tolerance.ajou.ac.kr
..+... Manual S'*ulat'on U%'n4 E&ent Sche(ul'n4 809
http://tolerance.ajou.ac.kr
E-a*ple ..0 8The Checkout-Counter S'*ulat'on3
Cont'nue(9
E&ent not'ce% :
The %'*ulat'on ta5le 1or E-a*ple ..0 '% %ho2n 'n Ta5le ..,.
The purpo%e o1 the %'*ulat'on '% to e%t'*ate the loa(er an( %cale
ut'l':at'on% 8percenta4e o1 t'*e 5u%#9.
http://tolerance.ajou.ac.kr
E&ent not'ce% :
L'%t% :
I1 at th'% t'*e there '% another truck 2a't'n4 1or a loa(er3 't 2'll
5e re*o&e( 1ro* the loa(er <ueue an( 2'll 5e4'n loa('n4 5#
the %che(ul'n4 o1 an en(-loa('n4 e&ent 8EL9 on the @EL.
2hen t'*e '% a(&ance( an( the '**'nent e&ent '% (ue to 5e
e-ecute(.
'1 a <ueue ha% a rank'n4 rule o1 earl'e%t (ue (ate 1'r%t 8ED@9.
to %tore the 1'r%t recor( 'n R8+93 the %econ( 'n R8,93 an( %o on3 an(
the la%t 'n R8ta'lptr93 2here ta'lptr '% u%e( to re1er to the la%t 'te*
'n the l'%t.
Suppo%e that the ent't'e% are %tore( 'n recor(% 'n an arra#
('*en%'one( 1ro* + to E3 one recor( 1or each (u*p truck.
http://tolerance.ajou.ac.kr
E-a*ple ..F 8Cont.9
t CL!C[ t'*e +A3 the l'%t o1 ent't'e% 'n the 2e'4h <ueue
2oul( 5e (e1'ne( 5#:
..,., U%'n4 rra#% 1or L'%t )roce%%'n4 809
hea(ptr P .
R8+9 P RDT+3 A.A3 AS
R8,9 P RDT,3 +A.A3 0S
R8.9 P RDT.3 D.A3 ,S
R809 P RDT03 +A.A3 AS
R8D9 P RDTD3 A.A3 AS
R8E9 P RDTE3 A.A3 AS
ta'lptr P 0
http://tolerance.ajou.ac.kr
E-a*ple ..F 8Cont.9
@or e-a*ple3 '1 R '% %et e<ual to the hea( po'nter 1or the
@EL at
R-Te&entt#pe P E7
R-Te&entt'*e P +,
R-Tne-t : the po'nter 1or the %econ( e&ent not'ce on the @EL
%o that
R-Tne-t-Te&entt#pe P EL
R-Tne-t-Te&entt'*e P ,A
@!RTRN3 C3 CQQ
/)SS/=
TM
3 SIMN V
^
S'*ulat'on En&'ron*ent%
Ser&'ce t'*e
/'&en a nu*5er o1 1actor% that a11ect the %#%te* per1or*ance3 't '%
u%e1ul to %eparate out the e11ect% o1 'n('&'(ual 1actor%.
E-. 8+.09 The per1or*ance o1 a %#%te* (epen(% on the 1ollo2'n4 three
1actor%
8a9 /ar5a4e collect'on techn'<ue u%e(: /+3 /,3 or none.
859 T#pe o1 2orkloa(: e('t'n43 co*put'n43 or art'1'c'al 'ntell'4ence 8I9.
8c9 T#pe o1 C)U: C+3 C,3 or C.
=o2 *an# e-per'*ent% are nee(e(I =o2 (oe% one e%t'*ate the
per1or*ance '*pact o1 each 1actorI
+.+ !utl'ne o1 Top'c% 8D9
http://tolerance.ajou.ac.kr
D. )er1or*ance %'*ulat'on% correctl#.
@actor D 7orkloa( C
)'ck up
a% *#
l'ke%
http://tolerance.ajou.ac.kr
nal#%'% 2'thout Un(er%tan('n4 the )ro5le*
S#%te* para*eter%
- <uantu* %':e : C)U allocat'on
- 2ork'n4 %et %':e : *e*or# allocat'on
7orkloa( para*eter%
- the nu*5er o1 u%er%
- re<ue%t arr'&al pattern%
- pr'or't#
,.+ Co**on M'%take% 'n
)er1or*ance E&aluat'on 8G9
http://tolerance.ajou.ac.kr
I4nor'n4 S'4n'1'cant @actor%
)ara*eter% that are &ar'e( 'n the %tu(# are calle( 1actor%.
It '% o1ten a%%u*e( that the 1uture 2'll 5e the %a*e a% the
pa%t.
S#%te* para*eter%
: =ar(2are/So1t2are para*eter%
: The%e 4enerall# (o not &ar# a*on4 &ar'ou% 'n%tallat'on%
o1 the
%#%te*.
7orkloa( para*eter%
: Character'%t'c% o1 u%er;% re<ue%t%
: The%e &ar# 1or* one 'n%tallat'on to the ne-t.
,., S#%te*at'c pproach to
)er1or*ance E&aluat'on 809
http://tolerance.ajou.ac.kr
Select @actor% to Stu(#
!nce #ou ha&e a l'%t o1 1actor% an( the'r le&el%3 #ou nee(
to
(ec'(e on a %e<uence o1 e-per'*ent% that o11er *a-'*u*
'n1or*at'on 2'th *'n'*al e11ort.
S#%te*
Ca%e Stu(# ,.+ 8,9
Cl'net
Ser&er
Net2ork
S#%te*
http://tolerance.ajou.ac.kr
Ser&'ce%
Data tran%1er '% cho%en a% the appl'cat'on an( the call% 2'll
5e
cla%%'1'e( %'*pl# a% %*all or lar4e (epen('n4 upon the
a*ount
o1 (ata to 5e tran%1erre( to the re*ote *ach'ne.
)er1or*ance Metr'c%
- Elap%e( t'*e per call
- Ma-'*u* call rate per un't o1 t'*e or e<u'&alentl#3 the
t'*e
re<u're( to co*plete a 5lock o1 n %ucce%%'&e call%
- Local C)U t'*e per call
- Re*ote C)U t'*e per call
- Nu*5er o1 5#te% %ent on the l'nk per call
Ca%e Stu(# ,.+ 809
http://tolerance.ajou.ac.kr
)ara*eter%
S#%te* )ara*eter
Spee( o1 the local C)U3 the re*ote C)U3 an( the net2ork
7orkloa( )ara*eter%
T#pe o1 channel
T#pe o1 channel
: T2o t#pe Z re*ote p'pe% an( re*ote proce(ure call%
E-per'*ent% 2'll 5e con(ucte( 2hen there '% &er# l'ttle other loa(
on
the ho%t% an( the net2ork.
Ca%e Stu(# ,.+ 8E9
http://tolerance.ajou.ac.kr
E&aluat'on Techn'<ue
Re%pon%e t'*e: the (ela# 'n%'(e the net2ork 1or 'n('&'(ual packet%.
n
i
i
n
i
i
n
" n
"
" " " f
1
2
1
2
2 1
) (
) , , , (
@or all nonne4at'&e &alue% o1 -
'
;%3 the 1a'rne%% 'n(e- al2a#%
l'e%
5et2een A an( +.
I1 onl# k o1 the n u%er% rece'&e e<ual throu4hput an( the
re*a'n'n4 n-k u%er% rece'&e :ero throu4hput3 the 1a'rne%%
'n(e- '% k/n.
http://tolerance.ajou.ac.kr
1ter a 1e2 e-per'*ent%3 't 2a% clear that throu4hput an(
(ela#
2ere reall# re(un(ant *etr'c%. ll %che*e% that re%ulte( 'n
h'4her throu4hput al%o re%ulte( 'n h'4her (ela#.
The &ar'ance 'n re%pon%e t'*e 2a% (roppe( %'nce 't 2a%
re(un(ant
2'th the pro5a5'l't# o1 (upl'cat'on an( the pro5a5'l't# o1
('%connect'on.
Ca%e Stu(# ..+ 8D9
http://tolerance.ajou.ac.kr
... Co**onl# U%e( )er1or*ance
Metr'c% 8+9
Re%pon%e t'*e : the 'nter&al 5et2een a u%er;% re<ue%t an( the
%#%te* re%pon%e3 a% %ho2n 'n @'4ure ..,a.
- Th'% (e1'n't'on '% %'*pl'%t'c %'nce the re<ue%t% a% 2ell a% the
re%pon%e% are not 'n%tantaneou%.
The u%er %pen( t'*e t#p'n4 the re<ue%t an( the %#%te* take%
t'*e
outputt'n4 the re%pon%e3 a% %ho2 'n @'4ure ..,5.
- It can 5e (e1'ne( a% e'ther the 'nter&al 5et2een the en( o1 a
re<ue%t %u5*'%%'on an( the 5e4'nn'n4 o1 the corre%pon('n4
re%pon%e 1ro* the %#%te* or a% the 'nter&al 5et2een the en(
o1 a
re<ue%t %u5*'%%'on an( the en( o1 the corre%pon('n4
re%pon%e
1or* the %#%te*%.
http://tolerance.ajou.ac.kr
U%erO% re<ue%t S#%te*O% re%pon%e
Re%pon%e t'*e
T'*e
8a9 In%tantaneou% re<ue%t an( re%pon%e
U%er
%tart%
re<ue%t
U%er
1'n'%h%
re<ue%t
S#%te*
%tart%
e-ecut'on
S#%te*
%tart%
re%pon%e
S#%te*
co*plete%
re%pon%e
U%er %tart%
ne-t
re<ue%t
React'on
t'*e
Re%pon%e
t'*e
8De1'n't'on +9
Re%pon%e
t'*e
8De1'n't'on ,9
Th'nk
t'*e
859 Real'%t'c re<ue%t an( re%pon%e
T'*e
http://tolerance.ajou.ac.kr
Turnaroun( t'*e : the t'*e 5et2een the %u5*'%%'on o1 a 5atch
jo5
an( the co*plet'on o1 't% output.
- Not'ce that the t'*e to rea( the 'nput '% 'nclu(e( 'n the
turnaroun( t'*e.
React'on t'*e : the t'*e 5et2een %u5*'%%'on o1 a re<ue%t an(
the
5e4'nn'n4 o1 't% e-ecut'on 5# the %#%te*
- To *ea%ure the react'on t'*e3 one ha% to a5le to *on'tor the
act'on% 'n%'(e a %#%te* %'nce the 5e4'nn'n4 o1 the e-ecut'on
*a# not corre%pon( to an# e-ternall# &'%'5le e&ent.
Stretch 1actor : the rat'o o1 re%pon%e t'*e at a part'cular loa(
to
that at the *'n'*u* loa(
- The re%pon%e t'*e o1 a %#%te* 4enerall# 'ncrea%e% a% the
loa(
on the %#%te* 'ncrea%e%.
... Co**onl# U%e( )er1or*ance
Metr'c% 8,9
http://tolerance.ajou.ac.kr
Throu4hput '% (e1'ne( a% the rate 8re<ue%t% per un't o1 t'*e9 at
2h'ch the re<ue%t% can 5e %er&'ce( 5# the %#%te*.
- @or 5atch %#%te*%3 jo5% per %econ(.
- @or 'nteract'&e %#%te*%3 re<ue%t% per %econ(.
- @or C)U3 MI)S8M'll'on% o1 In%truct'on% )er Secon(93 or M@L!)S
8M'll'on% o1 @loat'n4-)o'nt !perat'on% )er Secon(9
- @or net2ork%3 packet% per %econ(8pp%9 or 5't% per
%econ(85p%9
- @or tran%act'on% proce%%'n4 %#%te*3 T)S8Tran%act'on% )er
Secon(9
1ter a certa'n loa(3 the throu4hput %top% 'ncrea%'n4Y 'n *o%t
ca%e%3 't *a# e&ent %tart (ecrea%'n43 a% %ho2n 'n @'4ure ....
... Co**onl# U%e( )er1or*ance
Metr'c% 8.9
http://tolerance.ajou.ac.kr
_
[nee
[nee
capac't#
U%a5le
capac't#
No*'nal
capac't#
_
Loa(
Loa(
Throu4hput
Re%pon%e
t'*e
http://tolerance.ajou.ac.kr
No*'nal capac't# : the *a-'*u* ach'e&a5le throu4hput un(er
'(eal
2orkloa( con('t'on%
U%a5le capac't# : It '% *ore 'ntere%t'n4 to kno2 the *a-'*u*
throu4hput ach'e&a5le 2'thout e-cee('n4 a
pre%pec'1'e( re%pon%e t'*e l'*'t.
[nee capac't# : the throu4hput at the knee
- In *an# appl'cat'on%3 the knee o1 the throu4hput or the
re%pon%e
t'*e cur&e '% con%'(ere( the opt'*al operat'n4 po'nt.
E11'c'enc# : the rat'o o1 *a-'*u* ach'e&a5le throu4hput
8u%a5le
capac't#9 to no*'nal capac't#
The ut'l':at'on o1 a re%ource '% *ea%ure( a% the 1unct'on o1
t'*e
the re%ource '% 5u%# %er&'c'n4 re<ue%t%. the rat'o o1 5u%#
t'*e
an( total elap%e( t'*e o&er a 4'&en per'o(.
... Co**onl# U%e( )er1or*ance
Metr'c% 809
http://tolerance.ajou.ac.kr
I(le t'*e : the per'o( (ur'n4 2h'ch a re%ource '% not 5e'n4
u%e(.
Rel'a5'l't# : the pro5a5'l't# o1 error% or 5# the *ean t'*e
5et2een
error%.
&a'la5'l't# : the 1ract'on o1 the t'*e the %#%te* '% a&a'la5le to
%er&'ce u%er;% re<ue%t%.
Do2nt'*e : the t'*e (ur'n4 2h'ch the %#%te* '% not a&a'la5le.
Upt'*e : the t'*e (ur'n4 2h'ch the %#%te* '% a&a'la5le8MTT@-
Mean
T'*e To @a'lure9.
Co%t/per1or*ance rat'o : a *etr'c 1or co*par'n4 t2o or *ore
%#%te*%.
... Co**onl# U%e( )er1or*ance
Metr'c% 8D9
http://tolerance.ajou.ac.kr
..0 Ut'l't# Cla%%'1'cat'on o1
)er1or*ance Metr'c%
='4her '% $etter or =$.
: S#%te* u%er% an( %#%te* *ana4er% pre1er h'4her &alue% o1
%uch
*etr'c%. E-9 S#%te* throu4hput
Lo2er '% $etter or L$.
: S#%te* u%er% an( %#%te* *ana4er% pre1er %*aller &alue% o1
%uch
*etr'c%. E-9 Re%pon%e t'*e
No*'nal '% $e%t or N$.
: $oth h'4h an( lo2 &alue% are un(e%'ra5le. E-9 Ut'l':at'on
@'4ure ..D %ho2% h#pothet'cal 4raph% o1 ut'l't# o1 the three
cla%%e%
o1 *etr'c%.
http://tolerance.ajou.ac.kr
8a9 Lo2er '% 5etter 859 ='4her '% 5etter
8c9 No*'nal '% 5e%t
Ut'l't# Ut'l't#
Ut'l't#
Metr'c Metr'c
Metr'c
$etter $etter
$e%t
http://tolerance.ajou.ac.kr
..D Sett'n4 )er1or*ance
Re<u're*ent% 8+9
T#p'cal re<u're*ent %tate*ent%
Non*ea%ura5le
Nonaccepta5le
Nonreal':a5le
Nonthrou4hput
http://tolerance.ajou.ac.kr
7hat all the%e pro5le*% lack can 5e %u**ar':e( 'n one 2or(
: SMRT8Spec'1'c3 Mea%ura5le3 ccepta5le3 Real':a5le3
Thorou4h9
+.
,.
..
0.
D.
E.
http://tolerance.ajou.ac.kr
+.
3 ! "#
$ %
& '() *+ %
http://tolerance.ajou.ac.kr
,.
+ , N
,-
+ , M
).-
/0 1
!
+
,
$
http://tolerance.ajou.ac.kr
,.
N 2 3$45 )6$4 78(9 2:
; <= >? & 2>9 @4A B ; C
DE5 <F >GH IJ !K LM& NO P @.
QR ; S T= UV 7W IJX YZ5 [\<
YZ ]; ^ _ %`
_a h ; >? bc>93 a pP+-
h d _
h: $a
p: e $a
http://tolerance.ajou.ac.kr
,.
_ ,
+. ; T= UV fg h _i j)k(; 7
QRi 8 :> l. 78 m n+ _o
p qrs c c+.
,. _ tu(v cw mo nc xyz93 {|>
}4v ~ UV f %`+. p q
rso M> tu$ _ 4G $ > _
i ( B _ n+ !Bi xy+. ) !2
xyz; ; m xyz H 78(9 2:
http://tolerance.ajou.ac.kr
,.
.. tu$Y _ nc { _ ^v3 1H <F2 !
& c z9 8 { _ YZv cw U
V F !& ( <F2 .
0. ! UV h3 _B tu$4 F B
o QR4 z293 B _ c xy !H mo
c. tu(> + _o ~ UV f
_ p%`.
$: t6 m ! n+ "# c
5 i ;2& :(;
http://tolerance.ajou.ac.kr
..
n?8$79
H a * w
x4 -
+ UV) h ! o $7H
9 $7; Y ! P :
X + UV 7W %`(; _ a UV %`
(; a 9 ] $ 2:(v3 QRo
$ernoull' QR cw
QR : 8+-p9/p
_o nc 3 8 & +9 2:
http://tolerance.ajou.ac.kr
..
' 2 j & _O a: p/M
' 2 j & _(> }i a: +- p/M
j $X (5 _ @i a
_a 78(9 $9 2:(v3 M
' & _O a f' ; .
+ UV Yz; ! _ )n
N
M p q ) / 1 ( 1
i M i
i q q
i
M
f
,
_
) 1 (
+
M
* i
*
i
i i f i f * *+
1
1
8 D.+9
8 D.,9
8 D..9
http://tolerance.ajou.ac.kr
..
:+ n?o _ p%`z> }; UV $
w _a8 e $a9: p3 _a: Np
8$Y " UVi 9c v w _a r
o e $a .
QR
_ Y _
- 5 +
T
_
http://tolerance.ajou.ac.kr
..
8 _a
rP85Q+9/T P 85Q+9/8-Q5Q+9
H <& 5Q+ 5v
rP+/R+Q-/85Q+9S
5Q+PrT : T 7W %` _ P
w _F: $7/N
TPN/$7
5Q+PNr/$7
r= (-.(/0B1-Nr2 r= (-.(/0B1-Nr2
http://tolerance.ajou.ac.kr
..
$7& :() *+ 9: 1Px 9s
+. 8D.+9 `8D..9 i ( j) n? $7A :i \
+.
,. ~ r :i \+.
r'P +/R+Q-$7'-+/Nr'-+S
+. <P+-8+-r'/M9 i \(9 8D.,9 H 8D..9 i (
: $7' & \+.
,. a$2'-$2'-+a b e v F(9 {|> }4v ,
.
N
http://tolerance.ajou.ac.kr
..
ePA.AAD Y " C 9s
real B1(p3B343n)
real p5 intB3 43 N5
6
real b703 b7(=p8N3 r=p3 0=(90-p:(903 B7i()5
do
6
b70 = b7(5 r=(90-((90/08b70-(N8r))5
b7(=B1i(r3B343N)5
;
7hile (fabs(b7(:b70) < 0900,)5
return(b7()5
;
http://tolerance.ajou.ac.kr
..
real B7i (r3B343N)
real r5 intB3 43 N5
6 -8 compute band7idth for re=uest rate r 8-
int I5 real =3 b7=0903 f()5
==(90:po7((90:r-43 (real)N)5
for(i=(5 i>B5 i//) b7 /= i8f(i343=)5
for(i=B5 i>=45 i//) b7 /= B8f(i343=)5
return (b7)5
;
real Fact(n)
int n5
6 -8 compute n factorial 8-
real ?=(905
7hile (n) 6?8=n5 n::5;
return (?)5
;
http://tolerance.ajou.ac.kr
..
real "(n3k)
int n3k5
6 -8 compute binomial coefficient 8-
return (Fact (n)-Fact(k) 8 Fact(n:k)))5
;
real f(i343=)
int i3 45 real =5
6 -8 compute binomial probabilit@ 8-
real ?5
?="(43i)8po7(=3(real)i)8po7((90:=3(real)(4:i))5
return(?)5
;
http://tolerance.ajou.ac.kr
..+ n)
8 !3 8 m {9 8 o
SS U5P$7/$3 U* {9 UpP-$7/N .
_w n) o 5 9 5 ; T---+ .
TPN/$7 9 -Q+P+/p 5 ; ~ .
5P8N/$79-8+/p9
http://tolerance.ajou.ac.kr
..,
L5 & w _ <9 (<.
4G
Ab=bB1 - N
X>A3 4G ~i O P @.
Ab=(:B1 - Np
http://tolerance.ajou.ac.kr
... ,
f *& M9 (9 S M; n Q
R i +9 (v3 Mw e o n-
.
4G ,o Up Mi P @.
e& *( n-P+ i N4 X :k
, B) & (; y(.
BC = NDp = N.0B1-N2 = B1.((-p):(2
http://tolerance.ajou.ac.kr
0.
' nc %(9< (;
; $ .
@X $o
R*& $( -(;2& '(; .
http://tolerance.ajou.ac.kr
0.+ +
#include <smpl.h>
#define busy 1
real
p=0.250, /* local memory miss rae */
re!"1#$ /* ne% re!ues ime for processor */
n=1.0&'( /* earlies)occurrin* re!ues ime */
in
+=,, -=., n/=2, /* no. processors, memories, 0 buses */
modole"1#$,bus, /* memory 0 bus faciliy descripors */
nbs=0, /* no. busy buses curren cycle */
re!"1#$, /* currenly)re!uesed memory module */
ne%=1, /* arbiraion scan sarin* poin */
http://tolerance.ajou.ac.kr
0.+ +
/*))))))))))) -&-123)/45 /6+7897:; -17&<)))))*/
main=> ?
in e@en, i,n(
smpl =0, AbandBidh -odelC>(
for =i=1( i<=-, iDD> module "i$=faciliy=AmoduleC,1>(
for =n=1( n<=+( nDD> ?re!"nDD$ ?re!"n$=0( ne%Eaccess =n> (F
schedule=1,n,0>(
Bhile =ime=> < 10000.0>
?
cause =0e@en,0n> (
sBich =e@en> ?
case 1G be*inEcycle=> ( breaH(
case 2G re!Emodule=n> G breaH(
case IG end cycle=n>( breaH(
F
F
prinf=A/8=J.IfKnC, 4=bus>>(
http://tolerance.ajou.ac.kr
0.+ +
/)))))))))))L1-M4:& +&N: 6LL&55 :9-&)))))))))*/
nesEaccess=n>
in n(
?
real (
=floor=lo*=ranf=>>/lo*=1.0)p>>Dime=>(
re!"n$=( if=<n> hen n=(
F
ne-t]acce%%89 P2 S n+ j) d i :(9 tn
i \() *( Z
tre<RnS o %` > o 3 n ~
_ %`
tn o j %`+ _ %`
http://tolerance.ajou.ac.kr
0.+ +
; *2 ! UV3 o *
:P R(93 o UV f5 %`+.
5e4'n]c#cle89 o tn %`(; _ nc N
Bi ( + S nc mi
_ $> Ow(9 8 {9 !9 _ 3
, & +.
http://tolerance.ajou.ac.kr
0.+ +
re<]*o(ule89 o _ m 26(9 3 !2
26+2& ) *c '+.
B zv m !; xyz9 UV
Y 5u% <3 n5% 2 2. _ F; { U
V %`z .
_ m E5 !2 X P v 3 _o
~ UV f p%`z) *c .
. o + ! UV _ F& +. !
H m cz93 re<RnS o A 4 :zA
ne-t]acce%%89 ; n+ ~ _ %` i \(
) *( Z.
http://tolerance.ajou.ac.kr
0.+ +
/*))))&O&+: 1G /&P9+ L3L<&)))))))*/
be*inEcycle=> ?
in i,n=ne%G real , min=1.0&'(
for =i=0( i<+( iDD> ?
if =Qre!"n$> hen ?/* in his @ersion, re!"n$ alBays is 0 here */
if ===re!"n$>==n>
hen
?re!"n$=random=1,->( schedule=2,0.0n>(F
else if =<min> hen min=(
F
n==nJ+>D1(
F
ne%==ne%J+>D1( n=min(
F
http://tolerance.ajou.ac.kr
0.+ +
/*))))))&O&+: 2G 2&R4&5: -&-123 6+7 /45))))))))))*/
re!Emodule=n>
in n(
?
if =saus =module"re!"n$$Q=busy00saus=bus>Q=busy>
hen ?
re!ues=module"re!"n$$,n,0>( re!ues=bus,n,0>(
nbsDD( schedule=I,1.0,n>(
F
else
?re!"n$=0( if =DDre!"n$<n> hen n=re!"n$(F
F
http://tolerance.ajou.ac.kr
0.+ +
/*)))))))))&O&+: IG &+7 L3L<&)))))))))*/
end)cycle=n>
?
release=bus,n>(
release=module"re!"n$$.n>(
re!"n$=0(
ne%Eaccess=n>(
if =))nbs==0> hen schedule=1, n)ime=>,0>(
F
http://tolerance.ajou.ac.kr
0., ,
_o p%`g h M m X (5
4 pOw9 2:(9 + (4
5 Eg P @.
Q o _ i uO P @; (3
o H ! n+ _ nc 1 $Y i
u+.
t6 5 i ;2& ) *(3 m !
_ Z )c z; i .
http://tolerance.ajou.ac.kr
0., ,
; Y >[! c -. >[ !;
_i >() *+ + !& 2>9 @X 2
.
2 _i %`v3 _o m
nc z93 {i xy(93 ! nc z93 !
& xy+.
m !; i PR() *( 7 xyzX
+.
http://tolerance.ajou.ac.kr
0., ,
+
,
N
+
,
M
+
,
N
c
!
X{
http://tolerance.ajou.ac.kr
0., ,
xo _w >[ >[ ! >[4 g
P @; .
/*)))))))&O&+:2G 2&R4&5: -&-123))))))))))))*/
re!Emodule=n>
in n(
?
if =re!ues =module"re!"n$$,n,0>==0> hen
scheduleC=I,0.0,n>(
F
http://tolerance.ajou.ac.kr
0., ,
/*)))))))))&O&+: IG 2&R4&5: /45))))))))))))))))))*/
re!Ebus=n>
in n(
?
if =re!ues =bus,n>==0> hen
?nbsDD( schedule=.,1.0,n>(F
F
http://tolerance.ajou.ac.kr
0., ,
/*))))))))))))&O&+: .G &+7 L3L<&)))))))))))))))*/
endEcycle=n>
in n(
?
re!"n$=)re!"n$( nbs))(
if =nbs==0> hen ?
for =n=1( n<=+( nDD>
if =re!"n$<0> hen ?
release=bus,n>(
release=module")re!"n$$,n>(
re!"n$=0( ne% access=n>(
F
schedule=1,n)ime=>,0>(
F
;
http://tolerance.ajou.ac.kr
0.. .
+ , ; Q 7)k f7i -() *
( tz) h 9: * Ri (9 U
V x _ j)kH F& :(.
o i k(; @X
tu$4 zX 93 ] Bo 7)k R*& -(
+zX > }.
e7)k G H + X ez;
2 .
http://tolerance.ajou.ac.kr
0.. .
#include <smpl.h>
#define !ueued 1
real p=0.250( /* local memory */
in +=,, -=., n/=2, /* no. processors, memories, 0 buses */
module"1#$, /* faciliy descropors for modules */
bus, /* fociliy descripors for buses */
re!"1#$( /* currenly)re!uesed memory module */
http://tolerance.ajou.ac.kr
0.. .
main=>
?
in e@en, 9, n( real %=1.0/p)1.0(
smpl=0,C/andBidh -odelC> (
bus=faciliy=AbusC,n/> (
for=i=1( i<=-, iDD> module"i$=faciliy=AmoduleC,1>(
for=n=1( n<=+( nDD> ?
re!"n$=random=1,->( schedule=1, e%pnl=%>,n( >
F
http://tolerance.ajou.ac.kr
0.. .
Bhile =ime=><10000.0> ?
cause=0e@en,0n>(
sBich=e@en> ?
case 1G
if =re!ues=module"re!"n$$, n, 0>Q=!ueued>
hen schedule=2, 0.0, n>( breaH(
case 2G /* reser@e bus 0 iniiae ransfer */
if =re!ues=bus, n, 0> Q=!ueued> hen
schedule=I, 1.0, n>( breaH(
case IG /* compleeG schedule ne% re!ues */
release=bus, n>(
release=module"re!"n$$, n>(
re!"n$=random=1, ->(
schedule=1,espnl=%>, n>( breaH(
F
F/* end)Bhile */
repor=>(
F/* end)main */
http://tolerance.ajou.ac.kr
D.
N N 4 4 B B C C ana ana sim( sim( sim) sim) sim* sim*
+ + + (9000 )9E*+ )9E*F )9G(F )9G(*
+ + ) 9,00 (9,H* (9GGH (9GG+ (9GG,
+ + ( 9),0 9H0E 9*)E 9F)E 9**F
+ ) ( 9),0 9H(H 9*)E 9F)E 9**F
+ ) ( 9),( 9+H( 9+HE 9(*E 9+H+
H H H (9000 ,9),( ,9),* +9FH+ +9F*+
H H + 9,00 *9)E* *9*EF *9**+ *9*,)
H H ) 9),0 (9E0G (9EE+ (9E(H (9E*F
H + ) 9),0 (9HF0 (9E(( (9E(* (9E0F
H + ( 9),( 9HG0 9HGG 9FF* 9HG(
http://tolerance.ajou.ac.kr
E.
8:(> }o _a
Z o _ai 2
4 t i ()& O
P @.
e$E5 e8$Y 1>:
: m n+ _ 5 c `t
1 n+ LM& -(9< O P @.
http://tolerance.ajou.ac.kr
E.
+
_w (5 * i 2:. i _w
*2 g P @ O P @.
!H e
(5 + UV 7W m ! &
M y>+9 2:45 m Y
<F Li B)&
O P @.
http://tolerance.ajou.ac.kr
http://tolerance.ajou.ac.kr
(9 Introduction
1. Introduction to SimScript II.5
G& #; o )*+ .
http://tolerance.ajou.ac.kr
(9 Introduction
1.3 (Arithmetic Epre!!ion)
P [\<; ~ .
, ($""), - (s#.tr$ct), / (m#&tip&%), / ("i0i"'), // ('1pon'nti$t')
example :
r'$" 1 $n" %
$"" 1 to %
print 1 &in' 2it3 % t3#s
43' s#m is : ///
http://tolerance.ajou.ac.kr
(9 Introduction
1." (#omputing Variable Value!)
$r(#m'nt p$ssin(
- ro#tin' >n$m'? (i0'n >$r(#m'nt? %i'&"in( >$r(#m'nt?
8#nction i ( ro#tin' i -O P2 @.
pr'$m.&' "+*@I;* name S mode function" 4 :
(9 r't#rn 0$&#' ; 8#nction ( ")*4=); AI4B
arithmetic e"pression" 4 +.
example : 8#nction .so&#t'(;#m.'r)
...
r't#rn 2it3 ;#m.'r
'n"
http://tolerance.ajou.ac.kr
(9 Introduction
1.11 ,ibrar% -unction!
CCC.8 *X, @. & Bv $.s.8 ; X $r(#m'nt
ni r't#rn +.
1.12 .et *ode Variable!
-& -(; $P .. r'$& / int'('r ,/ +.
1.13 Alpha Variable!
< (5& $P O h z; ..
1.1" Adding /er&ormance *ea!urement
;.D.r'so#rc' : @; < P
<(r'so#rc') o W 2 (; 8i R(; P7
$Y .
/rogram Structure
1) !r'$m.&' : C B'$"'r @i&' y(.
2) 6$in pro(r$m : PRz (; & 3;
. 45 4imin( )o#tin' 4 6X2; 7f4
PR+.
3) !roc'ss ro#tin' : pr'$m.&' proc'ss 7fi -(
; ro#tin'
.iming routine
o 90 +AAA Ii )@4 +.
y1 1(; 90B o , G
un'1or*( zX @.
90 e o D +D un'1or*(
zX @.
http://tolerance.ajou.ac.kr
)*: A Simple Gas Station
Model
/REA*0,E
!)EC*SS*S I;C5=+* <*;*)4E) ;+ C=S4E6*)
)*SE=)C*S I;C5=+* 44*;+;4
CC=6=54* F<.D=*=*.5*;<4B S 4B* F*)<*
;+ 69.D=*=*.5*;<4B S 4B* 69I6=6
E@ ;.D.44*;+;4
CC=6=54* =4I5IG4IE; S 4B* F*)<* E@
;.9.44*;+;4
E1D
http://tolerance.ajou.ac.kr
)*: A Simple Gas Station
Model
*AI1
C)*4* *F*): 44*;+;4(1)
5*4 =.44*;+;4(1) 7 2
C4IF4* <*;*)4E) ;EA
S4)4 SI6=54IE;
!)I;4 4 5I;*S AI4B F<.D=*=*.5*;<4B(1),
69.D=*=*.5*;<4B(1),
;+ =4I5IG4IE;(1) / 100. / 2 4B=S
SI6!5* <S S44IE; 6E+*5 AI4B 2 44*;+;4S
F*)<* C=S4E6*) D=*=* 5*;<4B IS /.///
69I6=6 C=S4E6*) D=*=* 5*;<4B IS /
4B* 44*;+;4S A*)* H=S: //.// !*) C*;4 E@ 4B* 4I6*.
E1D
http://tolerance.ajou.ac.kr
)*: A Simple Gas Station
Model
/R2#ESS 3E1ERA.2R
@E) I 7 1 4E 1000,
+E
C4IF4* C=S4E6*) ;EA
AI4 =;I@E)6.@(2.0,8.0,1) 6I;=4*S
5EE!
E1D
/R2#ESS #4S.2*ER
)*D=*S4 1 44*;+;4(1)
AE)I =;I@E)6.@(5.0,15.0,2) 6I;=4*S
)*5I;<D=ISB 1 44*;+;4(1)
E1D
http://tolerance.ajou.ac.kr
*9 4odeling Individual IbJects
3.1. Attribute #oncept
5 <(r'so#rc') o At X P @.
)'so#rc's
(c&ocJ) ; :+ )'$& $P
4I6*.F c -zA j) 0 i 2.
) *; 8("$%) .
BE=)S.F 7 24
6I;=4*S.F 7 60
<; ) i (; * $"O P @ .
EFG i `Sc v , +:S & S*CE;+S
BE=)S & 6I55IS*CE;+S, 6I;=4*S &
6IC)ES*CE;+S CG P @.
http://tolerance.ajou.ac.kr
*9 4odeling Individual IbJects
!)*6H5*
+*@I;* .s'con"s 4E 6*; "$%s
+*@I;* .mi&&is'con"s 4E 6*; 3o#rs
+*@I;* .micros'con"s 4E 6*; min#t's
*;+
6I;
5*4 BE=)S.F 7 1000
5*4 6I;=4*S.F 7 1000
*;+
http://tolerance.ajou.ac.kr
)*: A Bank with a Separate Queue for Each
Teller
8$Y oR "3 90o oR 1c C 26+
oR e& 9 oRi >5 . {5
oRB 26(> }v 90o 2 Ho i
g .
+ oRi c < . t6 I: 1; 8 n)
9 3 n 3 oR SS a3 {9 90
n) .
z; JKG; <2 Ld +
.
oR P8Teller93 90 1 8c : >P & 1
+93 oR
http://tolerance.ajou.ac.kr
/REA*0,E
!)EC*SS*S I;C5=+* <*;*)4E) ;+ C=S4E6*)
)*SE=)C*S I;C5=+* 4*55*)
+*@I;* 6*;.I;4*)))IF5.4I6*, 6*;.S*)FIC*.4I6*,
+:.5*;<4B ;+ AI4I;<.4I6* S )*5 F)IH5*S
CC=6=54* =4I5IG4IE; S 4B* F*)<* E@ ;.9.4*55*)
CC=6=54* F<.D=*=*.5*;<4B S 4B* F*)<*,
69.D=*=*.5*;<4B S 4B* 69I6=6 E@ ;.D.4*55*)
455: 6*;.AI4I;<.4I6* S 4B* 6*; E@ AI4I;<.4I6*
E1D
)*: A Bank with a Separate Queue for Each
Teller
http://tolerance.ajou.ac.kr
*AI1
)*+ ;.4*55*), 6*;.I;4*)))IF5.4I6*, 6*;.S*)FIC*.4I6*,
;+ +:.5*;<4B
C)*4* *F*): 4*55*)
@E) *CB 4*55*),
5*4=.4*55*)(4*55*)) 7 1
!)I;4 8 5I;*S AI4B ;.4*55*), 6*;.I;4*)))IF5.4I6*,
6*;.S*)FIC*.4I6* ;+ +:.5*;<4B 4B=S
SI6=54IE; E@ H;I AI4B / 4*55*)S
(*CB AI4B S*!)4* D=*=*)
C=S4E6*)S ))IF* CCE)+I;< 4E ; *9!E;*;4I5 +IS4)IH=4IE;
E@ I;4*) ))IF5 4I6*S AI4B 6*; E@ /.// 6I;=4*S.
S*)FIC* 4I6* IS 5SE *9!E;*;4I55: +IS4)IH=4*+
AI4B 6*; E@ /.// 6I;=4*S.
4B* H;I +EE)S )* C5ES*+ @4*) /.// BE=)S.
(H=4 55 C=S4E6*)S I;SI+* )* S*)F*+.)
)*: A Bank with a Separate Queue for Each
Teller
http://tolerance.ajou.ac.kr
C4IF4* <*;*)4* ;EA
S4)4 SI6=54IE;
!)I;4 6 5I;*S AI4B 4I6*.F / BE=)S.F,
;+ 6*;.A4I;<.4I6* / BE=)S.F / 6I;=4*S.F 4B=S
4B* 5S4 C=S4E6*) 5*@4 4B* H;I 4 /.// BE=)S.
4B* F*)<* C=S4E6*) +*5: AS /.// 6I;=4*S.
4*55*) =4I5IG4IE; D=*=* 5*;<4B
F*)<* 69I6=6
@E) *CB 4*55*),
!)I;4 1 5I;* AI4B 4*55*), =4I5IG4IE;(4*55*)),
F<.D=*=*.5*;<4B(4*55*)), 69.D=*=*.5*;<4B(4*55*)) 4B=S
/ /.// /.// /
E1D
)*: A Bank with a Separate Queue for Each
Teller
http://tolerance.ajou.ac.kr
/R2#ESS 3E1ERA.2R
+*@I;* ))IF5.4I6* S )*5 F)IH5*
5*4 4I6*.4E.C5ES* 7 +:.5*;<4B / BE=)S.F
=;4I5 4I6*.F ?7 4I6*.4E.C5ES*,
+E
C4IF4* C=S4E6*) ;EA
AI4 *9!E;*;4I5.@(6*;.I;4*)))IF5.4I6*,1) 6I;=4*S
5EE!
E1D
)*: A Bank with a Separate Queue for Each
Teller
http://tolerance.ajou.ac.kr
/R2#ESS #4S.2*ER
+*@I;* ))IF5.4I6* S )*5 F)IH5*
+*@I;* 6:.CBEIC* S I;4*<*) F)IH5*
5*4 ))IF5.4I6* 7 4I6*.F
@E) *CB 4)*55*), AI4B ;.9.4*55*)(4*55*)) 7 0,
@I;+ 4B* @I)S4 CS*
I@ @E=;+,
5*4 6:.CBEIC* 7 4*55*)
*5S*
@E) *CB 4*55*),
CE6!=4* 6:.CBEIC* S 4B* 6I;I6=6(4*55*))
E@ ;.D.4*55*)(4*55*))
5A:S
)*D=*S4 1 4*55*)(6:.CBEIC*)
5*4 AI4I;<.4I6* 7 4I6*.F - ))IF5.4I6*
AE)I *9!E;*;4I5.@(6*;.S*)FIC*.4I6*,2) 6I;=4*S
)*5I;D=ISB 1 4*55*)(6:.CBEIC*)
E1D
)*: A Bank with a Separate Queue for Each
Teller
http://tolerance.ajou.ac.kr
5 )*- 24./4. 6
SI6=54IE; E@ H;I AI4B 2 4*55*)S
(*CB AI4B S*!)4* D=*=*)
C=S4E6*)S ))IF* CCE)+I;< 4E ; *9!E;*;4I5 +IS4)IH=4IE;
E@ I;4*) ))IF5 4I6*S AI4B 6*; E@ 5.00 6I;=4*S.
S*)FIC* 4I6* IS 5SE *9!E;*;4I55: +IS4)IH=4*+
AI4B 6*; E@ 10.00 6I;=4*S.
4B* H;I +EE)S )* C5ES*+ @4*) 8.00 BE=)S.
(H=4 55 C=S4E6*)S I;SI+* )* S*)F*+.)
4B* 5S4 C=S4E6*) 5*@4 4B* H;I 4 /.// BE=)S.
4B* F*)<* C=S4E6*) +*5: AS /.// 6I;=4*S.
4*55*) =4I5IG4IE; D=*=* 5*;<4B
F*)<* 69I6=6
1 .97 1.73 6
2 .91 2.06 7
)*: A Bank with a Separate Queue for Each
Teller