Changeset 86 for vtcross/branches/trnewman/CR_shell
- Timestamp:
- 11/25/08 14:31:00 (16 years ago)
- Location:
- vtcross/branches/trnewman/CR_shell
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/branches/trnewman/CR_shell/example.ce.xml
r85 r86 8 8 <!-- utilities : QoS metrics --> 9 9 <utilities> 10 <utility name="throughput" units="kbps" goal="max" target="125000" /> 10 <utility name="throughput" units="kbps" goal="max" target="125000" /> 11 11 <utility name="spectral_efficiency" units="b/s/Hz" goal="max" /> 12 < utility name="log10_ber" units="none" goal="min" target="-3" />12 <!-- <utility name="log10_ber" units="none" goal="min" target="-3" /> --> 13 13 <!-- <utility name="latency" units="ms" goal="min" target=100 /> --> 14 14 </utilities> -
vtcross/branches/trnewman/CR_shell/src/main_cognitive_radio.cpp
r85 r86 90 90 int j = 0; 91 91 int k = 0; 92 int match_found = 0; 92 93 93 94 pElem = hDoc.FirstChildElement().Element(); … … 137 138 if(oUtilName) { 138 139 // Search for correct utility 139 for( k=0;k<10;k++){140 for( k=0 ; u[k]!=NULL ; k++ ){ 140 141 if(u[k]->name == oUtilName) { 141 142 o[i]->affection_list[j].u = u[k]; 143 // Set relationship 144 const char *oRelate = pSecondChild->Attribute("relationship"); 145 if(oRelate) o[i]->affection_list[j].relation = oRelate; 146 j++; 147 match_found = 1; 142 148 break; 143 149 } 144 150 } 145 151 } 146 147 // Set relationship 148 const char *oRelate = pSecondChild->Attribute("relationship"); 149 if(oRelate) o[i]->affection_list[j].relation = oRelate; 150 j++; 152 if(!match_found) cout << "Error: " << o[i]->name << ": " << oUtilName << " not a valid utility: Affect not added." << endl; 153 match_found = 0; 151 154 } 152 155 o[i]->numAffects = j; … … 185 188 for( k=0 ; u[k]!=NULL ; k++ ){ 186 189 if(u[k]->name == pUtilName) { 190 // If match found, assign it to this index 187 191 p[i]->affection_list[j].u = u[k]; 192 const char *pRelate = pSecondChild->Attribute("relationship"); 193 if(pRelate) { 194 p[i]->affection_list[j].relation = pRelate; 195 } else { 196 cout << "Error: No relation found." << endl; 197 } 198 match_found = 1; 199 j++; 188 200 break; 189 201 } 190 202 } 191 203 } 192 193 // Set relationship 194 const char *pRelate = pSecondChild->Attribute("relationship"); 195 if(pRelate) { 196 p[i]->affection_list[j].relation = pRelate; 197 } else { 198 cout << "Error: No relation found." << endl; 199 } 200 j++; 201 204 if(!match_found) cout << "Error: " << p[i]->name << ": " << pUtilName << " not a valid utility: Affect not added." << endl; 205 match_found = 0; 202 206 } 203 207 p[i]->numAffects = j;