From 6a3bdc44e359cd67dc7db9c508e31e139803e512 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 12 Apr 2021 11:12:46 +0200 Subject: [PATCH] Add function to show results --- src/processing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/processing.py b/src/processing.py index fac1641..b2065a9 100644 --- a/src/processing.py +++ b/src/processing.py @@ -49,6 +49,12 @@ def local_search(): pass +def show_results(solutions): + distance_sum = solutions["distance"].sum() + print(solutions) + print("Total distance: " + str(distance_sum)) + + def usage(argv): print(f"Usage: python {argv[0]} ") exit(1) @@ -59,7 +65,7 @@ def main(): usage(argv) n, m, data = parse_file(argv[1]) solutions = greedy_algorithm(n, m, data) - print(solutions) + show_results(solutions) if __name__ == "__main__":