review

14
Review

Upload: edana

Post on 05-Feb-2016

28 views

Category:

Documents


0 download

DESCRIPTION

Review. DEVS Formalism. Discrete-Event formalism: time advances using a continuous time base. Basic models that can be coupled to build complex simulations. Abstract simulation mechanism. DEVS atomic models semantics. y (3). x (5). s ’ = d ext ( s,e,x) (6). l ( s ) (2). s. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Review

Review

Page 2: Review

DEVS Formalism

Discrete-Event formalism: time advances using a continuous time base.

Basic models that can be coupled to build complex simulations.

Abstract simulation mechanism

Atomic Models:

M = < X, S, Y, int, ext, , D >.

Coupled Models:

CM = < X, Y, D, {Mi}, {Ii}, {Zij}, select >

Page 3: Review

ta(s) ta(s) (1)(1)ss

DEVS = DEVS = < X, S, Y, < X, S, Y, int int , , ext ext , ta, , ta,

ss

y y (3)(3)

ss’ ’ = = int int ss

x x (5)(5)

ss’ ’ = = ext ext ((s,e,x)s,e,x)

(6)(6)

DEVS atomic models semantics

Page 4: Review

Moutin

event

t

x1 y1 x2

t

S

s0

s1

s2

s2=ext((s0,e),x1)s1=int(x2)

t

e

ta(s0)ta(s1)ta(s2)

Dynamic behavior of DEVS models

Page 5: Review

Atomic model example: Processing Server

J o bQ u e u e

S i g m a

S J o bI n

O u t

A t o m i c M o d e l : P

S t a t e V a r i a b l e s : s i g m a = , p h a s e = P a s s i v e ; J o b = n o n e ( < J o b - i d , P r o c e s s i n g - t i m e > ) ; / * R e p r e s e n t s t h e j o b b e i n g e x e c u t e d * / J o b - Q u e u e = E m p t y ( J o b * ) / * C o n t a i n s t h e J o b - i d ' s w a i t i n g f o r t h e C P U . * /

F o r m a l s p e c i f i c a t i o n f o r P : X = { J o b < N , R > } ; Y = { J o b - i d N } S = { { P h a s e , s i g m a , J o b - Q u e u e , J o b } }

e x t ( J o b - Q u e u e , J o b , e , x ( t y p e : J o b ) ) {

c a s e p h a s e p a s s i v e : s i g m a = x . P r o c e s s i n g - t i m e ; p h a s e = b u s y ; J o b = x . J o b - i d ; b u s y : a d d ( x , J o b - Q u e u e ) ; s i g m a = s i g m a - e ; }

i n t ( J o b - Q u e u e , J o b , e ) { c a s e p h a s e b u s y : i f e m p t y ( J o b - Q u e u e ) p h a s e = p a s s i v e ; s i g m a = ; e l s e J o b = G e t ( J o b - Q u e u e ) ; s i g m a = J o b . P r o c e s s i n g - t i m e ; e n d i f p a s s i v e : / * N e v e r h a p p e n s * / } s ) { s e n d J o b . J o b - I d t o t h e p o r t o u t }

Page 6: Review

Coupled models

Structural models (multicomponent)

Page 7: Review

– Petri Net : incremental– DEVS : hierarchical

GEN BUF PROCout outin in out out

done

GEN-BUF-PROC

BUF-PROC

G+B+P

B+PG

PB

A B C

Incremental : A andB: connect

A B C

Hierarchical : A and BC: connect

BCABC

Hierarchical vs. Incremental modelling

Page 8: Review

CM = < X, Y, D, {Mi}, IC, EIC, EOC, select > X is the set of input events; Y is the set of output events; D is an index for the components of the coupled

model, and i D, Mi is a basic DEVS model (that is, an

atomic or coupled model), defined by

Mi = < Ii, Xi, Si, Yi, inti, exti, tai > IC is the set of Input Couplings;

EIC is the set of External Input Couplings;

EOC is the set of External Output Couplings;

Finally, select is the tie-breaking selector.

Coupled models formal specification

Page 9: Review

DN X , Y, D, {Mi }, {Ii }, {Zi,j }

DEVS X, S, Y, int, ext, con, ta,

DEVS X, S, Y, int, ext, con, ta,

Every DEVS coupled model

has a DEVS Basic equivalent

Closure Under Coupling

Page 10: Review

Components (D)

couplings

– Internal Couplings (IC)– External Input Couplings (EIC)– External Output Couplings (EOC)

repairshop

out

sent

finished

repairedfaulty

generator(genr)

transducer(transd)

out report

stop

start

start

Input/output ports concepts

Page 11: Review

– GEN-BUF-PROC = < X, Y, {GEN, BUF, PROC}, EIC, EOC, IC, SELECT >

• X = • Y = { out }

• EIC = • EOC = { (PROC.out, GEN_BUF_PROC.out) }

• IC = { (GEN.out, BUF.in), (BUF.out, PROC.in), (PROC.out, BUF.done)}

• SELECT : ({GEN, BUF, PROC}) = GEN ({BUF, PROC}) = BUF :

GEN BUF PROCout outin in out out

done

< GEN-BUF-PROC model >

Coupled DEVS example

Page 12: Review

– Internal transition• Model knows its schedule time (by time advance)

– External transition• Model doesn’t know its schedule time influencer’s schedule

– Conflict case• Internal and external events• External events

M1 M2

M2 : M1’s influencee

M1 : M2’s influencer

Concept of Scheduling and Tie-break

Page 13: Review

GEN BUFFER PROC

outoutout

inin

done

* GEN = < S, X, Y, int ,ext , , ta > X = Y = {out} S = {G} int: int(G) = G ext :unavailable (G) = out ta(G) = GEN_TIME

G

(out, ta(G))

< GEN model >

* PROC = < S, X, Y, int ,ext , , ta > X ={in} Y = {out} S = { B, F } int: int(B) = F ext : ext(F, in) = B (B) = out ta(B) = PROCESS_TIME

B F

(in,e)

(out, ta(B))

< PROC model >

BUF(coupled model)

Tie-Breaking example

BUFFER: Exercise

Page 14: Review

– conflict schedule is resolved by assigning priority between models that cause schedules.

• Internal and external events

• External events

– Sel : 2{Mi} {Mi}

n,Fout(BUF) in(GEN)

Priority(BUF,GEN) = GEN

n,Bdone(PROC) In(GEN)

Priority(PROC,GEN) = GEN

Tie-breaking