diff options
author | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-02-04 16:06:16 +0000 |
---|---|---|
committer | grothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96> | 2013-02-04 16:06:16 +0000 |
commit | 2d7cc4bfafe0f86eaf4823ae6844e1391deda0c5 (patch) | |
tree | 9436ac32cf5c7469731cb81673934aef7e02d474 | |
parent | d0cdda755f1983b3567398f0f1a5c430bb3752f5 (diff) |
-trying to fix low parallelism bias
git-svn-id: https://gnunet.org/svn/gnunet@26006 140774ce-b5e7-0310-ab8b-a85725594a96
-rw-r--r-- | src/testbed/testbed_api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 1108ff15af..bf9f18a380 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c @@ -2635,9 +2635,12 @@ decide_npoc (struct GNUNET_TESTBED_Controller *c) avg = GNUNET_TIME_relative_divide (avg, nvals); GNUNET_assert (GNUNET_TIME_UNIT_FOREVER_REL.rel_value != avg.rel_value); sd = SD_deviation_factor (c->poc_sd, (unsigned int) avg.rel_value); + if ( (sd <= 5) || + (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, + c->num_parallel_connects)) ) + SD_add_data (c->poc_sd, (unsigned int) avg.rel_value); if (GNUNET_SYSERR == sd) { - SD_add_data (c->poc_sd, (unsigned int) avg.rel_value); GNUNET_TESTBED_set_num_parallel_overlay_connects_ (c, c->num_parallel_connects); return; @@ -2645,7 +2648,6 @@ decide_npoc (struct GNUNET_TESTBED_Controller *c) GNUNET_assert (0 <= sd); if (0 == sd) { - SD_add_data (c->poc_sd, (unsigned int) avg.rel_value); GNUNET_TESTBED_set_num_parallel_overlay_connects_ (c, c->num_parallel_connects * 2); @@ -2653,7 +2655,6 @@ decide_npoc (struct GNUNET_TESTBED_Controller *c) } if (1 == sd) { - SD_add_data (c->poc_sd, (unsigned int) avg.rel_value); GNUNET_TESTBED_set_num_parallel_overlay_connects_ (c, c->num_parallel_connects + 1); @@ -2666,7 +2667,6 @@ decide_npoc (struct GNUNET_TESTBED_Controller *c) } if (2 == sd) { - SD_add_data (c->poc_sd, (unsigned int) avg.rel_value); GNUNET_TESTBED_set_num_parallel_overlay_connects_ (c, c->num_parallel_connects - 1); |