Content uploaded by Franz Preyser
Author content
All content in this area was uploaded by Franz Preyser on Jun 04, 2018
Content may be subject to copyright.
RPDEVS: Revising the Parallel Discrete
Event System Speciﬁcation
Franz Preyser ∗Bernhard Heinzl ∗Wolfgang Kastner ∗
∗
Automation Systems Group, Vienna University of Technology, A1040
Vienna, Austria (email: {Franz.Preyser, Bernhard.Heinzl,
Wolfgang.Kastner}@tuwien.ac.at).
Abstract: In this work, we present a Revised Parallel DEVS (RPDEVS) formalism. The Classic
Discrete Event System Speciﬁcation (DEVS) and Parallel DEVS (PDEVS) formalisms do not
support modelling of ’true’ mealy behaviour, i.e. reacting to an input message immediately
with an output message. Instead, such behaviour has to be modelled via transitory states and
multiple state updates. This not only increases model complexity, it also impedes reusability of
model components in diﬀerent contexts.
RPDEVS enhances PDEVS with the capability to model mealy behaviour directly. Hence, the
output function
λcan access the input bag. This introduces some challenges regarding the
simulation algorithm which we will take a look at.
Further, the terms
algebraic loop
and
illegitimate model
will be discussed in the context of
RPDEVS. It is shown that RPDEVS models which are free of algebraic loops are also legitimate.
Finally, it will be demonstrated that like Classic DEVS and PDEVS, also RPDEVS provides
closure under coupling.
Keywords: Discreteevent systems, Mathematical models, Modelling, Simulation, DEVS,
PDEVS, RPDEVS, Algebraic loop, Transitory state, Mealy behaviour
1. INTRODUCTION
Discrete Event System Speciﬁcation (
DEVS
) (Zeigler et al.
(2000)) denotes a very generic mathematical formalism
to describe the discrete behaviour of dynamical systems.
DEVS
allows a hierarchical and modular system descrip
tion, which is of high value when modelling large and
complex systems. There are various specialised and ex
tended versions of
DEVS
, with Parallel DEVS (
PDEVS
)
(Chow and Zeigler (1994); Zeigler et al. (2000)) being the
most popular one.
Over the last decades, Classic
DEVS
and its variant
PDEVS
have established in the scientiﬁc community, which
can be veriﬁed by the numerous publications and simulation
engines existing around DEVS (Franceschini et al. (2014)).
We applied both Classic
DEVS
(Preyser (2015)) and
PDEVS
(Raich et al. (2016)) in projects and experienced
modelling diﬃculties with both formalisms (Preyser et al.
(2016)). But also others describe similar problems (Traor´e
(2007), Cicirelli et al. (2007)).
DEVS
follows a componentbased approach where models
can be designed in a modularhierarchical manner. Each
component has an inner state which is updated either due to
the arrival of an input messages or due to internal dynamics.
Diﬃculties arise when multiple state updates occur at one
instant of simulation time. This is caused by multiple input
messages which arrive concurrently (at the same instant
of simulation time) in principal, however are processed
sequentially, each causing an individual state update. The
order in which concurrent input messages are processed
depends on the structure of the model surrounding the
component. Regarding reusability of model components,
it is crucial that their behaviour is independent of any sur
rounding topology. Consequently, when designing a reusable
component, all possible sequential processing orders of
concurrent input messages have to be considered. This can
be very cumbersome. In Preyser et al. (2016), speciﬁc
examples are given for
DEVS
based models. However,
concurrent events and multiple state updates seem to be a
problem in Discrete Event System (
DES
) models in general
(Junglas (2016)).
As the reuse of model components is essential for an eﬃcient
design of largescale models, a modelling formalism should
support reusability and facilitate transparent behaviour of
components. One way to achieve this is by allowing state
updates to be executed only once per time instant and
component, requiring all input messages to be available
before that single state update. We altered the
PDEVS
formalism to fulﬁl these requirements, resulting in what we
call Revised Parallel DEVS (RPDEVS).
In the following section
PDEVS
will be recapped shortly.
Then, the core
RPDEVS
will be described, followed by a
discussion of the terms illegitimate and algebraic loop in
the context of
RPDEVS
. It is shown that models which
are free of algebraic loops are also legitimate, before ﬁnally
closure under coupling of RPDEVS is described.
2. PARALLEL DEVS
In Classic DEVS (Zeigler et al. (2000)), concurrent input
messages at a model component are processed strictly
sequentially. The processing order is not deﬁned within
Preprints of the 9th Vienna International Conference on
Mathematical Modelling
Vienna, Austria, February 2123, 2018
Copyright © 2018 IFAC 269
the component, but results from the deﬁnition of the
coupling model, the component is used in. Consequently,
when designing a reusable model component, the modeller
has to consider every possible processing order.
PDEVS
improves this situation signiﬁcantly. However, components
with mealy behaviour (that is reacting to an input message
immediately with an output message), still have to be
modelled using transitory states. Transitory states though,
again cause sequential processing of concurrent events.
2.1 Atomic PDEVS
The basic component is the atomic PDEVS. An atomic
PDEVS describes a system with the possibility to receive
input messages, produce output messages and update the
state variables describing the current internal state. Internal
states have a maximum time to live. State updates are
triggered either through the arrival of input messages
(external event), due to the expiration of the life time of
the current state (internal event), or due to an concurrent
occurrence of both. An atomic PDEVS is described by
< Xb, S, Y, δint , δext, δconf , λ, ta > (1)
with the following meanings:
Xb. . . set of possible input bags
Y . . . set of possible outputs
S . . . set of possible states (=state space)
ta :S→[0,∞]. . . time advance function
Q={(s, e)s∈S, e ∈[0, ta(s)]}
δint :S→S . . . internal state transition function
δext :Q×Xb→S . . . external state transition function
δconf :S×Xb→S . . . conﬂuent state transition function
λ:S→Y . . . output function
According to the
PDEVS
abstract simulator (Chow et al.
(1994)), whenever the life time
ta(s)
of the current state
s∈S
expires (
e=ta(s)
), the output function
λ(s)
is
called, potentially generating output messages. After that,
a new state is computed, by either executing
δint(s)
or
δconf (s, xb)
. The latter if input messages arrived as well
at current simulation time. If input messages arrive before
the elapsed time
e
reaches the maximum time to live
ta(s)
,
δext(s, e, x)
is executed, also resulting in a state update.
Concurrently arriving input messages are gathered in a
bag (multiset)
xb∈Xb
, indicated with the superscript
b
,
and processed in parallel in principle. Exceptions occur in
models containing mealy components (see section 2.3).
It is interesting to note that there is a certain similarity to
state automata. However, when taking a closer look at the
output function
λ
in (1), it can be seen that PDEVS only
allows moorelike behaviour. The output message
y=λ(s)
does not depend on the current input, but only on the
inner state of the system. Furthermore,
λ
is only called at
internal and conﬂuent events, but not at external events.
Therefore, mealy behaviour, where
y=λ(s, x)
depends
not only on the state but also on the inputs, can not be
modelled directly.
2.2 Coupled PDEVS
Atomic components may be coupled with each other in a
way that output messages of one component become input
messages of another component (see Figure 1).
Fig. 1. PDEVS coupling.
Coupled PDEVS models can be used like atomic PDEVS in
larger coupled models. This property, called closure under
coupling, enables hierarchical model structuring. A coupled
PDEVS Nis described by the following elements:
< Xb, Y, D, {Md}d∈D,{Id}d∈DN,{Zi,d}i,d∈DN>
where DN=D∪ {N}and
Xb. . . set of possible input bags
Y . . . set of possible outputs
D . . . index set
Md. . . child components of Nfor each d∈D
Id⊂D∪ {N}. . . inﬂuencer set of d, d /∈Id
Zi,d . . . output translation function
Zi,d :Yi→Xd
translates an output message
yi
of
component
i
into an input message
xi,d ∈xb
d
for component
d
, if
i
and
d
are child components of the coupled model
N
. If
i
is the coupled model itself (
i=N
), then
ZN,d :XN→Xd
transforms input messages
xN
of the coupled model to
input messages
xN,d ∈xb
d
for the child component
d
. On
the other hand, if
d
is the coupled model (
d=N
), then
Zi,N :Yi→YN
transforms the output message
yi
of
i
to
an output message
yN
of the coupled model
N
. If there is
no coupling connection from components
i
to
d
(
i /∈Id
),
the result of Zi,d is always ∅.
In a coupled
PDEVS
, the internal events of all imminent
components (components which experience an internal
event) can be processed in parallel. Thereby, ﬁrst
λ
is exe
cuted at each imminent component (
λ
phase), producing a
set of output messages. These output messages are routed
to the receiving blocks, where they ﬁll their input bags.
The input bag xb
dof component dis calculated as
xb
d=ZN,d (xN)]]
i∈Id\{N}
Zi,d(yi),
where yi=λi(si) denotes the output of component i.
After the
λ
phase follows the
δ
phase, in which the
state update function is executed at each block that has
experienced an internal, external or a conﬂuent event:
sd,new =δint(sd,old ) / δext(sd,old, ed, xb
d) / δconf (sd,old, xb
d)
2.3 Sequential Processing in PDEVS
At ﬁrst glance, it seems as if all input messages arriving at
the same simulation time at a component are processed in
one single state update. However, as already elaborated in
Preyser et al. (2016), if a model contains components with
mealy behaviour (mealy components), sequential processing
of concurrent input messages occurs.
Preprints of the 9th MATHMOD
Vienna, Austria, February 2123, 2018
270
To obtain mealy behaviour, a component has to change into
a transitory state
˜s
with
ta(˜s) = 0
during
δext
or
δconf
after
an input message arrived (e.g.
˜s=δconf (s0, xb)
). This leads
to a repetition of the
λ
phase (
y=λ(˜s) = λ(δconf (s0, xb))
).
Thereby,
λ
is executed at every component that is in a
transitory state. Then also the
δ
phase is repeated, in which
state transitions are calculated at every inﬂuenced com
ponent. This cycle of repeating λ and δphases continues
until every component resides in a nontransitory state,
before simulation time can advance.
Examples for mealy components are blocks that apply
simple arithmetic functions to input messages, like multi
plying them with a constant factor, or simple switch blocks
routing messages to a selected output. Thus, to abstain
from mealy components when creating a library of reusable
model components is no serious option.
Example 1. Consider the coupled model in Figure 1, with
atomic aexperiencing an internal event at time t1while
being in state sa,0. Assuming atomic cto be of type mealy
leads to the following sequence of events and function calls:
1stλ−phase :xa,c =Za,c (λa(sa,0))
xa,d =Za,d(λa(sa,0))
1stδ−phase :sa,1=δint,a (sa,0)
˜sc,1=δext,c (sc,0, ec,1,{xa,c }), ta(s0
c,1)=0
˜sd,1=δext,d (sd,0, ed,1,{xa,d })
2ndλ−phase :xc,d =Zc,d (λc(˜sc,1))
2ndδ−phase :sc,1=δint,a (˜sc,1), ta(sc,1)6= 0
sd,1=δext,d(˜sd,1,0,{xc,d})
Consequently, the new state of atomic d, which starts in
state sd,0and receives the inputs xa,d and xc,d is
s0
d,1=δext,dδext,d (sd,0, ed,1,{xa,d}),0,{xc,d }.
However, with a diﬀerent structure of the coupled model
surrounding component d, the new state of dcould also be
s00
d,1=δext,dδext,d (sd,0, ed,1,{xc,d}),0,{xa,d },or
s000
d,1=δext,dsd,0, ed,1,{xc,d , xa,d}.
For a reusable model component with transparent be
haviour, it would be desirable to have one unique successor
state if the component is in a given state and receives
a certain set of input messages at one instant of simu
lation time, regardless of the components surroundings.
To achieve this in the given example, the modeller would
have to deﬁne the state transition functions in a way
that s0
d,1=s00
d,1=s000
d,1. Since the number of possible
cases increases rapidly with the number of concurrent
input messages, this complicates the design of reusable
components.
3. REVISED PARALLEL DEVS
The idea of RPDEVS is to call
λ
also at external events, and
thereby allow
λ
to access the input bag
xb
, and the elapsed
time
e
. This permits direct modelling of mealy behaviour.
During an iterative
λ
phase, all concurrent input messages
for a component are collected, before calculating the state
transition only once for a particular point in simulation
time.
3.1 Atomic RPDEVS
An atomic RPDEVS is deﬁned by the 6tuple
< X, S, Y, δ, λ, ta > .
Thereby, δand λhave the following form:
δ:Q×X→S
λ:Q×X→Y(2)
In
RPDEVS
,
λ
is called at any kind of event, internal,
external, and conﬂuent. The explicit distinction between
the diﬀerent event types is dropped. The type of event can
be determined by the content of the input bag (empty or
not) and the value of the elapsed time
e
(equal
ta(s)
or not)
anyway, as described in Chow and Zeigler (1994), section 4,
page 5: “From the deﬁnition of the
δint
,
δconf
, and
δext
, we
see that they are special cases of a more generic transition
function δ(s, e, xb)”
As stated in Goldstein et al. (2013), it appears quite
frequently in atomic
DEVS
models that the calculation of
the output message in
λ
already includes (parts of) the
calculation of the new state. However, since
λ
is not allowed
to change the inner state of the system, these calculations
have to be repeated in
δ
. This restriction on
λ
is even more
crucial in
RPDEVS
, because
λ
may be called multiple
times at an instant of time with only the last call being
the valid one.
Nevertheless, there is a way to reuse state calculations
in
δ
which have already been executed in
λ
. For this
purpose, alternatively to the deﬁnition in (2),
δ
and
λ
may be speciﬁed as follows:
δ:Sδ×Sλ×[0,∞)×X→Sδ,(sδ, sλ, e, xb)7→ sδ
λ:Sδ×[0,∞)×X→Y×Sλ,(sδ, e, xb)7→ (y, sλ)
Here, the state
s
of a system is separated into two parts
s= (sδ, sλ)
, where
λ
is only allowed to read
sδ
and to write
sλ
. Thus, if
λ
already performs calculations also necessary
in
δ
, the (intermediate) results can be stored in
sλ
to be
later used in
δ
. Regarding practical implementation, it is
crucial that
sλ
is reassigned in every call of
λ
to prevent
using an old nonvalid value in δ.
As explained in section 3.2, in
RPDEVS
determining the
component’s output messages is an iterative process, in
which
λ
may be called multiple times at the same point
in simulation time. For this process to terminate, it is
necessary to assure that every call of
λ
always uses the
same information about the system state. This is why
λ
only depends on sδ.
3.2 Coupled RPDEVS
The deﬁnition of a coupled
RPDEVS N
is equal to the
deﬁnition of a coupled PDEVS:
< Xb
N, YN, D, {Md}d∈D,{Id}d∈DN,{Zi,d}i,d∈DN>(3)
Whenever components in a coupled
RPDEVS
model are
imminent,
λ
is calculated for each of them, initially
assuming an empty input bag (
λ(s, ta(s),∅)
). The produced
output messages are routed to the receiving components,
ﬁlling their input bags. This causes a
(re)
calculation of
λ
at every receiving component, again potentially producing
output messages.
The input bag
xd
of a component
d
is divided into sub
input bags
ixd
, one for each inﬂuencer
i∈Id
. If
λi
is
recalculated at an inﬂuencer
i
producing the output
yi
, the
content of the corresponding subinput bag
ixd
is replaced
Preprints of the 9th MATHMOD
Vienna, Austria, February 2123, 2018
271
by
Zi,d(yi)
. Only if this replacement eﬀectively changed
ixd
, a recalculation also of
λd
at the receiver
d
is triggered.
In this way, it is assured that the iterative
λ
phase will
quit at some point, as long as the model is free of algebraic
loops (see section 3.3). Only after the content of all input
bags has stabilised, the state transitions are calculated.
For better readability, in the following the superscript
b
at
input bags xbwill be omitted.
Let us take a closer look at the iterative
λ
phase of a coupled
model
N
. We assume
n
subcomponents
D={1,2, . . . , n}
.
At an instant of time
tj
, before any events are processed,
the state of the system is deﬁned to be the temporal left
limit:
s(tj) = sj−1= lim
t%tj
s(t) = (s1,j−1, s2,j −1, . . . , sn,j−1).
An exception is the simulation start time
t0
where the
system state is a given initial state s0
s(t0) = s0= (s1,0, s2,0, . . . , sn,0).
The initial input bags of the components
x0
j= (x0
1,j , x0
2,j , . . . , x0
n,j )
are either empty (
x0
d,j =∅
) or, if external input messages
from outside the coupling exist (
xN,j 6=∅
) they are
x0
d,j =ZN,d (xN,j ).
If components are imminent (i.e.
∃d∈ {1,2, . . . , n}:ed,j =
ta(sd,j−1)
),
λ
is executed at these components producing
a set of output messages
y0
j= (y0
1,j , y0
2,j , . . . , y0
n,j ),
with
y0
d,j =λ(sd,j−1, ed,j , x0
d,j ) if ed,j =ta(sd,j−1)
∅else
and corresponding new input messages
x1
j= (x1
1,j , x1
2,j , . . . , x1
n,j ),
with
x1
d,j =ZN,d (xN,j )]Ui∈Id\{N}Zi,d (y0
i,j ), d ∈D
. If
any nonempty output messages are generated (
∃d∈D:
y0
d,j 6=∅
), they trigger events at the receiving components
and a second
λ
iteration will be conducted, in which
λ
is
(re)calculated
at every receiving component. If there
are mealy components involved, this results in an updated
vector of output messages
y1
j= (y1
1,j , y1
2,j , . . . , y1
n,j )
with
y1
d,j =λ(sd,j−1, ed,j , x1
d,j ) if x1
d,j 6=x0
d,j
y0
d,j else
Mind that
λ(sd,j−1, ed,j , x1
d,j )6=λ(sd,j−1, ed,j , x0
d,j )
only
for mealy components. The corresponding updated vector
of input messages is
x2
j= (x2
1,j , x2
2,j , . . . , x2
n,j )
with
x2
d,j =ZN,d (xN,j )]Ui∈Id\{N}Zi,d (y1
i,j ), d ∈D
. Now,
for all components
d
with
x2
d,j 6=x1
d,j
,
λ
is
(re)
calculated
again. This process repeats until
(yk−1
1,j , yk−1
2,j , . . . , yk−1
n,j )=(yk
1,j , yk
2,j , . . . , yk
n,j ).
and consequently
(xk
1,j , xk
2,j , . . . , xk
n,j )=(xk+1
1,j , xk+1
2,j , . . . , xk+1
n,j )
for a
k∈N
. If such a value
k
does not exist, the model is
called illegitimate. Otherwise, the model is legitimate and
the content of all input bags ’stabilises’, resulting in ﬁnal in
put bags
xj= (x1,j , x2,j , . . . , xn,j ) = (xk
1,j , xk
2,j , . . . , xk
n,j )
for time instant
tj
. Then, with these input bags, the state
transition function
δd(sd,j−1, ed,j , xd,j )
can be applied for
each component that has experienced an event at time
tj
,
resulting in the new state
(s1,j , s2,j , . . . , sn,j )
of the system.
Now, the question arises, what it needs for a
RPDEVS
model to be not illegitimate.
3.3 Algebraic Loops and Illegitimate Models
For every instant of time
tj
and every pair of components
i, d ∈D, we can deﬁne an
Deﬁnition 2. input transport function
ξi,d,j :Xi→Xd,
xk
i,j 7→ ξi,d,j (xk−1
i,j ) = Zi,d λi(si,j−1, ei,j , xk−1
i,j )
For a given input bag
xk−1
i
at component
i
,
ξi,d,j
calculates
the part of the input bag of component
d
that is produced
by component
i∈D
at time
tj
. For the case of
i
being
the coupled model
N
itself, the input transport function is
deﬁned as
ξN,d,j :XN→Xd,
xN,j 7→ ξN,d,j (xN ,j ) = Zi,d(xN ,j ).
As explained in section 3.2, there may be multiple
λ

