Some cleaning up

Added Population.size() and cleaned up the survivor selection.
This commit is contained in:
SimpleArt
2020-10-12 16:53:06 -04:00
parent 159506824a
commit 8137bb64d9
3 changed files with 7 additions and 14 deletions

View File

@ -8,6 +8,10 @@ class Population:
self.fitness = None
self.mating_pool = []
def size(self):
"""Returns the size of the population"""
return len(self.chromosome_list)
def get_closet_fitness(self,value):
"""Get the chomosome that has the closets fitness to the value defined"""
pass