From 817b33fecd8287857823bb010daf2edaaff977d8 Mon Sep 17 00:00:00 2001 From: cengwins Date: Fri, 14 Jan 2022 12:47:51 +0300 Subject: [PATCH] Imports corrected --- SelfStabilization/__init__.py | 0 SelfStabilization/test.py | 29 --------------------- SelfStabilization/testbenchmark.py | 41 ------------------------------ 3 files changed, 70 deletions(-) delete mode 100755 SelfStabilization/__init__.py delete mode 100644 SelfStabilization/test.py delete mode 100644 SelfStabilization/testbenchmark.py diff --git a/SelfStabilization/__init__.py b/SelfStabilization/__init__.py deleted file mode 100755 index e69de29..0000000 diff --git a/SelfStabilization/test.py b/SelfStabilization/test.py deleted file mode 100644 index 68aed01..0000000 --- a/SelfStabilization/test.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import matplotlib.pyplot as plt - -from ahc.SelfStabilization.AroraGouda import * -from ahc.SelfStabilization.AfekKuttenYang import * - - -def main(): - G = nx.random_geometric_graph(7, 0.8) - - topology = SharedMemoryTopology() - topology.construct_from_tree(G, AroraGoudaNode, args=[len(G.nodes)]) # K value - - topology.plot_base_graph() - plt.show() - - plt.clf() - - topology.start() - topology.plot() - - plt.show() - -if __name__ == "__main__": - main() diff --git a/SelfStabilization/testbenchmark.py b/SelfStabilization/testbenchmark.py deleted file mode 100644 index 19552c8..0000000 --- a/SelfStabilization/testbenchmark.py +++ /dev/null @@ -1,41 +0,0 @@ -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import time - -import matplotlib.pyplot as plt - -from ahc.SelfStabilization.AroraGouda import * -from ahc.SelfStabilization.AfekKuttenYang import * - -def eprint(*args, **kwargs): - print(*args, file=sys.stderr, **kwargs) - -def main(): - for n in range(15, 50 + 1): - G = nx.random_geometric_graph(n, 0.8) - - topology1 = SharedMemoryTopology() - topology1.construct_from_tree(G, AroraGoudaNode, args=[len(G.nodes)]) # K value - - topology2 = SharedMemoryTopology() - topology2.construct_from_tree(G, AfekKuttenYangNode, args=[max(list(G.nodes))]) - - eprint('started') - - start_time = time.monotonic() - topology1.start() - elapsed1 = time.monotonic() - start_time - eprint('skip') - - start_time = time.monotonic() - topology2.start() - elapsed2 = time.monotonic() - start_time - - print(f'{elapsed1};{elapsed2}') - eprint(f'{elapsed1};{elapsed2}') - -if __name__ == "__main__": - main()