Hi all,
I seem to be having a problem when assigning fitness values to individuals in a population using these lines of code:
fitnesses=list(map(toolbox.evaluate, population))
for ind, fit in zip (population, fitnesses):
ind.fitness.values=fit
File ~\anaconda3\lib\site-packages\deap\base.py:188, in Fitness.setValues(self, values)
187 def setValues(self, values):
--> 188 assert len(values) == len(self.weights), "Assigned values have not the same length than fitness weights"
189 try:
190 self.wvalues = tuple(map(mul, values, self.weights))
TypeError: object of type 'float' has no len()
How do I resolve this?