Simulation algorithms for atomic DEVS

before-content-x4

Given an atomic DEVS model, simulation algorithms are methods to generate the model’s legal behaviors which are trajectories not to reach to illegal states. (see Behavior of DEVS). [Zeigler84] originally introduced the algorithms that handle time variables related to lifespan

ts[0,]{displaystyle t_{s}in [0,infty ]}
after-content-x4

and elapsed time

te[0,){displaystyle t_{e}in [0,infty )}

by introducing two other time variables, last event time,

tl[0,){displaystyle t_{l}in [0,infty )}

, and next event time

tn[0,]{displaystyle t_{n}in [0,infty ]}

with the following relations:

and

where

t[0,){displaystyle tin [0,infty )}

denotes the current time. And the remaining time,

is equivalently computed as

, apparently

tr[0,]{displaystyle t_{r}in [0,infty ]}

.

Since the behavior of a given atomic DEVS model can be defined in two different views depending on the total state and the external transition function (refer to Behavior of DEVS), the simulation algorithms are also introduced in two different views as below.

Common parts[edit]

Regardless of two different views of total states, algorithms for initialization and internal transition cases are commonly defined as below.

DEVS-simulator
  variables:
    parent // parent coordinator
         // time of last event
         // time of next event
    // the associated Atomic DEVS model 
  when receive init-message(Time )
     
     
  when receive star-message(Time )
     if  then
        error: bad synchronization;
     
     send y-message() to parent;
     
     
     

View 1: total states = states * elapsed times[edit]

As addressed in Behavior of Atomic DEVS, when DEVS receives an input event, right calling

δext{displaystyle delta _{ext}}

, the last event time,

tl{displaystyle t_{l}}

is set by the current time,

t{displaystyle t}

, thus the elapsed time

te{displaystyle t_{e}}

becomes zero because

te=ttl{displaystyle t_{e}=t-t_{l}}

.

  when receive x-message(, Time )
     if  and  == false then
        error: bad synchronization;
     
     
     

View 2: total states = states * lifespans * elapsed times[edit]

Notice that as addressed in Behavior of Atomic DEVS, depending on the value of

b{displaystyle b}

return by

δext{displaystyle delta _{ext}}

, last event time,

tl{displaystyle t_{l}}

, and next event time,

tn{displaystyle t_{n}}

,consequently, elapsed time,

te{displaystyle t_{e}}

, and lifespan

tn{displaystyle t_{n}}

, are updated (if

b=1{displaystyle b=1}

) or preserved (if

b=0{displaystyle b=0}

).

  when receive x-message(, Time )
     if  and  == false then
        error: bad synchronization;
     
     if  then 
        
        

See also[edit]

References[edit]

  • [Zeigler84] Bernard Zeigler (1984). Multifacetted Modeling and Discrete Event Simulation. Academic Press, London; Orlando. ISBN 978-0-12-778450-2.
  • [ZKP00] Bernard Zeigler; Tag Gon Kim; Herbert Praehofer (2000). Theory of Modeling and Simulation (second ed.). Academic Press, New York. ISBN 978-0-12-778455-7.

after-content-x4