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\in[0,infty]
te\in[0,infty)
tl\in[0,infty)
tn\in[0,infty]
te=t-tl
and
ts=tn-tl
where
t\in[0,infty)
tr=ts-te
is equivalently computed as
tr=tn-t
, apparently
tr\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.
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
tl
tn
A=(X,Y,S,ta,\deltaext,\deltaint,λ)
t
tl\leftarrowt;
tn\leftarrowtl+ta(s);
t
t\netn
y\leftarrowλ(s);
y,t
s\leftarrow\deltaint(s)
tl\leftarrowt;
tn\leftarrowtl+ta(s);
As addressed in Behavior of Atomic DEVS, when DEVS receives an input event, right calling
\deltaext
tl
t
te
te=t-tl
when receive x-message(
x\inX
t
(tl\let
t\letn)
s\leftarrow\deltaext(s,t-tl,x)
tl\leftarrowt;
tn\leftarrowtl+ta(s);
Notice that as addressed in Behavior of Atomic DEVS, depending on the value of
b
\deltaext
tl
tn
te
tn
b=1
b=0
when receive x-message(
x\inX
t
(tl\let
t\letn)
(s,b)\leftarrow\deltaext(s,t-tl,x)
b=1
tl\leftarrowt;
tn\leftarrowtl+ta(s);