Merge branch 'master' into ryley_beta

This commit is contained in:
Ryley
2020-10-06 21:11:22 -04:00
committed by GitHub
34 changed files with 168 additions and 82 deletions

View File

@ -0,0 +1,16 @@
class Termination_methods:
"""Example functions that can be used to terminate the the algorithms loop"""
def fitness_based(ga):
"""Fitness based approach to terminate when the goal fitness has been reached"""
status = True
if(ga.current_fitness > ga.fitness_goal):
status = False
return status
def generation_based(ga):
"""Generation based approach to terminate when the goal generation has been reached"""
status = True
if(ga.current_generation > ga.generation_goal):
status = False
return status

View File