Merge branch 'master' of https://github.com/danielwilczak101/EasyGA
This commit is contained in:
@ -93,7 +93,8 @@ class GA(Attributes):
|
||||
self.sort_by_best_fitness()
|
||||
|
||||
# Save the population to the database
|
||||
self.save_population()
|
||||
if self.save_data:
|
||||
self.save_population()
|
||||
|
||||
# Adapt the ga if the generation times the adapt rate
|
||||
# passes through an integer value.
|
||||
|
||||
@ -180,6 +180,7 @@ class Attributes:
|
||||
|
||||
database: Database = field(default_factory=sql_database.SQL_Database)
|
||||
database_name: str = 'database.db'
|
||||
save_data: bool = True
|
||||
sql_create_data_structure: str = """
|
||||
CREATE TABLE IF NOT EXISTS data (
|
||||
id INTEGER PRIMARY KEY,
|
||||
@ -418,10 +419,8 @@ def get_database_name(self: Attributes) -> str:
|
||||
|
||||
|
||||
def set_database_name(self: Attributes, name: str) -> None:
|
||||
|
||||
# Update the database class' name
|
||||
self.database._database_name = name
|
||||
|
||||
# Set the attribute for itself
|
||||
self._database_name = name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user