Updated tournament selection

On small populations, there is now a lower bound on the tournament size.
This commit is contained in:
RyleyGG
2020-10-08 22:48:45 -04:00
parent 88927f7415
commit dcc3684202
3 changed files with 11 additions and 15 deletions

View File

@ -29,12 +29,13 @@ class GA:
# Selection variables
self.parent_ratio = 0.1
self.selection_probability = 0.95
self.tournament_size_ratio = 0.1
# Termination variables
self.current_generation = 0
self.current_fitness = 0
self.generation_goal = 250
self.generation_goal = 15
self.fitness_goal = 9
# Mutation variables