root/vtcross/trunk/src/libvtcross/swig/libcross_demo.py @ 302

Revision 302, 0.7 KB (checked in by trnewman, 15 years ago)

Python demo updates

  • Property svn:executable set to *
Line 
1# Simple Python demonstration script for using
2# the CROSS system.
3#
4# Use with demo.xml shell configuration file
5#   Instructions:
6#       Start shell with demo.xml config from the examples directory
7#       Start cognitive engine
8#       Run this script
9#       
10
11from cross import *
12
13p = Parameter(2)
14currentParameters = Parameter(2)
15o = Observable(2)
16
17o[0].value = 150.00
18o[0].name = "throughput"
19
20o[1].name = "PER"
21o[1].value = 12.00
22
23currentParameters[0].name = "bandwidth"
24currentParameters[0].value = 300.0
25
26currentParameters[1].name = "bandwidth"
27currentParameters[1].value = 10.0
28
29p = GetOptimalParameters(o,2,currentParameters,2);
30
31for i in range(2):
32    print p[i].name, p[i].value
33
34
Note: See TracBrowser for help on using the browser.