Conference PaperPDF Available

RPDEVS: Revising the Parallel Discrete Event System Specification

Authors:

Abstract and Figures

In this work, we present a Revised Parallel DEVS (RPDEVS) formalism. The Classic Discrete Event System Specification (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 different 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.
Content may be subject to copyright.
RPDEVS: Revising the Parallel Discrete
Event System Specification
Franz Preyser Bernhard Heinzl Wolfgang Kastner
Automation Systems Group, Vienna University of Technology, A-1040
Vienna, Austria (e-mail: {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 Specification (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 different 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: Discrete-event systems, Mathematical models, Modelling, Simulation, DEVS,
PDEVS, RPDEVS, Algebraic loop, Transitory state, Mealy behaviour
1. INTRODUCTION
Discrete Event System Specification (
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 scientific community, which
can be verified 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 difficulties with both formalisms (Preyser et al.
(2016)). But also others describe similar problems (Traor´e
(2007), Cicirelli et al. (2007)).
DEVS
follows a component-based approach where models
can be designed in a modular-hierarchical manner. Each
component has an inner state which is updated either due to
the arrival of an input messages or due to internal dynamics.
Difficulties 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 re-usability 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), specific
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 efficient
design of large-scale models, a modelling formalism should
support re-usability 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 fulfil 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 finally
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 defined within
Preprints of the 9th Vienna International Conference on
Mathematical Modelling
Vienna, Austria, February 21-23, 2018
Copyright © 2018 IFAC 269
the component, but results from the definition of the
coupling model, the component is used in. Consequently,
when designing a re-usable model component, the modeller
has to consider every possible processing order.
PDEVS
improves this situation significantly. 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)|sS, e [0, ta(s)]}
δint :SS . . . internal state transition function
δext :Q×XbS . . . external state transition function
δconf :S×XbS . . . confluent state transition function
λ:SY . . . output function
According to the
PDEVS
abstract simulator (Chow et al.
(1994)), whenever the life time
ta(s)
of the current state
sS
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)
xbXb
, 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 moore-like 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 confluent 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}dD,{Id}dDN,{Zi,d}i,dDN>
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 dD
IdD∪ {N}. . . influencer set of d, d /Id
Zi,d . . . output translation function
Zi,d :YiXd
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 :XNXd
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 :YiYN
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, first
λ
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 fill their input bags.
The input bag xb
dof component dis calculated as
xb
d=ZN,d (xN)]]
iId\{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 confluent event:
sd,new =δint(sd,old ) / δext(sd,old, ed, xb
d) / δconf (sd,old, xb
d)
2.3 Sequential Processing in PDEVS
At first 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 21-23, 2018
270
To obtain mealy behaviour, a component has to change into
a transitory state
˜s
with
tas) = 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 influenced com-
ponent. This cycle of repeating λ- and δ-phases continues
until every component resides in a non-transitory 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 (λcsc,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 different 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 define 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 re-usable
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 defined by the 6-tuple
< X, S, Y, δ, λ, ta > .
Thereby, δand λhave the following form:
δ:Q×XS
λ:Q×XY(2)
In
RPDEVS
,
λ
is called at any kind of event, internal,
external, and confluent. The explicit distinction between
the different 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 definition 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 definition in (2),
δ
and
λ
may be specified as follows:
δ:Sδ×Sλ×[0,)×XSδ,(sδ, sλ, e, xb)7→ sδ
λ:Sδ×[0,)×XY×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 re-assigned in every call of
λ
to prevent
using an old non-valid 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 definition of a coupled
RPDEVS N
is equal to the
definition of a coupled PDEVS:
< Xb
N, YN, D, {Md}dD,{Id}dDN,{Zi,d}i,dDN>(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,
filling 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 influencer
iId
. If
λi
is
recalculated at an influencer
i
producing the output
yi
, the
content of the corresponding sub-input bag
ixd
is replaced
Preprints of the 9th MATHMOD
Vienna, Austria, February 21-23, 2018
271
by
Zi,d(yi)
. Only if this replacement effectively 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
sub-components
D={1,2, . . . , n}
.
At an instant of time
tj
, before any events are processed,
the state of the system is defined to be the temporal left
limit:
s(tj) = sj1= lim
t%tj
s(t) = (s1,j1, s2,j 1, . . . , sn,j1).
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,j1)
),
λ
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,j1, ed,j , x0
d,j ) if ed,j =ta(sd,j1)
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 )]UiId\{N}Zi,d (y0
i,j ), d D
. If
any non-empty output messages are generated (
dD:
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,j1, ed,j , x1
d,j ) if x1
d,j 6=x0
d,j
y0
d,j else
Mind that
λ(sd,j1, ed,j , x1
d,j )6=λ(sd,j1, 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 )]UiId\{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
(yk1
1,j , yk1
2,j , . . . , yk1
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
kN
. 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 final 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,j1, 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 define an
Definition 2. input transport function
ξi,d,j :XiXd,
xk
i,j 7→ ξi,d,j (xk1
i,j ) = Zi,d λi(si,j1, ei,j , xk1
i,j )
For a given input bag
xk1
i
at component
i
,
ξi,d,j
calculates
the part of the input bag of component
d
that is produced
by component
iD
at time
tj
. For the case of
i
being
the coupled model
N
itself, the input transport function is
defined as
ξN,d,j :XNXd,
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 first
λ
-iteration, the input bag of a component
d
can be calculated as
x1
d,j =]
iId
ξi,d,j (x0
i) = ξN,d,j (xN,j )]]
iId\{N}
ξi,d,j (x0
i,j ).
After the kth λ-iteration, the input bag is
xk
d,j =]
iId
ξi,d,j (xk1
i,j ) = ξN,d,j (xN,j )]]
iId\{N}
ξi,d,j (xk1
i,j ).
Next, we define for an instance of time
tj
, and every
dD
,
and kN+, the
Definition 3. input bag function χk
d,j of order k
χk
d,j :XN×X1× · · · × XnXd,with
χk
d,j (xN, x1, . . . , xn) =
]
iId
ξi,d,j (xi),for k= 1, and else
]
iId
ξi,d,j χk1
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 lN(4)
Further, we define a coupled RPDEVS model (3) to be
Definition 4. free of algebraic loops
at time tj, if dD, k N, xiXi, i DNit fulfils:
χk
d,j (xN, x1, . . . , xd, . . . , xn) = χk
d,j (xN, x1,...,˜xd, . . . , xn)
xd6= ˜xdXd
Preprints of the 9th MATHMOD
Vienna, Austria, February 21-23, 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 influenced 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 fixed point in simulation time
tj
, the index
j
will be omitted to improve readability.
In preparation for the proof, some definitions are made.
First, we define the
Definition 6. influencer set Ik
dafter k λ-iterations
of a component dDas
Ik
d=
Id, k = 0
Ik1
d[
iIk1
d
Ii, k > 0
From the definition it is clear that
Ik
dIk+1
dD
, 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
dSiIk+1
dIi=Ik
dSiIk
dIi=Ik+1
d
, and
therefore that
Ik+l
d=Ik
d,lN
. Consequently,
|Ik
d|
must
be strictly increasing with
k
until it sticks at a final value.
This final value has to be smaller or equal
|D|=n
, because
Ik
dD
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 iId, In
iIn
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 define
xk
Z= (xN,˜xk
1,...,˜xk
n),for ZD
with
˜xk
d=x0
dif dZ
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 influence
xn+1
d
, and thus we can replace it by
x0
d
:
χn1
d(x1) = χn1
d(x1
{d})
. Furthermore, all input bags
x1
c
from components
c /In
d
which do not influence 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) = ]
i1Id
ξi1,d χn1
i1(x1
Zd)(5)
If
Zd=D
, which would either mean
In
d=
, or
In
d={d}
,
we are finished, as in this case
xn+1
d=χn
d(x1
Zd) = χn
d(x0) = xn
d
Otherwise, for all
i1Id
we define
Zi1=Zd(D\In
i1)∪{i1}
.
Because
i1In
d
implies
i1/Zd
, we know that
Zd(Zi1
,
and therefore |Zd|<|Zi1| ≤ n.
For every i1Id,χn1
i1(x1
Zd) in (5) can be calculated as:
χn1
i1(x1
Zd) = χn1
i1(x1
Zi1) = ]
i2Ii1
ξi2,i1χn2
i2(x1
Zi1)
(6)
For all
i1Id
with
Zi1=D
, we are finished, as for those
i1we get
χn1
i1(x1
Zd) = χn1
i1(x1
Zi1) = χn1
i1(x0),
and for all other
i1Id
we define
Zi2=Zi2(D\In
i2)∪{i2}
for all
i2Ii1
. Now we can repeat the arguments from
above regarding the calculation of χn2
i2(x1
Zi1) in (6):
χn2
i2(x1
Zi1) = χn2
i2(x1
Zi2) = ]
i3Ii2
ξi3,i2χn3
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
in1
it is
Zin1=D
in1Iin2. This implies
χ1
in1(x1
Zin2) = χ1
in1(x1
Zin1) = χ1
in1(x0),
and, because of
χ2
in2(x1
Zin2) = ]
in1Iin2
ξin1,in2χ1
in1(x0)=χ2
in2(x0)
the argument
x0
of the
χ
-functions propagates back until
finally
χn1
i1(x1
Zd) = ]
i2Ii1
ξi2,i1χn2
i2(x0)=χn1
i1(x0)
and thus
xn+1
d=]
i1Id
ξi1,d χn1
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 defined 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
definition of
α
have to be provided by using the functions
and sets defining the
n
components and the couplings of
N.
Input and output sets, the state of the system, and the
time advance function can be defined 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 21-23, 2018
273
For the output function
λ
and the state transition function
δ
, we define the following terms for a given instant of time:
IMM := {d:ta(sd) = ed}. . . set of imminents
INF := {d:xd6=∅} . . . set of influenced components
Thereby,
xd
is the final input bag of component
d
, resulting
from the λ-iteration:
xd=χn
d(xN,,...,)
With this definitions, we can specify λas
λ(s, e, xN) = ]
dIN
ξ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 dD:
(s0
d, e0
d) = (δd(sd, ed+ta(s), xd),0) dIM 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 final
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 defining
λ
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 defining
λ
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
definition of an abstract simulator is missing. Such a
definition already exists and will be provided in the
future. Nevertheless, a proof-of-concept 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). Conflict
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 specification. 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/GI-Fachgruppen STS und GMMS 2016, 90–97.
ARGESIM Verlag Wien, Hochschule Hamm-Lippstadt
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 parallel-DEVS formalism to
improve component modularity. In Beitr¨age zum Work.
der ASIM/GI-Fachgruppen STS und GMMS 2016, 83–89.
ARGESIM Verlag Wien, Hochschule Hamm-Lippstadt
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 Cyber-Physical
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 21-23, 2018
274
... However, as discussed in [5], the use of transitory states leads to a delay of events regarding processing order, which in turn impedes reusability of components. Due to the reasons mentioned above and the experiences we made with applying both, DEVS [6] and PDEVS [7], we decided to revise PDEVS resulting in Revised Parallel DEVS (RPDEVS) published in [8]. Basically, the changes include the support of 'true' mealy behavior and the merging of the three state transition functions δ int , δ ext , and δ con f into one generic state transition function δ . ...
... Equally to classic DEVS and PDEVS, RPDEVS distinguishes between atomic and coupled components which can be used for modular and hierarchical structuring of complex models (see Figure 1). As shown in [8], RPDEVS also provides closure under coupling, which means that for every coupled component an equivalent atomic component can be designed. This assures that couplings can be used within other couplings as if they were atomics. ...
... To complete the introduction of RPDEVS started in [8], the definition of an abstract simulator is given. Like in classic DEVS and parallel DEVS, the code consists of a simulator part responsible for executing an atomic, a coordinator part responsible for executing a coupling, and a root-coordinator responsible for the overall model execution. ...
Conference Paper
Full-text available
The Revised Parallel DEVS (RPDEVS) model-ing formalism enhances the Parallel Discrete Event System Specication (PDEVS) by the ability to model 'real' Mealy behavior of components. The term 'real' Mealy behavior can be summarized as immediate output response to an input event without a state transition in between. Although this enhancement simplies model creation, especially of reusable components, it requires a more complex simulation algorithm. In this paper, we present an RPDEVS abstract simulator that describes the simulation execution of RPDEVS models.
... But the description of the underlying components as individual ("atomic") blocks can lead to an ordering of concurrent events in the complete system, which does not agree with the intended behaviour. Therefore Preyser et al. have introduced a Revised PDEVS (RPDEVS) formalism [6] that uses a Mealylike scheme directly -without the introduction of transitory states -and allows for direct modeling of Mealylike components, which behave correctly in the context of a larger system. To make this possible they had to define an abstract simulator for RPDEVS [7] that uses a complicated scheme of internal iterations. ...
... The main difference to the PDEVS formalism described above is the restriction to only one transition function and the extension of the output function, which is now called at all three kinds of events. This is identical to the RPDEVS definition in [6] and allows for a direct formulation of Mealy-type components. The formal difference to RPDEVS is small: All time values and intervals are now meant as subsets of the hyperreals * R and ta is always > 0. But the semantics are slightly different: When an external event, i.e. a set of inputs x ∈ X + , occurs at time t, the output function λ is called at t + τ, followed by an immediate call of δ . ...
Conference Paper
Full-text available
The PDEVS formalism is widely used for the description and analysis of discrete event systems. But PDEVS has some drawbacks in modeling Mealy behavior. A revised version (RPDEVS) has been invented to resolve them, but it has problems of its own, mainly because its complicated simulator structure. The recently proposed NSA-DEVS scheme tries to unite the advantages of both formalisms by using infinitesimal time intervals. To further substantiate this claim we describe an ab- stract simulator for NSA-DEVS, implement it in Matlab and simulate a simple queue-server system. This shows that NSA-DEVS combines the Mealy-like model descrip- tion of RPDEVS with the simple simulator structure of PDEVS, making it a promising approach to implement an improved modeling and simulation system.
... The PDEVS formalism [1] is a well-established method to concisely describe the hierarchical composition and dynamic behaviour of discrete-event based models. To make it directly applicable for concrete modeling and simulation environments, several variations have been proposed [2] ranging from the introduction of input and output ports to the revised version RPDEVS that incorporates a direct Mealy structure [3]. But as has been argued in [4], even then problems remain with the modeling and simulation of causal chains of concurrent events. ...
Article
Full-text available
To utilize the PDEVS formalism for the practical modeling and simulation of discrete-event systems, the recently proposed variant NSA-DEVS combines the Mealy behaviour of RPDEVS with a simple simulator algorithm by employing infinitesimal time delays. To further test the practical usefulness of this new approach, four simple systems showing non-trivial event-cascades are modeled and simulated within a concrete NSA-DEVS environment: A comparator-switch model, a digital circuit with flip-flops, a basic queue-server system and a more complex queuing system. Their simple implementations show that the potentially large number of delay parameters in NSA-DEVS in practice reduces to a single default value, which only occasionally has to be tuned to adapt to complex causal behaviour. In addition, by providing precise formal definitions of the models and by looking closely at the behaviour of the abstract sim-ulator, the validity of the NSA-DEVS formalism is further substantiated.
Conference Paper
Full-text available
When applying classic DEVS modelling in the context of industrial facility simulation, we experienced the well-known drawbacks of DEVS concerning the treatment of simultaneous events. Switching to Parallel DEVS, some of those problems could be avoided, however other, similar problems in connection with mealy components and transient states occurred. In the following work, we try to locate the root of these problems and give a basic example to demonstrate them. Further, possible remedies in the form of modelling work-arounds inside the PDEVS formalism are described, although none of them seems to solve the problems sustainably. Eventually extensions of the formalism itself are proposed with the goal of easing the design of models including mealy components. Finally the consequences of such modifications for the simulation algorithms are discussed.
Conference Paper
Full-text available
The push for energy efficiency of industry processes is driving various efforts to analyze, simulate and optimize the underlying complex and large cyber-physical systems. While some efforts use co-simulation, we instead focus on an integrated hybrid approach that offers the ability to model hybrid components as a whole with all their aspects, based on Hybrid PDEVS. We describe modeling techniques that were developed for this purpose, and demonstrate the feasibility of the approach with a prototypical example. The proposed approach allows describing hybrid models on component level with improved reusability.
Conference Paper
Full-text available
Though Simulink as well as Modelica are basically tools for the modeling of continuous systems, they both contain several elements that allow for discrete and hybrid modeling. Comparing the respective block libraries one finds almost identically looking components, but this similarity is deceptive. Using simple digital circuits with flip-flops as examples, one finds subtle differences in the handling of events, which can lead to an unexpected behaviour of a model. A good understanding of the underlying mechanisms, especially of the Modelica standard description, is therefore essential for the successful modeling of discrete systems. But even then it can be difficult to create models which have the required behaviour.
Thesis
Full-text available
In the area of production process simulation, beside the common logistical optimisation goals, the factor energy consumption is gaining more and more importance. Since energy consumptive processes are usually described continuously, whereas logistic models are purely discrete, con- sidering both leads to hybrid models. A model is called hybrid when its behaviour neither can be described purely continuously nor purely discretely or at least, not without a lot of additional effort. The exact and well defined formulation of the behaviour of hybrid models as well as their solid handling in simulation are very challenging tasks. Concurrent events, state events, and feedback loops in coupled models are the major causes for problems. The goal of this diploma thesis is to introduce formalisms for describing hybrid models and to investigate the possibilities for implementing such models in a specific simulator. As description formalism DEV&DESS, introduced by Herbert Praehofer, has been selected. DEV&DESS is based upon the two formalisms DEVS and DESS introduced by Bernard Zei- gler. Using DEVS discrete event models can be described, whereas DESS is designated for the description of continuous models. The description of these formalisms represents the first part of Chapter 2. In its second part QSS (Quantized State System) is introduced. QSS denotes a set of methods for describing and numerically integrating continuous signals in a discrete event manner. Thus, it is capable of transforming continuous models into DEVS models which can be utilized for the simulation of hybrid systems. The simulator PowerDEVS supports both, the DEVS formalism, and QSS. Therefore, it seems to be quite promising for implementing and simulating hybrid models. Since PowerDEVS will be used in the following chapters, an introduction is given in Chapter 3. When creating and simulating coupled DEVS models, it turns out to be quite difficult to for- mulate a DEVS description leading to exactly the intended behaviour, particularly in situations with concurrent events. This is caused by the way concurrent events are resolved in coupled DEVS. Parallel DEVS (P-DEVS) denotes an extension of DEVS which exactly addresses this drawback. However, PowerDEVS does not support the implementation of P-DEVS models. In Chapter 4 the particular problems that occur with coupled DEVS models in combination with concurrent events and feedback loops are systematically identified and a solution approach for each of them is developed. This process concludes with the definition of the generic Pow- erDEVS library block Atomic PDEVS block. It supports model description in P-DEVS manner and is supposed to solve the problems outlined. In PowerDEVS continuous models can be created graphically as block diagrams comparable to Simulink or Dymola. However, there exists no library block which allows to implement a DEV&DESS model directly. So the topic of Chapter 5 is the development of such a generic library block named Atomic DEV&DESS block which is based on the Atomic PDEVS block introduced in Chapter 4. Finally it is demonstrated how to implement a specific DEV&DESS model in PowerDEVS using the Atomic DEV&DESS block.
Conference Paper
Full-text available
Discrete Event System Specification is an extension of the Moore machine formalism which is used for modelling and analyzing general systems. This hierarchical and modular formalism is time event based and is able to represent any continuous, discrete or combined discrete and continuous systems. Since its introduction by B.P. Zeigler at the beginning of the eighties, most general modelling formalisms able to represent dynamic systems have been subsumed by DEVS. Meanwhile, the modelling and simulation (M&S) community has introduced various software frameworks supporting DEVS-based simulation analysis capability. DEVS has been used in many application domains and this paper will present a technical survey of the major DEVS implementations and software frameworks. We introduce a set of criteria in order to highlight the main features of each software tool, then we propose a table and discussion enabling a fast comparison of the presented frameworks.
Conference Paper
Full-text available
The formalism known as the Discrete Event System Specification (DEVS) provides a set of mathematical elements for modeling time-varying systems. When DEVS is applied in the form of an executable representation, however, some deviation from the formalism is unavoidable. By proposing a set of informal DEVS conventions, we show how certain changes to the formalism, some previously adopted, others less explored, may help simulation tools appeal to users who stand to benefit from DEVS theory but are more cognizant of practical issues. Our conventions use parameters and statistics to encapsulate the state of an atomic model and the composition of a coupled model. They also include changes both to transition functions and the ordering of simultaneous events to promote convenience, efficiency, and reproducibility.
Conference Paper
PDEVS (Parallel DEVS) is a well-known formalism for the specification of complex concurrent systems organized as an interconnection of atomic and coupled interacting components. The abstract simulator of a PDEVS model is normally founded on the assumption of maximal parallelism: multiple components are allowed to undertake at the same time an independent state transition. This paper argues that the hypothesis of maximal parallelism does not allow PDEVS to adequately model and simulate systems where simultaneous state transitions are conflicting to one another. As an example, an original PDEVS model of Merlin and Farber Time Petri Nets is proposed. The realization owes to ActorDEVS, a lean and efficient PDEVS M&S framework in Java, which enables the simulation control structure to be customized. The accomplished experience suggests that some points in the formal definition of PDEVS should possibly be adapted in order to widen the applicability of the language.
Conference Paper
DEVS is a well-established M&S framework. Through the history of its development, two main strands stoud out clearly: the so-called Classic DEVS and Parallel DEVS. Today, there is a need for DEVS modelers to deal with a unified formalism, as well as with a powerfull and yet intuitive formalism. This paper is a contribution to these needs. Three aspects are considered: (1) the strong link between the output and the internal transition functions and its impact on the modeling effort, (2) the coupling issue and its implicit impact on the transitions collision problem that has led to classic DEVS and parallel DEVS and, (3) the way to provide a unified specification framework.
Conference Paper
We present a revision of the hierarchical, modular Discrete Event System Specification (DEVS) modeling formalism. The revision distinguishes between transition collisions and ordinary external events in the external transition function of DEVS models. Such separation enables us to extend the modeling capability of the collisions. The revision also does away with the necessity for tie-breaking of simultaneously scheduled events, as embodied in the select function. The latter is replaced by a well-defined and consistent formal construct that allows all transitions to be simultaneously activated. The revision provides a modeler with both conceptual and parallel execution benefits.