diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2014-12-04 17:17:04 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2014-12-04 17:17:04 -0500 |
| commit | 9c682e64d18c9cddfa2575adc68c57693862b0f5 (patch) | |
| tree | 1c4995eb353d519d10e12f637d014cd97d3f01ae /jpa_test/make_plots.py | |
| parent | 9b8d4dc469f0e45d377684ab1d7bffcb0c289b18 (diff) | |
| download | cascades-9c682e64d18c9cddfa2575adc68c57693862b0f5.tar.gz | |
yaron poster
Diffstat (limited to 'jpa_test/make_plots.py')
| -rw-r--r-- | jpa_test/make_plots.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/jpa_test/make_plots.py b/jpa_test/make_plots.py index ed7bb10..e3c0d3d 100644 --- a/jpa_test/make_plots.py +++ b/jpa_test/make_plots.py @@ -14,16 +14,18 @@ def plot_rip_numberofnodes(max_proba, n_min, n_max, p_init, n_cascades, K_max): for n_nodes in x: print n_nodes G = cascade_creation.InfluenceGraph(max_proba=.3) - G.erdos_init(n=n_nodes, p=.5) #TODO: handle different inits! + G.erdos_init(n=n_nodes, p=.1) #TODO: handle different inits! cascades = cascade_creation.generate_cascades(G, p_init=p_init, n_cascades=n_cascades) M, __ = cascade_creation.icc_matrixvector_for_node(cascades, None) M = cascade_creation.normalize_matrix(M) - y.append(rip_condition.find_kth_rip_constants(M, 5)) + y.append(rip_condition.find_kth_rip_constants(M, 4)) # + + print y plt.clf() plt.plot(x, y) - plt.show() + #plt.show() return x, y @@ -32,8 +34,8 @@ def test(): """ unit test """ - plot_rip_numberofnodes(max_proba=.3, n_min=10, n_max=15, - p_init=.3, n_cascades=10, K_max=5) + plot_rip_numberofnodes(max_proba=.3, n_min=30, n_max=30, + p_init=.01, n_cascades=100, K_max=4) if __name__=="__main__": test() |
