aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/main.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2015-10-16 16:52:17 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2015-10-16 16:52:17 -0400
commitfd4b442d8e429c97f2d72929f5c211f5f5e4d2b3 (patch)
tree6a30e5c87bd029728e50811e225f2345df26166c /simulation/main.py
parent114c6a44edb87348574cdf747cd21ab3c328c4d8 (diff)
downloadcascades-fd4b442d8e429c97f2d72929f5c211f5f5e4d2b3.tar.gz
Fix source selection + cosmetic improvement for Jean
Diffstat (limited to 'simulation/main.py')
-rw-r--r--simulation/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/simulation/main.py b/simulation/main.py
index 63c8c02..b7b3eaa 100644
--- a/simulation/main.py
+++ b/simulation/main.py
@@ -39,8 +39,8 @@ def simulate_cascade(x, graph):
def simulate_cascades(n, graph):
for _ in xrange(n):
- x = np.zeros(g.shape[0]).astype(bool)
- x[nr.random()] = True
+ x = np.zeros(g.shape[0], dtype=bool)
+ x[nr.randint(0, g.shape[0])] = True
yield simulate_cascade(x, graph)