[Sumover-dev] [svn commit] r4633 - vic/branches/cc/cc

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Mon Feb 22 17:56:19 GMT 2010


Author: soohyunc
Date: Mon Feb 22 17:56:19 2010
New Revision: 4633

Modified:
   vic/branches/cc/cc/tfwc_sndr.cpp
   vic/branches/cc/cc/tfwc_sndr.h

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



Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp	(original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp	Mon Feb 22 17:56:19 2010
@@ -192,7 +192,7 @@
 		aoa_ = ackofack(); 
 
 		// update RTT with the sampled RTT
-		tao_ = now() - tsvec_[seqno_%TSZ];
+		tao_ = now() - tsvec_[ends_%TSZ];
 		update_rtt(tao_);
 
 		// initialize variables for the next pkt reception
@@ -512,20 +512,21 @@
 	I_tot0_ = 0;
 	I_tot1_ = 0;
 	tot_weight_ = 0;
+	int i = 0, j = 0;
 
 	// make a decision whether to include the most recent loss interval
 	fprintf(stderr, "\n\tHIST_0 [");
-	for (int i = 0; i < hsz_; i++) {
+	for (i = 0; i < hsz_; i++) {
 		I_tot0_ += weight_[i] * history_[i];
 		tot_weight_ += weight_[i];
 		print_history_item(i);
 	}
 	fprintf(stderr, "]\n");
 	fprintf(stderr, "\tHIST_1 [");
-	for (int i = 1; i < hsz_ + 1; i++) {
+	for (i = 1, j = 0; i < hsz_ + 1; i++, j++) {
 		I_tot1_ += weight_[i-1] * history_[i];
 		//tot_weight_ += weight_[i];
-		print_history_item(i);
+		print_history_item(i, j);
 	}
 	fprintf(stderr, "]\n");
 
@@ -547,3 +548,8 @@
 	fprintf(stderr, "%d", history_[i]);
 	if (i < hsz_ - 1) fprintf(stderr, ", ");
 }
+
+void TfwcSndr::print_history_item (int i, int j) {
+	fprintf(stderr, "%d", history_[i]);
+	if (j < hsz_ - 1) fprintf(stderr, ", ");
+}

Modified: vic/branches/cc/cc/tfwc_sndr.h
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.h	(original)
+++ vic/branches/cc/cc/tfwc_sndr.h	Mon Feb 22 17:56:19 2010
@@ -171,6 +171,7 @@
 	// calcuate average loss interval
 	void avg_loss_interval();
 	void print_history_item (int);
+	void print_history_item (int, int);
 
 	// calculate loss history
 	void loss_history();



More information about the Sumover-dev mailing list