Changeset 392

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

Thresholds changing

Location:
vtcross/trunk/src/cognitive_engines/DSA_CE
Files:
2 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; 
  • vtcross/trunk/src/cognitive_engines/DSA_CE/examples/gnuradio-examples/dsa.py

    r391 r392  
    9797                o[0].value = probe_level 
    9898                o[0].name = "energy" 
    99                  
     99         
     100                print probe_level 
     101         
    100102                o[1].value = absent_time  
    101103                o[1].name = "communication_time"