From 82b14ab18ccfd032f817979ec0ce74f274b69c3d Mon Sep 17 00:00:00 2001 From: jeanpouget-abadie Date: Tue, 10 Nov 2015 16:42:12 -0500 Subject: changing non-defined prior and source specification --- simulation/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'simulation/main.py') 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) -- cgit v1.2.3-70-g09d2