From 5a72a8493d22ec72d09274a807e115e09889f29b Mon Sep 17 00:00:00 2001 From: danielwilczak101 <44122838+danielwilczak101@users.noreply.github.com> Date: Thu, 12 Nov 2020 16:47:36 -0500 Subject: [PATCH] Fixed variable names --- src/database/matplotlib_graph.py | 12 ++++-------- src/run_testing.py | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/database/matplotlib_graph.py b/src/database/matplotlib_graph.py index 01d3347..c8b41b6 100644 --- a/src/database/matplotlib_graph.py +++ b/src/database/matplotlib_graph.py @@ -30,11 +30,7 @@ class Matplotlib_Graph: def plot(self): """Plot all the graph attributes""" - if self.xlabel is not None: xlabel = self.xlabel - if self.ylabel is not None: xlabel = self.ylabel - if self.title is not None: xlabel = self.title - - if yscale == "log": + if self.yscale == "log": # If using log then the values have to be positive numbers self.y = [abs(ele) for ele in self.y] @@ -44,9 +40,9 @@ class Matplotlib_Graph: self.type_of_plot(self.x, self.y) # labels - if self.xlabel is not None: xlabel = self.xlabel - if self.ylabel is not None: xlabel = self.ylabel - if self.title is not None: xlabel = self.title + #if self.xlabel is not None: xlabel = self.xlabel + #if self.ylabel is not None: xlabel = self.ylabel + #if self.title is not None: xlabel = self.title # Show the plot plt.show() diff --git a/src/run_testing.py b/src/run_testing.py index 6a5e6e8..1fbdbd0 100644 --- a/src/run_testing.py +++ b/src/run_testing.py @@ -11,4 +11,4 @@ ga.generation_goal = 150 ga.evolve() -ga.graph.highest_value_chromosome() +ga.graph.generation_total_fitness()