Added the termination features
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
# FROM (. means local) file_name IMPORT function_name
|
||||
from .generation_based import generation_based
|
||||
from .fitness_based import fitness_based
|
||||
|
||||
5
src/termination_point/fitness_based.py
Normal file
5
src/termination_point/fitness_based.py
Normal file
@ -0,0 +1,5 @@
|
||||
def fitness_based(ga):
|
||||
status = True
|
||||
if(ga.current_fitness > ga.goal_fitness):
|
||||
status = False
|
||||
return status
|
||||
5
src/termination_point/generation_based.py
Normal file
5
src/termination_point/generation_based.py
Normal file
@ -0,0 +1,5 @@
|
||||
def generation_based(ga):
|
||||
status = True
|
||||
if(ga.current_generation > ga.max_generations):
|
||||
status = False
|
||||
return status
|
||||
Reference in New Issue
Block a user