Create Population class

This commit is contained in:
George Lacey 2017-09-22 15:58:00 +01:00
parent 9563ba7222
commit 2c7ffe39a3

16
src/population.py Normal file
View File

@ -0,0 +1,16 @@
from individual import Individual
class Population(object):
def __init__(self, size):
self.members = []
for current in range(0, size):
self.members.append(Individual())
def fitness_function(self):
total = 0
for member in self.members:
total += member.fitness_function()
return total