summaryrefslogtreecommitdiff
path: root/src/rps/rps-sampler_client.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-11-18 19:19:10 +0100
committerChristian Grothoff <christian@grothoff.org>2020-11-18 19:19:10 +0100
commit8ea5327297c6dc43c9bea725ca10cd379533ae2c (patch)
treec71b7753076b8cf7323e7daca2932ef8a1244715 /src/rps/rps-sampler_client.c
parent75f764ad21fd850bd068f5746b8db89d49e784d1 (diff)
parent52968789d280ee066e4527d6b191691625bd993a (diff)
Merge branch 'master' of git+ssh://gnunet.org/gnunet
Diffstat (limited to 'src/rps/rps-sampler_client.c')
-rw-r--r--src/rps/rps-sampler_client.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/src/rps/rps-sampler_client.c b/src/rps/rps-sampler_client.c
index 5ab854e01..f6e98ce29 100644
--- a/src/rps/rps-sampler_client.c
+++ b/src/rps/rps-sampler_client.c
@@ -258,39 +258,39 @@ RPS_sampler_mod_init (size_t init_size,
}
-/**
- * @brief Compute the probability that we already observed all peers from a
- * biased stream of peer ids.
- *
- * Deficiency factor:
- * As introduced by Brahms: Factor between the number of unique ids in a
- * truly random stream and number of unique ids in the gossip stream.
- *
- * @param num_peers_estim The estimated number of peers in the network
- * @param num_peers_observed The number of peers the given element has observed
- * @param deficiency_factor A factor that catches the 'bias' of a random stream
- * of peer ids
- *
- * @return The estimated probability
- */
-static double
-prob_observed_n_peers (uint32_t num_peers_estim,
- uint32_t num_peers_observed,
- double deficiency_factor)
-{
- uint32_t num_peers = num_peers_estim * (1 / deficiency_factor);
- uint64_t sum = 0;
-
- for (uint32_t i = 0; i < num_peers; i++)
- {
- uint64_t a = pow (-1, num_peers - i);
- uint64_t b = binom (num_peers, i);
- uint64_t c = pow (i, num_peers_observed);
- sum += a * b * c;
- }
-
- return sum / (double) pow (num_peers, num_peers_observed);
-}
+// /**
+// * @brief Compute the probability that we already observed all peers from a
+// * biased stream of peer ids.
+// *
+// * Deficiency factor:
+// * As introduced by Brahms: Factor between the number of unique ids in a
+// * truly random stream and number of unique ids in the gossip stream.
+// *
+// * @param num_peers_estim The estimated number of peers in the network
+// * @param num_peers_observed The number of peers the given element has observed
+// * @param deficiency_factor A factor that catches the 'bias' of a random stream
+// * of peer ids
+// *
+// * @return The estimated probability
+// */
+// static double
+// prob_observed_n_peers (uint32_t num_peers_estim,
+// uint32_t num_peers_observed,
+// double deficiency_factor)
+// {
+// uint32_t num_peers = num_peers_estim * (1 / deficiency_factor);
+// uint64_t sum = 0;
+//
+// for (uint32_t i = 0; i < num_peers; i++)
+// {
+// uint64_t a = pow (-1, num_peers - i);
+// uint64_t b = binom (num_peers, i);
+// uint64_t c = pow (i, num_peers_observed);
+// sum += a * b * c;
+// }
+//
+// return sum / (double) pow (num_peers, num_peers_observed);
+// }
/**
@@ -379,7 +379,8 @@ sampler_mod_get_rand_peer (void *cls)
return;
}
/* compute probability */
- /* Currently disabled due to numerical limitations */
+ /* FIXME: Currently disabled due to numerical limitations */
+ prob_observed_n = 0; // Inititialise to some value
// prob_observed_n = prob_observed_n_peers (sampler->num_peers_estim,
// s_elem->num_peers,
// sampler->deficiency_factor);