diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-02-02 13:18:16 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-02-02 13:18:16 -0500 |
| commit | 873ce616a9d21d670f15ab7b5ae61cc143dccc80 (patch) | |
| tree | 26ee84f11c54089a49eed6de5aedd7c87e74a8fa /src/cascade_creation.py | |
| parent | 0480b2f097b60240d29a0de58efac649a8de959f (diff) | |
| download | cascades-873ce616a9d21d670f15ab7b5ae61cc143dccc80.tar.gz | |
more changes
Diffstat (limited to 'src/cascade_creation.py')
| -rw-r--r-- | src/cascade_creation.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cascade_creation.py b/src/cascade_creation.py index 93ce662..39fc531 100644 --- a/src/cascade_creation.py +++ b/src/cascade_creation.py @@ -1,6 +1,7 @@ import networkx as nx import numpy as np import collections +import timeout #from itertools import izip from sklearn.preprocessing import normalize @@ -70,6 +71,7 @@ class Cascade(list): return candidate_infectors +@timeout.timeout(5) def icc_cascade(G, p_init): """ Returns boolean vectors for one cascade @@ -87,7 +89,6 @@ def icc_cascade(G, p_init): active = active & susceptible susceptible = susceptible & np.logical_not(active) if not cascade: - print("Empty cascade, consider changing p_init or n_nodes. Retrying.") return icc_cascade(G, p_init) return cascade |