iterations, especially if mealy components are involved.
After the ﬁrst
λ
iteration, the input bag of a component
d
can be calculated as
x1
d,j =]
i∈Id
ξi,d,j (x0
i) = ξN,d,j (xN,j )]]
i∈Id\{N}
ξi,d,j (x0
i,j ).
After the k−th λiteration, the input bag is
xk
d,j =]
i∈Id
ξi,d,j (xk−1
i,j ) = ξN,d,j (xN,j )]]
i∈Id\{N}
ξi,d,j (xk−1
i,j ).
Next, we deﬁne for an instance of time
tj
, and every
d∈D
,
and k∈N+, the
Deﬁnition 3. input bag function χk
d,j of order k
χk
d,j :XN×X1× · · · × Xn→Xd,with
χk
d,j (xN, x1, . . . , xn) =
]
i∈Id
ξi,d,j (xi),for k= 1, and else
]
i∈Id
ξi,d,j χk−1
i,j (xN, x1, . . . , xn)
Notice that
χ1
d,j (xN,j , x0
1,j , . . . , x0
n,j ) = x1
d,j and
χk
d,j (xN,j , xl
1,j , . . . , xl
n,) = xl+k
d,j for l∈N(4)
Further, we deﬁne a coupled RPDEVS model (3) to be
Deﬁnition 4. free of algebraic loops
at time tj, if ∀d∈D, k ∈N, xi∈Xi, i ∈DNit fulﬁls:
χk
d,j (xN, x1, . . . , xd, . . . , xn) = χk
d,j (xN, x1,...,˜xd, . . . , xn)
∀xd6= ˜xd∈Xd
Preprints of the 9th MATHMOD
Vienna, Austria, February 2123, 2018
272
In other words, a model is free of algebraic loops, if for
every component
d
the content of its input bag after an
arbitrary number of
λ
iterations is not inﬂuenced by its
(initial) content before these λiterations.
Theorem 5. If a RPDEVS model is
free of algebraic loops
,
it is legitimate, that is, it exists a k∈ {1,2, . . . , n}with:
(xk
1,j , xk
2,j , . . . , xk
n,j )=(xk+1
1,j , xk+1
2,j , . . . , xk+1
n,j )
Proof.
As in the following, we will restrict our consider
ations to a ﬁxed point in simulation time
tj
, the index
j
will be omitted to improve readability.
In preparation for the proof, some deﬁnitions are made.
First, we deﬁne the
Deﬁnition 6. inﬂuencer set Ik
dafter k λiterations
of a component d∈Das
Ik
d=
Id, k = 0
Ik−1
d∪[
i∈Ik−1
d
Ii, k > 0
From the deﬁnition it is clear that
Ik
d⊆Ik+1
d⊆D
, and
further that either
Ik
d(Ik+1
d
and thus
Ik+1
d≥Ik
d+ 1
,
or that
Ik
d=Ik+1
d
. In the second case, we can deduced that
also
Ik+2
d=Ik+1
d∪Si∈Ik+1
dIi=Ik
d∪Si∈Ik
dIi=Ik+1
d
, and
therefore that
Ik+l
d=Ik
d,∀l∈N
. Consequently,
Ik
d
must
be strictly increasing with
k
until it sticks at a ﬁnal value.
This ﬁnal value has to be smaller or equal
D=n
, because
Ik
d⊆D
and thus we know that it will be reached at least
for
k=n
due to the strict monotony (
In
d=In+1
d
). Further,
it can be derived that ∀i∈Id, In
i⊆In
d.
Second, for an arbitrary set of initial input bags
x0= (xN, x0
1, . . . , x0
n),
and for the corresponding vector of input bags after
k
λiterations
xk= (xN, xk
1, . . . , xk
n),
we deﬁne
xk
Z= (xN,˜xk
1,...,˜xk
n),for Z⊆D
with
˜xk
d=x0
dif d∈Z
xk
delse
For example for Z=D:xk
Z=x0.
Now, consider a coupled RPDEVS with initial input bags
x0
. We will show that the input bag of a component
d
after
n+ 1 λiterations is equal to the bag after n λiterations.
xn
d=χn
d(xN, x0
1, . . . , x0
d, . . . , x0
n) = χn
d(x0)
xn+1
d=χn
d(xN, x1
1, . . . , x1
d, . . . , x1
n) = χn
d(x1)
Due to the assumption about our model to be free
of algebraic loops, we know that the value
x1
d
does
not inﬂuence
xn+1
d
, and thus we can replace it by
x0
d
:
χn−1
d(x1) = χn−1
d(x1
{d})
. Furthermore, all input bags
x1
c
from components
c /∈In
d
which do not inﬂuence component
d
at all can also be replaced by
x0
c
. Therefore, we get for
Zd= (D\In
d)∪ {d}:
xn+1
d=χn
d(x1) = χn
d(x1
Zd) = ]
i1∈Id
ξi1,d χn−1
i1(x1
Zd)(5)
If
Zd=D
, which would either mean
In
d=∅
, or
In
d={d}
,
we are ﬁnished, as in this case
xn+1
d=χn
d(x1
Zd) = χn
d(x0) = xn
d
Otherwise, for all
i1∈Id
we deﬁne
Zi1=Zd∪(D\In
i1)∪{i1}
.
Because
i1∈In
d
implies
i1/∈Zd
, we know that
Zd(Zi1
,
and therefore Zd<Zi1 ≤ n.
For every i1∈Id,χn−1
i1(x1
Zd) in (5) can be calculated as:
χn−1
i1(x1
Zd) = χn−1
i1(x1
Zi1) = ]
i2∈Ii1
ξi2,i1χn−2
i2(x1
Zi1)
(6)
For all
i1∈Id
with
Zi1=D
, we are ﬁnished, as for those
i1we get
χn−1
i1(x1
Zd) = χn−1
i1(x1
Zi1) = χn−1
i1(x0),
and for all other
i1∈Id
we deﬁne
Zi2=Zi2∪(D\In
i2)∪{i2}
for all
i2∈Ii1
. Now we can repeat the arguments from
above regarding the calculation of χn−2
i2(x1
Zi1) in (6):
χn−2
i2(x1
Zi1) = χn−2
i2(x1
Zi2) = ]
i3∈Ii2
ξi3,i2χn−3
i3(x1
Zi2)
For the index sets we have
Zd(Zi1(Zi2(. . .
. The
case
Zd=∅
has already been treated above. Consequently,
Zil ≥ l+ 1
and therefore, at least for
in−1
it is
Zin−1=D
∀in−1∈Iin−2. This implies
χ1
in−1(x1
Zin−2) = χ1
in−1(x1
Zin−1) = χ1
in−1(x0),
and, because of
χ2
in−2(x1
Zin−2) = ]
in−1∈Iin−2
ξin−1,in−2χ1
in−1(x0)=χ2
in−2(x0)
the argument
x0
of the
χ
functions propagates back until
ﬁnally
χn−1
i1(x1
Zd) = ]
i2∈Ii1
ξi2,i1χn−2
i2(x0)=χn−1
i1(x0)
and thus
xn+1
d=]
i1∈Id
ξi1,d χn−1
i1(x0)=χn
d(x0) = xn
d
3.4 Closure Under Coupling
Like both Classic and Parallel DEVS, RPDEVS also
provides closure under coupling, which we now will show.
Consider an arbitrary coupled
RPDEVS N
as deﬁned in (3).
Closure under coupling means, that
N
can be substituted
by an atomic RPDEVS
α=< Xα, S, Yα, δ, λ, ta > . (7)
In order to proof closure under coupling all parts of the
deﬁnition of
α
have to be provided by using the functions
and sets deﬁning the
n
components and the couplings of
N.
Input and output sets, the state of the system, and the
time advance function can be deﬁned straightforward:
Xα=XN
Yα=YN
s= (s1, e1, s2, e2, . . . , sn, en)
ta(s) = minta(si)−ei:i∈ {1, . . . , n}
Preprints of the 9th MATHMOD
Vienna, Austria, February 2123, 2018
273
For the output function
λ
and the state transition function
δ
, we deﬁne the following terms for a given instant of time:
IMM := {d:ta(sd) = ed}. . . set of imminents
INF := {d:xd6=∅} . . . set of inﬂuenced components
Thereby,
xd
is the ﬁnal input bag of component
d
, resulting
from the λiteration:
xd=χn
d(xN,∅,...,∅)
With this deﬁnitions, we can specify λas
λ(s, e, xN) = ]
d∈IN
ξd,N (xd),(8)
and the state transition function δas
δ(s, e, xN)=(s0
1, e0
1, s0
2, e0
2, . . . , s0
n, e0
n),(9)
with ∀d∈D:
(s0
d, e0
d) = (δd(sd, ed+ta(s), xd),0) d∈IM M ∪IN F
(sd, ed+ta(s)) otherwise
4. DISCUSSION AND CONCLUSION
After recapping
PDEVS
and describing how sequentially
processing of inputs occurs in
PDEVS
in example 1, we
introduced
RPDEVS
. Using
RPDEVS
instead of
PDEVS
in example 1 would result in the following function calls:
1stλ−iteration :xa,c =Za,c(λa(sa,0, ea,1,∅))
xa,d =Za,d(λa(sa,0, ea,1,∅))
2ndλ−iteration :xc,d =Zc,d(λc(sc,0, ec,1,{xa,c }))
yd=λd(sd,0, ec,1,{xa,d})
3rdλ−iteration :yd=λd(sd,0, ec,1,{xa,d, xc,d })
δ−phase :sa,1=δa(sa,0, ea,1,∅)
sc,1=δc(sc,0, ec,1,{xa,c})
sd,1=δd(sd,0, ed,1,{xa,d, xc,d })
Compared to the sequence in
PDEVS
, instead of having
alternating
λ
 and
