Virtual Laboratory Environment

Version 2.1.0

A Modeling & Simulation Environment

Atomic model

VLE implements the DEVS abstract simulators and more precisely the DSDE which merge Parallel DEVS and DS-DEVS.

In VLE, a DEVS atomic model is represented as a object which inherits of the vle::devs::Dynamics C++ class.

class MyModel : public vle::devs::Dynamics
MyModel(const DynamicsInit& init, const vle::devs::InitEventList&  events)
    : vle::devs::Dynamics(init, events)

~MyModel() override = default;

// Process the initialization of the model by
// initializing the initial state and return
// the duration (or timeAdvance) of the initial
// state.
init(vle::devs::Time time) override

// Process the output function: compute the output function.
output(vle::devs::Time time,
       vle::devs::ExternalEventList& output) const override

// Process the time advance function: compute the duration
// of the current state.
timeAdvance() const override

// Process an internal transition: compute the new
// state of the model with the internal transition function.
internalTransition(vle::devs::Time time) override

// Process an external transition: compute the new state
// of the model when an external event occurs.
externalTransition(const vle::devs::ExternalEventList& events,
                   vle::devs::Time time) override

// Process the confluent transition, by default,
// confluentTransitions call internalTransition and
// externalTransition but this function can be overridden
// to develop its own dynamics.
virtual void
confluentTransitions(vle::devs::Time time,
                     const vle::devs::ExternalEventList& events) override

// Process an observation event: compute the current state
// of the model at a specified time and for a specified port
observation(const vle::devs::ObservationEvent& event) const override

// When the simulation of the atomic model is finished,
// the finish method is invoked
void finish() override

}; // End of class definition

// Finally, this macro enables the link between VLE, the shared library
// produced by C++ compiler and your model.
Last updated on 16 Dec 2016, 12:32
Published on 16 Dec 2016, 12:32
 Edit on GitHub