Skip to content

vle-forge/pyvle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Laboratory Environment: Python binding
==============================================

See AUTHORS and COPYRIGHT for the list of contributors.

VLE is an operational framework for multi-modeling, simulation and analysis of
complex dynamical systems. It addresses the reliability issue by using recent
developments in the theory of modeling and simulation proposed by B. Zeigler
with the Discrete Event System Specification formalism (DEVS).

Requirements
------------

vle		0.8.0 http://www.vle-project.org
boost		1.35  http://www.boost.org
cmake		2.6.0 http://www.cmake.org
python          2.5   http://www.python.org


Getting the code
----------------

The source tree is currently hosted on Sourceforge. To view the repository
online :
    http://vle.git.sourceforge.net/git/gitweb.cgi?p=vle/pyvle

The URL to clone it:
    git://vle.git.sourceforge.net/gitroot/vle/pyvle


Reporting bug
-------------

Please, report bugs into the VLE sourceforge trackers :
    http://sourceforge.net/tracker/?group_id=94199&atid=1127149


Translations
------------

If you want to translate PyVLE, please contact the VLE development team:
    [email protected]


Mailing lists
-------------


There is three mailing lists for VLE. More info here:
    http://sourceforge.net/mail/?group_id=94199

    * vle-tracker: all commit and tracker information.
    * vle-users: users and developper list.
    * vle-news: to keep news on vle, (release, etc.).


License
-------

This software in GPLv3 or later. See the file COPYING. Some files are under a
different license. Check the headers for the copyright info.


Installation
------------

The following commands configure, build and install VLE into your account:

$ tar zxf pyvle-0.9.0.tar.gz
or
$ git clone git://vle.git.sourceforge.net/gitroot/vle/pyvle

1. Installation in the distribution directory

    If you wan to install pyvle into the classical python directory
    (/usr/lib/python-2.x/), just follow the commands:

    $ cd pyvle
    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_INSTALL_PREFIX=/usr
            -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
    $ make
    $ make install

2. Installation in $HOME directory:

    If you want to install pyvle into your $HOME (or any other directory)
    directory, you need to add an environment variable PYTHONPATH into your
    shell. For instance for bash, add the following line. Update the python2.6
    with the version of the python you use:

    PYTHONPATH=$HOME/usr/lib/python2.6:$HOME/usr/lib/python2.6/lib-dynload

    $ cd pyvle
    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_INSTALL_PREFIX=$HOME/usr
            -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
    $ make
    $ make install


Usage
-----

$ python
Python 2.5.4 (r254:67916, Sep 26 2009, 10:32:22)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvle
>>> from pyvle import Vle
>>> dir(pyvle.Vle)

>>> from pyvle import Vle
>>> f = Vle("$HOME/usr/share/vle-0.8.0/examples/equation1.vpz")
>>> print(f)
<pyvle.Vle instance at 0x7fe231515e60>
>>> f.listConditions()
['cond', 'cond_A', 'cond_B', 'cond_C', 'cond_D', 'cond_sum' ]
>>> f.listConditionPorts('cond_A')
['name', 'value']
>>> f.getConditionPortValues('cond_A', 'value')
0.0
>>> f.clearConditionPort('cond_A', 'value')
>>> f.addRealCondition('cond_A', 'value', 1)
>>> f.getConditionPortVal