Update matplotlib_graph.py

This commit is contained in:
SimpleArt
2020-11-21 21:35:43 -05:00
parent 2f1e21f828
commit bd9016a297

View File

@ -26,7 +26,7 @@ class Matplotlib_Graph:
generations = self.database.get_total_generations(config_id)
# Create the generations list - [0,1,2,etc]
self.x = list(range(0, generations))
self.x = list(range(generations))
# Query for Y data
self.y = self.database.get_generation_total_fitness(config_id)
@ -40,6 +40,7 @@ class Matplotlib_Graph:
plt.ylabel('Generation Total Fitness')
plt.title('Relationship Between Generations and Generation Total Fitness')
def highest_value_chromosome(self,config_id = None):
"""Generation by Max value chromosome """
@ -47,7 +48,7 @@ class Matplotlib_Graph:
generations = self.database.get_total_generations(config_id)
# Create the generations list - [0,1,2,etc]
self.x = list(range(0, generations))
self.x = list(range(generations))
# Query for Y data
self.y = self.database.get_highest_chromosome(config_id)
@ -69,7 +70,7 @@ class Matplotlib_Graph:
generations = self.database.get_total_generations(config_id)
# Create the generations list - [0,1,2,etc]
self.x = list(range(0, generations))
self.x = list(range(generations))
# Query for Y data
self.y = self.database.get_lowest_chromosome(config_id)
@ -83,10 +84,12 @@ class Matplotlib_Graph:
plt.ylabel('Lowest Fitness')
plt.title('Relationship Between Generations and Lowest Fitness')
def show(self):
"""Used to show the matplot lib graph."""
plt.show()
# Getter and setters
@property
def type_of_graph(self):