diff options
Diffstat (limited to 'simulation/main.py')
| -rw-r--r-- | simulation/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/simulation/main.py b/simulation/main.py index e4b30f2..3e3de4b 100644 --- a/simulation/main.py +++ b/simulation/main.py @@ -108,15 +108,15 @@ def simulate_cascade(x, graph): yield x, susc -def uniform_source(graph): +def uniform_source(graph, *args, **kwargs): x0 = np.zeros(graph.shape[0], dtype=bool) x0[nr.randint(0, graph.shape[0])] = True return x0 def simulate_cascades(n, graph, source=uniform_source): - for _ in xrange(n): - x0 = source(graph) + for t in xrange(n): + x0 = source(graph, t) yield simulate_cascade(x0, graph) |
