Home | Download/Install | Documentation | Packages | Screenshots | News | Forum/Mailing-lists | Contact | GForge

Coding Sprint OpenAlea-VLE

Objective : Setting-up a simple, yet generic, wrapping of OpenAlea nodes for the Record/VLE Platform

INRIA Montpellier, La Galera

Participants :

  • Anne-Laure Sabadel
  • Nathalie Rousse
  • Christophe Pradal
  • Christian Fournier

Concepts

  • in OpenAlea a model, or node, is a callable object with named inputs and outputs that can be connected to other nodes.
  • in VLE a model is an atomic DEVS component, that is an object with : a set of inputs events, a set of output events, an internal transition function, a time advance function, an external transition function and an output transition function
  • During the coding we worked of a simple, yet generic, wrapping of an OpenAlea node into an Atomic DEVS for VLE:
    • OpenAlea node inputs are searched in attributes of Inputs events
    • OpenAlea node outputs are send to output events attributes
    • OpenAlea node evaluation is called at each internal transition
    • the time advance function is set to a constant delay, chosen by the user
    • the external transition function ensure the update of node inputs by scanning attributes of incoming events
    • the output transition function creates outputs events from values read in node outputs
  • This scheme is generic in the sense that it allows an automatic export of OpenAlea nodes, whatever the number of node inputs and outputs. Names of node inputs/ouputs are used to automatically match attributes of input/output events.
  • Input events send at initialisation by vle are used to inform the generic model of the OpenAlea name and package to use, and also to send parameters to the OpenAlea function.
  • We do not consider during this coding sprint the mapping of the delay function of OpenAlea nodes to the time advance function

Implementation

  • We create a generic python module that is able to wrap any OpenAlea node (simple or composite) into a devs atomic model according to the rules described above.
  • This module (OpenAlea.py) is part of the VLE PyDynamics package, that allows writing atomics devs in Python and convert values between C++ and Python. The module thus provide generic code for :

  • During the definition of the DEVS system (edition of the prz file), the user sets 5 parameters per openalea node :
    • 2 parameters (paths) are used by vle to locate the pynamics package
    • 2 parameters (package_name and node_name) are used by the generic python module to retrieve the OpenAlea node
    • 1 parameter sets the delay for the internal transition of the openalea node
  • At initialisation, the python modules call the OpenAlea package manager, retrieve the node factory of the node and sets the eval function, the list of argument names of the function, as well as two dicts for storing attributes and conditions

  • During the simulation, before each internal transition, the args of the openalea nodes are searched into the dict of attributes and initial conditions
  • during external transition the incoming attributes are converted to python values and stored in the attribute dict
  • during out put transition, C++ events are created by converting node outputs to SWIG types.

Issues and Trics

  • We test the coupling under Ubuntu, and we had to declare manually in the PYTHONPATH variable many of the common path to packages that are normally found without problem by python console
  • VLE should be compiled with options that allow uses of python extensions in the embedded python code(see http://docs.python.org/2/extending/embedding.html#compiling-and-linking-under-unix-like-systems)
  • Additionally, Pydynamics library should be pre-loaded before compilation of the model embedding the openalea node. To do so, the user has to set the LD_PRELOAD environment variable :

Details

  • A detailed report of the coding, including an example of the coupling of ADEL-Caribu openalea nodes with VLE model 2CV, could be found in this document : compte_rendu-openalea-vle.pdf(in French, written by A.L Sabadel)

Next Steps

  • automate, the edition of the prz file from Openalea, and test the launch from visualea
  • fix the location of the PyDynamic/generic python module and save two parameters during model definition
 
documentation/core/coding_sprint_openalea-vle_july_2013.txt · Last modified: 2013/07/29 15:41 by user   Back to top
INRIA   INRA     CIRAD     AGROPOLIS IBC
INRIA GForge RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki