Revision 412, 1.3 KB
(checked in by trnewman, 15 years ago)
|
Adding Apache license information.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[412] | 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 | |
---|
[302] | 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 | |
---|
[299] | 26 | from cross import * |
---|
| 27 | |
---|
| 28 | p = Parameter(2) |
---|
| 29 | currentParameters = Parameter(2) |
---|
| 30 | o = Observable(2) |
---|
| 31 | |
---|
| 32 | o[0].value = 150.00 |
---|
| 33 | o[0].name = "throughput" |
---|
| 34 | |
---|
| 35 | o[1].name = "PER" |
---|
| 36 | o[1].value = 12.00 |
---|
| 37 | |
---|
| 38 | currentParameters[0].name = "bandwidth" |
---|
| 39 | currentParameters[0].value = 300.0 |
---|
| 40 | |
---|
| 41 | currentParameters[1].name = "bandwidth" |
---|
| 42 | currentParameters[1].value = 10.0 |
---|
| 43 | |
---|
| 44 | p = GetOptimalParameters(o,2,currentParameters,2); |
---|
[301] | 45 | |
---|
| 46 | for i in range(2): |
---|
| 47 | print p[i].name, p[i].value |
---|
| 48 | |
---|
| 49 | |
---|