Changeset 392 for vtcross/trunk
- Timestamp:
- 07/29/09 16:23:27 (15 years ago)
- 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 167 167 // energy and the average communication time. 168 168 169 170 171 float newUtilityValue = oldUtilityValue + ( -observables[ENERGY].value + observables[COMMUNICATION_TIME].value); 169 float newUtilityValue = oldUtilityValue + observables[COMMUNICATION_TIME].value; 172 170 173 171 // If communication time value is set, we know we need to change channels because of PU. 174 172 // So we should lower the utility for this channel. 175 173 176 if( observables[COMMUNICATION_TIME].value != 0) {174 if((observables[COMMUNICATION_TIME].value != 0) || (observables[ENERGY].value > 1000)) { 177 175 newUtilityValue = newUtilityValue - 100; 178 176 } else { … … 181 179 182 180 183 if(newUtilityValue <= 0)184 newUtilityValue = 0;181 if(newUtilityValue <= 100) 182 newUtilityValue = 100; 185 183 186 184 obsVals[obsValueIndex] = newUtilityValue; -
vtcross/trunk/src/cognitive_engines/DSA_CE/examples/gnuradio-examples/dsa.py
r391 r392 97 97 o[0].value = probe_level 98 98 o[0].name = "energy" 99 99 100 print probe_level 101 100 102 o[1].value = absent_time 101 103 o[1].name = "communication_time"