root/vtcross/trunk/src/libvtcross/libvtcross_demo.cpp @ 228

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

Added sending current parameters in the libvt request optimization function.

Added guts to the CBR so it actually creates an sql db and searches it.

Line 
1/* Virginia Tech Cognitive Radio Open Source Systems
2 * Virginia Tech, 2009
3 *
4 * TODO LICENSE INFORMATION GOES HERE
5 */
6
7/* TODO DESCRIPTION OF FILE.
8 *
9 * This file is a temporary demo of a policy engine using some of our socket
10 * communication functions. This is *not* an actual implementation of our
11 * defined PolicyEngine class.
12 */
13
14
15#include <cstdlib>
16#include <cstring>
17#include <stdint.h>
18
19#include "vtcross/libvtcross.h"
20#include "vtcross/socketcomm.h"
21
22int32_t
23main(int32_t argc, char *argv[])
24{
25    Observable *o = new Observable[1];
26    Parameter *currentParameters = new Parameter[2];
27    Parameter * p;
28
29        uint32_t numParameters;
30
31    o[0].name = "PER";
32        o[0].value = 12.00;
33
34    currentParameters[0].name = "tx_power";
35    currentParameters[0].value = 10.0;
36    currentParameters[1].name = "bandwidth";
37    currentParameters[1].value = 300.0;
38
39    p = GetOptimalParameters(o,1,currentParameters,2);
40    numParameters = GetNumParameters();
41
42        printf("Application:: Received the following parameters.\n");
43       
44        for(size_t i = 0; i < numParameters; i++) {
45                printf("%s:: %f\n",p[i].name.c_str(),p[i].value);
46        }
47
48        // Try them out! Do they work?
49   
50    Utility *resultingUtility = new Utility[2];
51       
52        // UpdateParameterPerformance(p,o,resultingUtility);   
53       
54       
55        delete [] p;
56    delete [] o;
57
58        return 0;
59}
60
Note: See TracBrowser for help on using the browser.