Next: 5.5 Mapping from Programming
Up: 5. MAPPINGS
Previous: 5.3 Mapping from Statecharts
Contents
Index
5.4 Mapping from DEVS to DCharts
DEVS models can also be transformed into DCharts. Because of the
closure under coupling of DEVS, any Coupled DEVS can be replaced by an
Atomic DEVS that has the same behavior. It is not necessary to
consider coupled DEVS in proving the mapping from DEVS to DCharts.
The DEVS formalism discussed here is real-time DEVS, which use the
real time instead of virtual time as global time. The time unit is
default to second.
Theorem 3
DEVS models can be transformed into DCharts that have exactly the same
behavior.
Proof Different parts of an Atomic DEVS are mapped to DCharts
constructs as following:
- The state set is mapped to a single variable of a
DCharts model, whose state hierarchy has only one default state
. The state space of is a superset of . This variable
can always be found. It can be of a primitive type such as integer
or string, a list which contains multiple elements, or any other
types supported by the action language. This variable is used to
keep track of the model state.
- The time advance function and internal transition
function are transformed into transitions with
events. Each of such DCharts transitions is a self-loop on
the state . It uses as its event, where is the
of a DEVS state. The guard of the transition checks the
current state of the variable , and tests if the model is in
the old state of the DEVS model. In the output of this transition,
is modified according to the of the DEVS model.
- The external transition function is transformed
into transitions with the same event names. This transformation is
similar to the transformation between and DCharts
transitions.
The elapsed time of an external transition can be computed with
the primitive action that allows access to the time since the
simulation or execution starts. Suppose the time when the last
state is entered is . It is obtained with the time action
in the enter actions of the state. The time when the external
event is received is denoted by . This time can be
obtained in the guard (since the time action is side-effect-free)
or the output of the transition. Then the elapsed time is equal to
, which can be known in the guard and the output.
- The (input set) and (output set) of the DEVS model is
ignored, since DCharts do not require to explicitly declare them.
- The output function is transformed into action code
in the output of transitions. It produces the same output as the
DEVS model, according to the current state of the model.
The events sent in the output of a DEVS transition are different
from the events broadcast in a statecharts, because the first kind
of events are explicitly sent to an output port. Fortunately,
this kind of events are equivalent to the out-going messages in
DCharts, which are textually represented as a port name and an
event name separated by a dot.
Next: 5.5 Mapping from Programming
Up: 5. MAPPINGS
Previous: 5.3 Mapping from Statecharts
Contents
Index
Thomas Huining Feng
2004-04-28