gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (6e626937f -> be52c4058)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (6e626937f -> be52c4058)
Date: Wed, 10 Apr 2019 14:11:04 +0200

This is an automated email from the git hooks/post-receive script.

julius-buenger pushed a change to branch master
in repository gnunet.

    from 6e626937f Merge branch 'master' of gnunet.org:gnunet
     new 20714e46c RPS profiler: Normalise correctly
     new be52c4058 RPS sampler: Disable computation of probability

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/rps/gnunet-rps-profiler.c | 17 +++++------------
 src/rps/rps-sampler_client.c  | 41 ++++++++++++++++++++++++-----------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index a13ee4078..474a83768 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -2232,7 +2232,7 @@ static void compute_probabilities (uint32_t peer_idx)
   uint32_t cont_views;
   uint32_t number_of_being_in_pull_events;
   int tmp;
-  uint32_t count_non_zero_prob = 0;
+  uint32_t sum_non_zero_prob = 0;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
       "Computing probabilities for peer %" PRIu32 "\n", peer_idx);
@@ -2315,21 +2315,14 @@ static void compute_probabilities (uint32_t peer_idx)
                i,
                number_of_being_in_pull_events);
 
-    if (0 != probs[i]) count_non_zero_prob++;
+    sum_non_zero_prob += probs[i];
   }
   /* normalize */
-  if (0 != count_non_zero_prob)
+  for (i = 0; i < num_peers; i++)
   {
-    for (i = 0; i < num_peers; i++)
-    {
-      probs[i] = probs[i] * (1.0 / count_non_zero_prob);
-    }
-  } else {
-    for (i = 0; i < num_peers; i++)
-    {
-      probs[i] = 0;
-    }
+    probs[i] = probs[i] * (1.0 / sum_non_zero_prob);
   }
+
   /* str repr */
   for (i = 0; i < num_peers; i++)
   {
diff --git a/src/rps/rps-sampler_client.c b/src/rps/rps-sampler_client.c
index 20cd9d0c4..64ae2dedd 100644
--- a/src/rps/rps-sampler_client.c
+++ b/src/rps/rps-sampler_client.c
@@ -377,23 +377,30 @@ sampler_mod_get_rand_peer (void *cls)
     return;
   }
   /* compute probability */
-  prob_observed_n = prob_observed_n_peers (sampler->num_peers_estim,
-                                           s_elem->num_peers,
-                                           sampler->deficiency_factor);
-  /* check if probability is above desired */
-  if (prob_observed_n < sampler->desired_probability)
-  {
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-        "Probability of having observed all peers (%f) too small ( < %f).\n",
-        prob_observed_n,
-        sampler->desired_probability);
-    GNUNET_assert (NULL == gpc->notify_ctx);
-    gpc->notify_ctx =
-      sampler_notify_on_update (sampler,
-                                &sampler_mod_get_rand_peer,
-                                gpc);
-    return;
-  }
+  /* Currently disabled due to numerical limitations */
+  //prob_observed_n = prob_observed_n_peers (sampler->num_peers_estim,
+  //                                         s_elem->num_peers,
+  //                                         sampler->deficiency_factor);
+  //LOG (GNUNET_ERROR_TYPE_DEBUG,
+  //    "Computed sample - prob %f, %" PRIu32 " peers, n: %" PRIu32 ", roh: 
%f\n",
+  //    prob_observed_n,
+  //    s_elem->num_peers,
+  //    sampler->num_peers_estim,
+  //    sampler->deficiency_factor);
+  ///* check if probability is above desired */
+  //if (prob_observed_n < sampler->desired_probability)
+  //{
+  //  LOG (GNUNET_ERROR_TYPE_DEBUG,
+  //      "Probability of having observed all peers (%f) too small ( < %f).\n",
+  //      prob_observed_n,
+  //      sampler->desired_probability);
+  //  GNUNET_assert (NULL == gpc->notify_ctx);
+  //  gpc->notify_ctx =
+  //    sampler_notify_on_update (sampler,
+  //                              &sampler_mod_get_rand_peer,
+  //                              gpc);
+  //  return;
+  //}
   /* More reasons to wait could be added here */
 
 //  GNUNET_STATISTICS_set (stats,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]