[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: futures
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: futures |
Date: |
Mon, 05 Mar 2018 08:56:03 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 66e6d0281 futures
66e6d0281 is described below
commit 66e6d0281c2247e9324be24a34802e09e79a6b0e
Author: ng0 <address@hidden>
AuthorDate: Mon Mar 5 07:56:12 2018 +0000
futures
---
src/consensus/consensus-simulation.py | 7 ++++++-
src/dht/test_dht_tools.py.in | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/consensus/consensus-simulation.py
b/src/consensus/consensus-simulation.py
index 19b636cbd..542fe0dac 100644
--- a/src/consensus/consensus-simulation.py
+++ b/src/consensus/consensus-simulation.py
@@ -17,10 +17,13 @@
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
+from __future__ import absolute_import
+from __future__ import print_function
import argparse
import random
from math import ceil,log,floor
+
def bsc(n):
""" count the bits set in n"""
l = n.bit_length()
@@ -32,6 +35,7 @@ def bsc(n):
x = x << 1
return c
+
def simulate(k, n, verbose):
assert k < n
largest_arc = int(2**ceil(log(n, 2))) / 2
@@ -87,6 +91,7 @@ def simulate(k, n, verbose):
random.shuffle(peers)
return rounds
+
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("k", metavar="k", type=int, help="#(bad peers)")
@@ -98,6 +103,6 @@ if __name__ == "__main__":
sum = 0.0;
for n in xrange (0, args.r):
sum += simulate(args.k, args.n, args.verbose)
- print sum / args.r;
+ printsum / args.r;
diff --git a/src/dht/test_dht_tools.py.in b/src/dht/test_dht_tools.py.in
index f5dd14f67..2d4ab9adc 100644
--- a/src/dht/test_dht_tools.py.in
+++ b/src/dht/test_dht_tools.py.in
@@ -12,6 +12,7 @@
# The code does NOT depend on DHT routing or any actual P2P functionality.
#
from __future__ import print_function
+from __future__ import absolute_import
import os
import sys
import shutil
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: futures,
gnunet <=