Changeset 457
- Timestamp:
- 09/02/09 18:33:48 (15 years ago)
- Location:
- vtcross/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/configure.ac
r453 r457 27 27 28 28 AC_DISABLE_STATIC 29 AM_PATH_PYTHON(2. 6)29 AM_PATH_PYTHON(2.5) 30 30 SWIG_ENABLE_CXX 31 31 SWIG_PYTHON -
vtcross/trunk/src/cognitive_engines/OSSIE_DEMO_CE/OSSIE_CE.cpp
r418 r457 29 29 30 30 #define TXPOWER 1 31 #define DECREMENTSCALE 5 32 #define INCREMENTSCALE 5 31 33 32 34 static cbr myCBR; … … 675 677 } 676 678 679 cbr_print(myCBR); 680 677 681 /* CBR specific call */ 678 682 uint32_t rc = cbr_search(myCBR, searchNames, searchOps, searchVals, … … 684 688 685 689 /* Should do a random adaptation.. */ 686 if(returnValues[numberColumns-1] < 0) {687 returnValues[ 2] = returnValues[2] - 15;688 } else {689 returnValues[ 2] = returnValues[2] + 15;690 if(returnValues[numberColumns-1] > (uList[0].target * 0.2)) { 691 returnValues[1] = returnValues[1] - DECREMENTSCALE*returnValues[numberColumns-1]; 692 } else if(returnValues[numberColumns-1] < -(uList[0].target * 0.2)) { 693 returnValues[1] = returnValues[1] + INCREMENTSCALE*returnValues[numberColumns-1]; 690 694 } 691 695 } else if(rc == 31337) { … … 693 697 /* No rows in the CBR, pick default parameters */ 694 698 /* Currently this is hard coded and implementation specific! */ 695 returnValues[ 2] = currentParameters[0].value +5;699 returnValues[1] = currentParameters[0].value + .25; 696 700 697 701 } else { -
vtcross/trunk/src/cognitive_engines/OSSIE_DEMO_CE/cbr.c
r449 r457 57 57 char *zErrMsg = 0; 58 58 59 //printf("command: %s\n", _cbr->command);59 printf("command: %s\n", _cbr->command); 60 60 rc = sqlite3_exec(_cbr->db, _cbr->command, callback, 0, &zErrMsg); 61 61 if( rc!=SQLITE_OK){ … … 63 63 sqlite3_free(zErrMsg); 64 64 } else{ 65 //printf("command executed.\n");65 printf("command executed.\n"); 66 66 } 67 67 return rc; … … 129 129 strcat(_cbr->command, ", "); 130 130 } 131 strcat(_cbr->command, ", timestamp DATE );");131 strcat(_cbr->command, ", timestamp DATE, PRIMARY KEY(biterrorrate,tx_power));"); 132 132 133 133 // execute create table command … … 202 202 unsigned int i; 203 203 char str_buffer[64]; 204 printf("number of ops %d:\n", _n);204 //printf("number of ops %d:\n", _n); 205 205 for (i=0; i<_n; i++) { 206 206 // ensure valid ops value … … 212 212 strcat(_cbr->command, _names[i]); 213 213 strcat(_cbr->command, ops_str[_ops[i]]); 214 printf("search command: %s\n", _cbr->command);215 214 sprintf(str_buffer, "%E", _vals[i]); 216 215 strcat(_cbr->command, str_buffer); … … 220 219 strcat(_cbr->command, " AND "); 221 220 else 222 strcat(_cbr->command, " order by utility, timestamp desc );");223 } 224 225 //printf("search command: %s\n", _cbr->command);221 strcat(_cbr->command, " order by abs(utility) asc, timestamp desc;"); 222 } 223 224 printf("search command: %s\n", _cbr->command); 226 225 227 226 //ExecuteCommand(_cbr); 228 227 rc = ExecuteSearchCommand(_cbr, _retvals); 229 228 230 /*printf("search result: ");231 for (i=0; i<_cbr->num_columns ; i++)229 printf("search result: "); 230 for (i=0; i<_cbr->num_columns +1; i++) 232 231 printf("%f, ",_retvals[i]); 233 printf("\n"); */232 printf("\n"); 234 233 235 234 return rc; … … 258 257 } 259 258 260 strcat(_cbr->command, " timestamp = DATETIME('NOW')");259 strcat(_cbr->command, ", timestamp = DATETIME('NOW')"); 261 260 262 261 strcat(_cbr->command, " WHERE "); … … 272 271 strcat(_cbr->command, ";"); 273 272 274 //printf(" searchcommand: %s\n", _cbr->command);273 //printf("update command: %s\n", _cbr->command); 275 274 // execute add command 276 275 ExecuteCommand(_cbr); … … 286 285 // generate command 287 286 //printf("%s\n", _cbr->command); 288 strcpy(_cbr->command, " insertinto ");287 strcpy(_cbr->command, "replace into "); 289 288 strcat(_cbr->command, _cbr->tablename); 290 289 -
vtcross/trunk/src/shell/configs/ossie_demo.xml
r416 r457 8 8 <!-- utilities : QoS metrics --> 9 9 <utilities> 10 <utility name="bit -error-rate" units="" goal="min" target=".005" />10 <utility name="biterrorrate" units="" goal="min" target=".025" /> 11 11 </utilities> 12 12 … … 14 14 <parameters> 15 15 <parameter name="tx_power" units="dBm" min="1" max="255" step="1"> 16 <affect utility="bit -error-rate" relationship="improve"/>16 <affect utility="biterrorrate" relationship="improve"/> 17 17 </parameter> 18 18 </parameters> … … 21 21 <observables> 22 22 <observable name="ber"> 23 <affect utility="bit -error-rate" relationship="improve" />23 <affect utility="biterrorrate" relationship="improve" /> 24 24 </observable> 25 25 </observables>