Renamed termination method
This commit is contained in:
@ -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 (
|
||||
|
||||
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user