Fixed graph features

- Common graph code made into a method.
- No longer needs the user to pass in the ga for graphing.
- Changed graph attribute from class to object.
- Added ga to the graph object as an attribute on initialization to avoid needing to pass it in every time you graph.
- Capitalized database/graph classes.
This commit is contained in:
SimpleArt
2020-11-07 12:43:47 -05:00
parent 87beba1209
commit f1f9d70c26
5 changed files with 47 additions and 42 deletions

View File

@ -71,7 +71,7 @@ class Attributes:
fitness DOUBLE,
chromosome text
); """,
graph = graph.graph
Graph = graph.Graph
):
# Initilization variables
@ -122,7 +122,8 @@ class Attributes:
self.sql_create_data_structure = deepcopy(sql_create_data_structure)
# Graphing variables
self.graph = deepcopy(graph)
self.graph = Graph(self)
# Getter and setters for all required varibles
@property
@ -131,6 +132,7 @@ class Attributes:
return self._chromosome_length
@chromosome_length.setter
def chromosome_length(self, value_input):
"""Setter function with error checking for chromosome length"""
@ -147,6 +149,7 @@ class Attributes:
return self._population_size
@population_size.setter
def population_size(self, value_input):
"""Setter function with error checking for population size"""