Changeset 4633

Show
Ignore:
Timestamp:
02/22/10 17:56:19 (4 years ago)
Author:
soohyunc
Message:

printing HISTORY method had an item off by one, especially HIST1.

Location:
vic/branches/cc/cc
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/cc/cc/tfwc_sndr.cpp

    r4628 r4633  
    193193 
    194194                // update RTT with the sampled RTT 
    195                 tao_ = now() - tsvec_[seqno_%TSZ]; 
     195                tao_ = now() - tsvec_[ends_%TSZ]; 
    196196                update_rtt(tao_); 
    197197 
     
    513513        I_tot1_ = 0; 
    514514        tot_weight_ = 0; 
     515        int i = 0, j = 0; 
    515516 
    516517        // make a decision whether to include the most recent loss interval 
    517518        fprintf(stderr, "\n\tHIST_0 ["); 
    518         for (int i = 0; i < hsz_; i++) { 
     519        for (i = 0; i < hsz_; i++) { 
    519520                I_tot0_ += weight_[i] * history_[i]; 
    520521                tot_weight_ += weight_[i]; 
     
    523524        fprintf(stderr, "]\n"); 
    524525        fprintf(stderr, "\tHIST_1 ["); 
    525         for (int i = 1; i < hsz_ + 1; i++) { 
     526        for (i = 1, j = 0; i < hsz_ + 1; i++, j++) { 
    526527                I_tot1_ += weight_[i-1] * history_[i]; 
    527528                //tot_weight_ += weight_[i]; 
    528                 print_history_item(i); 
     529                print_history_item(i, j); 
    529530        } 
    530531        fprintf(stderr, "]\n"); 
     
    548549        if (i < hsz_ - 1) fprintf(stderr, ", "); 
    549550} 
     551 
     552void TfwcSndr::print_history_item (int i, int j) { 
     553        fprintf(stderr, "%d", history_[i]); 
     554        if (j < hsz_ - 1) fprintf(stderr, ", "); 
     555} 
  • vic/branches/cc/cc/tfwc_sndr.h

    r4628 r4633  
    172172        void avg_loss_interval(); 
    173173        void print_history_item (int); 
     174        void print_history_item (int, int); 
    174175 
    175176        // calculate loss history