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

Revision 412, 1.3 KB (checked in by trnewman, 15 years ago)

Adding Apache license information.

  • Property svn:executable set to *
Line 
1# Copyright 2009 Virginia Polytechnic Institute and State University 
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16# Simple Python demonstration script for using
17# the CROSS system.
18#
19# Use with demo.xml shell configuration file
20#   Instructions:
21#       Start shell with demo.xml config from the examples directory
22#       Start cognitive engine
23#       Run this script
24#       
25
26from cross import *
27
28p = Parameter(2)
29currentParameters = Parameter(2)
30o = Observable(2)
31
32o[0].value = 150.00
33o[0].name = "throughput"
34
35o[1].name = "PER"
36o[1].value = 12.00
37
38currentParameters[0].name = "bandwidth"
39currentParameters[0].value = 300.0
40
41currentParameters[1].name = "bandwidth"
42currentParameters[1].value = 10.0
43
44p = GetOptimalParameters(o,2,currentParameters,2);
45
46for i in range(2):
47    print p[i].name, p[i].value
48
49
Note: See TracBrowser for help on using the browser.