add 1 std dev -- seems to help:
authorChristian Grothoff <christian@grothoff.org>
Fri, 15 Jul 2011 08:14:21 +0000 (08:14 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 15 Jul 2011 08:14:21 +0000 (08:14 +0000)
src/fragmentation/defragmentation.c

index 34db0db3a499b23a6af2dc7f60ea3ee802359dac..29d2c3c424d49ac58a4de7fc99ac51aa59a691b0 100644 (file)
@@ -362,7 +362,10 @@ estimate_latency (struct MessageContext *mc)
       y[i] = (double) (first[i].time.abs_value - first[0].time.abs_value);
     }
   gsl_fit_mul (x, 1, y, 1, total,  &c1, &cov11, &sumsq);
+  c1 += sqrt (sumsq); /* add 1 std dev */
   ret.rel_value = (uint64_t) c1;
+  if (ret.rel_value == 0)
+    ret = GNUNET_TIME_UNIT_MILLISECONDS; /* always at least 1 */
   return ret;
 };