-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
127 lines (90 loc) · 3.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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:
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