Listing 4: The C++ interface of the simulators in VLE.
1class Dynamics {
2public:
3virtual Time timeAdvance() const;
4virtual void internalTransition(
5const Time& time);
6virtual void externalTransition(
7const Time& time,
8const ExternalEventList& lst);
9virtual void output(
10const Time& time,
11ExternalEventList& out) const;
12virtual void confluentTransition(
13const Time& time,
14const ExternalEventList& lst);
15virtual Value* observation(
16const ObservationEvent& event) const;
17};
port X
obs
. λ
obs
is also a constant function to pre-
vent user to modify the state of its model. This
function returns a Value (simple type as integer,
real, Boolean, string, and complex type as set, dic-
tionary, matrix.).
Thus, the observation function of the simulator
that implements the Euler method (a numerical pro-
cedure for solving ordinary differential equations) in
VLE, the C++ code is:
1 Value* Euler::observation(
2 const ObservationEvent& event) const
3 {
4 double e = event.getTime() - mLastTime;
5
6 return getEstimatedValue(e);
7 }
The function getEstimatedValue calculates an
approximation of the value of the variable. It uses
the current value of the state variable and the time
elapsed since the last transition. This observation
function does not change the current state of the vari-
able. Thus, we respect the reproducibility of the sim-
ulation. However, we create additional cost calcu-
lations for each observation. This extra cost can be
important if the observation function is complex and
if called often. However, we believe that observing
a model often is only needed when debugging the
model.
3.3 Using Models with VLE
The study of the models is very important in the mod-
eling and simulation cycle. Generally, this analysis is
performed with an experimental setting. Experimen-
tal frames as sensitivity analysis, replicas generation
are used to study or to validate models. One impor-
tant motivation in formalizing the observation process
in PDEVS is to develop generic experimental frames,
which ones rely on intensive observation of models.
VLE is an environment for M&S. It relies on a
set of libraries for modeling, simulation and analy-
sis. These libraries developed in C++ are available
for several programming languages. Thus, in order
to collaborate with users of statistical tools, we pro-
vide an interface to the program R (R Development
Core Team, 2012). R is a tool and language for statis-
tical computing. This package named RVLE allows
the user to run simulations, changes its parameters
and retrieves simulation results (from the extension
observation). This package combined with another
packages of R as the classical sensitity package per-
mit to build experimental frames to validate, explore
and optimize models. On this principle, we also offer
program and PYVLE JVLE to develop web services
based on simulation.
4 CONCLUSIONS
In this paper, in section 2, we extend the PDEVS for-
malism to introduce the observation of models in the
formalism. This work was motivated by the separa-
tion between the dynamics of the system and its ob-
servation as a fundamental issue. This addition to the
formalism is closed under coupling and allows build-
ing observations in a hierarchical and modular man-
ner. The abstract simulators necessary for this exten-
sion were provided. In addition, we provided an im-
plementation of this observation extension in the VLE
simulators. This DEVS extension is crucial for us to
develop experimental design and to abstract observa-
tion from models dynamic. However, a type of obser-
vation is missing in these works. It concerns the event
observation of atomic models. In PDEVS terminol-
ogy, after each change in δ
int
, δ
ext
or δ
con
transition
functions. We work on the formalization of this new
type of observation.
REFERENCES
Bergero, F. and Kofman, E. (2010). PowerDEVS: a tool
for hybrid system modeling and real-time simulation.
SIMULATION.
Bergez, J.-E., Chabrier, P., Gary, C., Jeuffroy, M.,
Makowski, D., Quesnel, G., Ramat, E., Raynal, H.,
Rousse, N., Wallach, D., Debaeke, P., Durand, P.,
Duru, M., Dury, J., Faverdin, P., Gascuel-Odoux, C.,
and Garcia, F. (2012). An open platform to build, eval-
uate and simulate integrated models of farming and
SIMULTECH2012-2ndInternationalConferenceonSimulationandModelingMethodologies,Technologiesand
Applications
40