Changeset 90
- Timestamp:
- 11/27/08 21:33:15 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/branches/trnewman/CR_shell/src/main_cognitive_radio.cpp
r87 r90 244 244 message.append("\0"); 245 245 // Write message back to client 246 247 248 249 250 251 252 printf("SendMessage:%s %d\n",message.c_str(),n);253 246 n = write(socketfd,message.c_str(),(message.size()+1)); 247 if (n<0) 248 error("Error sending to client\n"); 249 if(n == 0) 250 printf("Client closed the socket.\n"); 251 252 //printf("SendMessage:%s %d\n",message.c_str(),n); 253 return n; 254 254 } 255 255 … … 349 349 for (j = 0; j< num_cols; j++){ 350 350 sprintf(var,"%f",past_exp[i][j]); 351 printf("%f, \n", past_exp[i][j]);352 printf("%s, \n", var);351 //printf("%f, \n", past_exp[i][j]); 352 //printf("%s, \n", var); 353 353 } 354 354 } … … 367 367 } 368 368 } 369 370 printf("experience sent\n"); 369 371 } 370 372 … … 449 451 num_cols = num_cols + ce_info->numObservables; 450 452 num_cols = num_cols + 1; // overall utility 451 int num_rows = 1;453 int num_rows = 2; 452 454 past_exp = (float **)malloc(sizeof(float)*num_rows); 453 455 int i; … … 460 462 past_exp[0][2] = -3.5; // log10_ber 461 463 past_exp[0][3] = 1; // mod_scheme 462 past_exp[0][4] = - 3.5;// tx_power464 past_exp[0][4] = -10; // tx_power 463 465 past_exp[0][5] = 10.0; // SNR 464 past_exp[0][6] = 0.762; // overall utility 465 / *// sample experience #2466 past_exp[0][6] = 0.762; // overall utility*/ 467 // sample experience #2 466 468 past_exp[1][0] = 1e2f; // throughput 467 469 past_exp[1][1] = 1; // spectral_efficiency 468 470 past_exp[1][2] = -3.5; // log10_ber 469 471 past_exp[1][3] = 1; // mod_scheme 470 past_exp[1][4] = - 3.5;// tx_power471 past_exp[1][5] = 3.0; // SNR472 past_exp[1][6] = 0.462; // overall utility */472 past_exp[1][4] = -14; // tx_power 473 past_exp[1][5] = 3.0; // SNR 474 past_exp[1][6] = 0.462; // overall utility 473 475 474 476