Changeset 457

Show
Ignore:
Timestamp:
09/02/09 18:33:48 (15 years ago)
Author:
cdietric
Message:

updates for CROSS-OSSIE demo

Location:
vtcross/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/configure.ac

    r453 r457  
    2727 
    2828AC_DISABLE_STATIC 
    29 AM_PATH_PYTHON(2.6) 
     29AM_PATH_PYTHON(2.5) 
    3030SWIG_ENABLE_CXX 
    3131SWIG_PYTHON 
  • vtcross/trunk/src/cognitive_engines/OSSIE_DEMO_CE/OSSIE_CE.cpp

    r418 r457  
    2929 
    3030#define TXPOWER 1 
     31#define DECREMENTSCALE 5 
     32#define INCREMENTSCALE 5 
    3133 
    3234static cbr myCBR; 
     
    675677    } 
    676678 
     679    cbr_print(myCBR); 
     680 
    677681    /* CBR specific call */ 
    678682    uint32_t rc = cbr_search(myCBR, searchNames, searchOps, searchVals, 
     
    684688 
    685689        /* 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]; 
    690694        } 
    691695    } else if(rc == 31337) { 
     
    693697        /* No rows in the CBR, pick default parameters */ 
    694698        /* Currently this is hard coded and implementation specific! */ 
    695         returnValues[2] = currentParameters[0].value + 5; 
     699        returnValues[1] = currentParameters[0].value + .25; 
    696700         
    697701    } else { 
  • vtcross/trunk/src/cognitive_engines/OSSIE_DEMO_CE/cbr.c

    r449 r457  
    5757    char *zErrMsg = 0; 
    5858 
    59     //printf("command: %s\n", _cbr->command); 
     59    printf("command: %s\n", _cbr->command); 
    6060    rc = sqlite3_exec(_cbr->db, _cbr->command, callback, 0, &zErrMsg); 
    6161    if( rc!=SQLITE_OK){ 
     
    6363        sqlite3_free(zErrMsg); 
    6464    } else{ 
    65         //printf("command executed.\n"); 
     65        printf("command executed.\n"); 
    6666    } 
    6767    return rc; 
     
    129129            strcat(_cbr->command, ", "); 
    130130    } 
    131     strcat(_cbr->command, ", timestamp DATE);"); 
     131    strcat(_cbr->command, ", timestamp DATE, PRIMARY KEY(biterrorrate,tx_power));"); 
    132132 
    133133    // execute create table command 
     
    202202    unsigned int i; 
    203203    char str_buffer[64]; 
    204     printf("number of ops %d:\n", _n); 
     204    //printf("number of ops %d:\n", _n); 
    205205    for (i=0; i<_n; i++) { 
    206206        // ensure valid ops value 
     
    212212        strcat(_cbr->command, _names[i]); 
    213213        strcat(_cbr->command, ops_str[_ops[i]]); 
    214     printf("search command: %s\n", _cbr->command); 
    215214        sprintf(str_buffer, "%E", _vals[i]); 
    216215        strcat(_cbr->command, str_buffer); 
     
    220219            strcat(_cbr->command, " AND "); 
    221220        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); 
    226225 
    227226    //ExecuteCommand(_cbr); 
    228227    rc = ExecuteSearchCommand(_cbr, _retvals); 
    229228     
    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++) 
    232231        printf("%f, ",_retvals[i]); 
    233     printf("\n");*/ 
     232    printf("\n"); 
    234233 
    235234    return rc; 
     
    258257    } 
    259258    
    260     strcat(_cbr->command, "timestamp = DATETIME('NOW')"); 
     259    strcat(_cbr->command, ", timestamp = DATETIME('NOW')"); 
    261260     
    262261    strcat(_cbr->command, " WHERE "); 
     
    272271    strcat(_cbr->command, ";"); 
    273272     
    274     //printf("search command: %s\n", _cbr->command); 
     273    //printf("update command: %s\n", _cbr->command); 
    275274    // execute add command 
    276275    ExecuteCommand(_cbr); 
     
    286285    // generate command 
    287286    //printf("%s\n", _cbr->command); 
    288     strcpy(_cbr->command, "insert into "); 
     287    strcpy(_cbr->command, "replace into "); 
    289288    strcat(_cbr->command, _cbr->tablename); 
    290289     
  • vtcross/trunk/src/shell/configs/ossie_demo.xml

    r416 r457  
    88    <!-- utilities : QoS metrics --> 
    99    <utilities> 
    10         <utility name="bit-error-rate" units="" goal="min" target=".005" />  
     10        <utility name="biterrorrate" units="" goal="min" target=".025" />  
    1111    </utilities> 
    1212 
     
    1414    <parameters> 
    1515        <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"/> 
    1717        </parameter> 
    1818    </parameters> 
     
    2121    <observables> 
    2222        <observable name="ber"> 
    23             <affect utility="bit-error-rate" relationship="improve" /> 
     23            <affect utility="biterrorrate" relationship="improve" /> 
    2424        </observable> 
    2525    </observables>