Changeset 90

Show
Ignore:
Timestamp:
11/27/08 21:33:15 (16 years ago)
Author:
ahe
Message:

fixed the bug, experience transmission works

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/branches/trnewman/CR_shell/src/main_cognitive_radio.cpp

    r87 r90  
    244244        message.append("\0");    
    245245        // Write message back to client 
    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; 
     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; 
    254254} 
    255255 
     
    349349        for (j = 0; j< num_cols; j++){ 
    350350                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); 
    353353        } 
    354354    } 
     
    367367        } 
    368368    } 
     369 
     370    printf("experience sent\n"); 
    369371} 
    370372 
     
    449451    num_cols = num_cols + ce_info->numObservables; 
    450452    num_cols = num_cols + 1;    // overall utility 
    451     int num_rows = 1; 
     453    int num_rows = 2; 
    452454    past_exp = (float **)malloc(sizeof(float)*num_rows); 
    453455    int i; 
     
    460462    past_exp[0][2] = -3.5;  // log10_ber 
    461463    past_exp[0][3] = 1;     // mod_scheme 
    462     past_exp[0][4] = -3.5;  // tx_power 
     464    past_exp[0][4] = -10;   // tx_power 
    463465    past_exp[0][5] = 10.0;  // SNR 
    464     past_exp[0][6] = 0.762; // overall utility 
    465     /*// sample experience #2 
     466    past_exp[0][6] = 0.762; // overall utility*/ 
     467    // sample experience #2 
    466468    past_exp[1][0] = 1e2f;  // throughput 
    467469    past_exp[1][1] = 1;     // spectral_efficiency 
    468470    past_exp[1][2] = -3.5;  // log10_ber 
    469471    past_exp[1][3] = 1;     // mod_scheme 
    470     past_exp[1][4] = -3.5;  // tx_power 
    471     past_exp[1][5] = 3.0;  // SNR 
    472     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 
    473475 
    474476