Show
Ignore:
Timestamp:
07/29/09 16:23:27 (15 years ago)
Author:
trnewman
Message:

Thresholds changing

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/cognitive_engines/DSA_CE/DSA_CognitiveEngine.cpp

    r391 r392  
    167167    //  energy and the average communication time. 
    168168 
    169      
    170  
    171     float newUtilityValue = oldUtilityValue + ( -observables[ENERGY].value + observables[COMMUNICATION_TIME].value); 
     169    float newUtilityValue = oldUtilityValue + observables[COMMUNICATION_TIME].value; 
    172170 
    173171    // If communication time value is set, we know we need to change channels because of PU. 
    174172    // So we should lower the utility for this channel. 
    175173 
    176     if(observables[COMMUNICATION_TIME].value != 0) {  
     174    if((observables[COMMUNICATION_TIME].value != 0) || (observables[ENERGY].value > 1000)) {  
    177175        newUtilityValue = newUtilityValue - 100; 
    178176    } else { 
     
    181179 
    182180 
    183     if(newUtilityValue <= 0) 
    184         newUtilityValue = 0; 
     181    if(newUtilityValue <= 100) 
     182        newUtilityValue = 100; 
    185183 
    186184    obsVals[obsValueIndex] = newUtilityValue;