git://git.onelab.eu
/
nepi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96ce555
)
small bug fix in src/nepi/util/netgraph.py
author
Alina Quereilhac
<alina.quereilhac@inria.fr>
Wed, 3 Sep 2014 11:57:38 +0000
(13:57 +0200)
committer
Alina Quereilhac
<alina.quereilhac@inria.fr>
Wed, 3 Sep 2014 11:57:38 +0000
(13:57 +0200)
src/nepi/util/netgraph.py
patch
|
blob
|
history
diff --git
a/src/nepi/util/netgraph.py
b/src/nepi/util/netgraph.py
index
6d68622
..
c04f94d
100644
(file)
--- a/
src/nepi/util/netgraph.py
+++ b/
src/nepi/util/netgraph.py
@@
-19,6
+19,7
@@
import ipaddr
import networkx
+import math
import random
class TopologyType:
@@
-325,8
+326,8
@@
class NetGraph(object):
# The ladder is a special case because is not symmetric.
if self.topo_type == TopologyType.LADDER:
total_nodes = self.order/2
- leaf1 = str(total_nodes
- 1
)
- leaf2 = str(nodes - 1)
+ leaf1 = str(total_nodes)
+ leaf2 = str(
total_
nodes - 1)
leaves = [leaf1, leaf2]
source = leaves.pop(random.randint(0, len(leaves) - 1))
else: