diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-11-10 16:42:12 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-11-10 16:42:12 -0500 |
| commit | 82b14ab18ccfd032f817979ec0ce74f274b69c3d (patch) | |
| tree | 6ab8aee6e6c189c7957ee2b05b062c833ca959a5 /simulation/main.py | |
| parent | 4db9cdc26c52ecf596e552f569729278bc5dfd8e (diff) | |
| download | cascades-82b14ab18ccfd032f817979ec0ce74f274b69c3d.tar.gz | |
changing non-defined prior and source specification
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) |
