From 10ba0fbd9dd6a1053dae82b1b0fc5e8bbac83191 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Tue, 21 Jun 2022 15:25:05 +0200 Subject: [PATCH] rounds survived correction and add to star experiment --- network_attack_propagation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/network_attack_propagation.py b/network_attack_propagation.py index 209044e..44d00d6 100644 --- a/network_attack_propagation.py +++ b/network_attack_propagation.py @@ -213,6 +213,7 @@ def star_experiment(): print(f"\n{node_count} NODE STAR") print(f"average degree = {star_avg_degree}") print(f"propagation speed = {round(speeds[-1], 2)}") + print(f"rounds survived = {star.rounds_survived + 1}") summary(degrees, speeds) @@ -224,11 +225,11 @@ def main(): ring, star_avg_degree = ring_network(36) do_graph_animation('ring.gif', ring, 90, nx.circular_layout) - print(f'bus survived {bus.rounds_survived} rounds') - print(f'ring survived {ring.rounds_survived} rounds') + print(f'bus survived {bus.rounds_survived + 1} rounds') + print(f'ring survived {ring.rounds_survived + 1} rounds') star_experiment() - + if __name__ == "__main__": main()