δ
phases, we have repeating
λ
iterations
followed by one single
δ
phase. In the
δ
phase the ﬁnal
input bags are available. This allows modelling components
with mealy behaviour without having to use transitory
states. It is still possible to change into a transitory state
in
RPDEVS
, forcing multiple
δ
phases (i.e. multiple state
updates) in one instant of time. However, it is not necessary
any more in order to achieve mealy behaviour, which puts
the general necessity of transitory states into question.
As long as no transitory states are used in
RPDEVS
,
there is no sequential processing of concurrent input
messages. Components can be modelled independently of
their possible surroundings and thus, show transparent
behaviour. When deﬁning
λ
and
δ
for a reusable component,
only the component’s state and the possible sets of input
messages need to be considered, without having to keep in
mind that there may be a partially sequential processing
of concurrent input messages.
In
PDEVS
, the
δ
function always has to store the history
of the current
λ

δ
iteration in the state, as succeeding calls
of
λ
and
δ
have to consider which input messages arrived
already in former iterations and which output messages
have been produced then. Moreover, output messages
generated in former iterations may became invalid after
the arrival of additional inputs in a subsequent iteration.
In
RPDEVS
,
λ
becomes more complex than in
PDEVS
,
as it is equipped with additional arguments (input bag,
elapsed time). However, when deﬁning
λ
in
RPDEVS
,
preceding calls in the current
λ
iteration do not have to
be considered and formerly created output messages are
overwritten automatically by the simulation algorithm.
For a complete introduction of
RPDEVS
, the formal
deﬁnition of an abstract simulator is missing. Such a
deﬁnition already exists and will be provided in the
future. Nevertheless, a proofofconcept implementation
of a concrete RPDEVS simulator is already available with
PowerRPDEVS
1
. PowerRPDEVS is PowerDEVS with a
reprogrammed simulation engine that supports RPDEVS.
REFERENCES
Chow, A.C.H. and Zeigler, B.P. (1994). Parallel DEVS:
a parallel, hierarchical, modular, modeling formalism.
In Proc. of Winter Simulation Conference’94, 716–722.
Society for Computer Simulation International.
Chow, A.C., Zeigler, B.P., and Kim, D.H. (1994). Abstract
simulator for the parallel DEVS formalism. In Proc. of
the Fifth Annual Conference on AI, and Planning in
High Autonomy Systems, 157–163.
Cicirelli, F., Furfaro, A., and Nigro, L. (2007). Conﬂict
management in PDEVS: an experience in modelling
and simulation of time petri nets. In Proc. of Summer
Computer Simulation Conference (SCSC’07), 349–356.
Society for Computer Simulation International.
Franceschini, R., Bisgambiglia, P.A., Touraille, L., Bisgam
biglia, P., and Hill, D. (2014). A survey of modelling
and simulation software frameworks using discrete event
system speciﬁcation. In Proc. of 2014 Imperial College
Computing Student Workshop, 40–49.
Goldstein, R., Breslav, S., and Khan, A. (2013). Informal
DEVS conventions motivated by practical considerations.
In Proc. of Symposium on Theory of Modeling and
Simulation  DEVS Integrative M&S Symposium, 10:1–
10:6.
Junglas, P. (2016). Pitfalls using discrete event blocks in
simulink and modelica. In Tagungsband des Workshops
der ASIM/GIFachgruppen STS und GMMS 2016, 90–97.
ARGESIM Verlag Wien, Hochschule HammLippstadt
2016.
Preyser, F.J. (2015). An approach to develop a user friendly
way of implementing DEV&DESS models in PowerDEVS.
Masterthesis, Vienna University of Technology.
Preyser, F.J., Heinzl, B., Raich, P., and Kastner, W. (2016).
Towards extending the parallelDEVS formalism to
improve component modularity. In Beitr¨age zum Work.
der ASIM/GIFachgruppen STS und GMMS 2016, 83–89.
ARGESIM Verlag Wien, Hochschule HammLippstadt
2016.
Raich, P., Heinzl, B., Preyser, F., and Kastner, W. (2016).
Modeling techniques for integrated simulation of indus
trial systems based on hybrid PDEVS. In Proc. of 2016
Workshop on Modeling and Simulation of CyberPhysical
Energy Systems (MSCPES), 1, 1–6. Vienna.
Traor´e, M.K. (2007). Easy DEVS. In Proc. of the 2007
spring simulation, 1, 214–216.
Zeigler, B.P., Praehofer, H., and Kim, T.G. (2000). Theory
of Modeling and Simulation: Integrating Discrete Event
and Continuous Complex Dynamic Systems. Academic
Press.
1available at: https://sourceforge.net/projects/powerrpdevs/
Preprints of the 9th MATHMOD
Vienna, Austria, February 2123, 2018
274