Updated Implementation Framework
Updated to cover changes made by Dan to Master regarding general design changes Also added remove_two_worst survivor selection method
This commit is contained in:
@ -1,2 +1,2 @@
|
||||
# FROM (. means local) file_name IMPORT class name
|
||||
from .termination_types import Termination_Types
|
||||
from .termination_methods import Termination_Methods
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
class Termination_Types:
|
||||
class Termination_Methods:
|
||||
"""Example functions that can be used to terminate the the algorithms loop"""
|
||||
|
||||
def fitness_based(self, ga):
|
||||
"""Fitness based approach to terminate when the goal fitness has been reached"""
|
||||
continue_status = True
|
||||
status = True
|
||||
if(ga.current_fitness > ga.fitness_goal):
|
||||
continue_status = False
|
||||
return continue_status
|
||||
status = False
|
||||
return status
|
||||
|
||||
def generation_based(self, ga):
|
||||
"""Generation based approach to terminate when the goal generation has been reached"""
|
||||
continue_status = True
|
||||
if(ga.current_generation > ga.generation_goal-1):
|
||||
continue_status = False
|
||||
return continue_status
|
||||
status = True
|
||||
if(ga.current_generation > ga.generation_goal):
|
||||
status = False
|
||||
return status
|
||||
0
src/termination_point/test_examples.py
Normal file
0
src/termination_point/test_examples.py
Normal file
Reference in New Issue
Block a user