From d19444dd237d11230664318fdfc004842813b1f2 Mon Sep 17 00:00:00 2001 From: Laszlo Schoonheid Date: Tue, 24 Jan 2023 15:07:07 +0100 Subject: [PATCH] visualization bug fixed --- main.py | 2 +- program_code/visualisation/visualize.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 014e0ed..e639b46 100644 --- a/main.py +++ b/main.py @@ -77,7 +77,7 @@ def main( # Visualize graph if verbose: - sampled_result.score_vector + sampled_result.cached_score_vector print(sampled_result) G = GraphVisualization(sampled_result.schedule) G.visualize() diff --git a/program_code/visualisation/visualize.py b/program_code/visualisation/visualize.py index d052b27..8344464 100644 --- a/program_code/visualisation/visualize.py +++ b/program_code/visualisation/visualize.py @@ -10,9 +10,12 @@ def plot_statistics(results: list[Result]): - evening_timeslots = [result.cached_score_vector[1] for result in results] - student_overbookings = [result.cached_score_vector[2] for result in results] - gaps = [result.cached_score_vector[3] for result in results] + evening_timeslots = [result.cached_score_vector[0] for result in results] + student_overbookings = [result.cached_score_vector[1] for result in results] + gaps = [ + result.cached_score_vector[2] + result.cached_score_vector[3] + result.cached_score_vector[4] + for result in results + ] total_scores = [result.cached_score for result in results] fig, (ax1, ax2, ax3, ax4) = plt.subplots(1, 4, figsize=(9, 4.5), tight_layout=True)