-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
64 lines (43 loc) · 1.44 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
====================================
Virtual Laboratory Environment 1.1.x
====================================
A nodejs/javascript binding for the VFL.
See AUTHORS and COPYRIGHT for the list of contributors.
Requirements
------------
* node (>= 4.5.0 - stable version)
* npm (>= 3.x)
* node-gyp (>= 3.x)
* vle (>= 1.1.3)
* c++ compiler (gcc >= 4.4, clang >= 3.1, intel icc (>= 11.0)
Getting the code
----------------
The source tree is currently hosted on Github. To view the
repository online: https://github.com/vle-forge/node-vle
The URL to clone it:
::
git clone git://github.com/vle-forge/node-vle.git
Once you have met requirements, compiling and installing is very simple:
::
cd node-vle
npm install
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.
Usage
-----
::
var vle = require('node-vle');
var vpz = new vle.Vle("test_package", "test_simulation.vpz");
vpz.condition_port_clear('cond_xxx', 'aVariable');
vpz.condition_add_value('cond_xxx', 'aVariable', new vle.value([0, 1, 2, {x: 100}]));
vpz.condition_port_clear('cond_xxx', 'anotherVariable');
vpz.condition_add_real('cond_xxx', 'anotherVariable', 1000);
var result = vpz.run();
var dates = res.view_xxxx.time;
var series = res.view_xxx.TopModel.SubModel.SubSubModel.AtomicModel.data;
var sum = 0;
for (var i = 0; i < dates.length; ++i) {
sum += series[i];
}