/* Virginia Tech Cognitive Radio Open Source Systems * Virginia Tech, 2009 * * TODO LICENSE INFORMATION GOES HERE */ /* TODO DESCRIPTION OF FILE. * * This file is a temporary demo of a policy engine using some of our socket * communication functions. This is *not* an actual implementation of our * defined PolicyEngine class. */ #include #include #include #include "vtcross/libvtcross.h" #include "vtcross/socketcomm.h" int32_t main(int32_t argc, char *argv[]) { Observable *o = new Observable[1]; Parameter *currentParameters = new Parameter[2]; Parameter * p; uint32_t numParameters; o[0].name = "PER"; o[0].value = 12.00; currentParameters[0].name = "tx_power"; currentParameters[0].value = 10.0; currentParameters[1].name = "bandwidth"; currentParameters[1].value = 300.0; p = GetOptimalParameters(o,1,currentParameters,2); numParameters = GetNumParameters(); printf("Application:: Received the following parameters.\n"); for(size_t i = 0; i < numParameters; i++) { printf("%s:: %f\n",p[i].name.c_str(),p[i].value); } // Try them out! Do they work? Utility *resultingUtility = new Utility[2]; // UpdateParameterPerformance(p,o,resultingUtility); delete [] p; delete [] o; return 0; }