Renamed termination method

This commit is contained in:
SimpleArt
2020-11-12 14:19:38 -05:00
parent 435c6c1335
commit a5cb864330
2 changed files with 7 additions and 3 deletions

View File

@ -63,7 +63,7 @@ class Attributes:
survivor_selection_impl = Survivor_Selection.fill_in_best,
mutation_individual_impl = Mutation_Methods.Individual.single_gene,
mutation_population_impl = Mutation_Methods.Population.random_selection,
termination_impl = Termination_Methods.fitness_and_generation_based,
termination_impl = Termination_Methods.fitness_generation_tolerance,
Database = sql_database.SQL_Database,
database_name = 'database.db',
sql_create_data_structure = """CREATE TABLE IF NOT EXISTS data (

View File

@ -1,8 +1,12 @@
class Termination_Methods:
"""Example functions that can be used to terminate the the algorithms loop"""
def fitness_and_generation_based(ga):
"""Fitness based approach to terminate when the goal fitness has been reached"""
def fitness_generation_tolerance(ga):
"""Terminate GA when any of the
- fitness,
- generation, or
- tolerance
goals are met."""
# Need to start the algorithm if the population is None.
if ga.population == None: