I am just starting use DEAP. Previously, I used GA based on Matlab that after crossover and mutation is to select the better individuals with specified size, and then updating the population. But it is quite hard for me to understand that why in DEAP the evaluate the individuals with an invalid fitness is needed after the crossover and mutation procedure:
invalid_ind = [ind for ind in offspring if not ind.fitness.valid]
fitnesses = map(toolbox.evaluate, invalid_ind)
for ind, fit in zip(invalid_ind, fitnesses):
ind.fitness.values = fit
I tried that deleting those code, but it seems the algorithm will never convergence. And even I did't see those can updating the population/offspring, so what are those use for. Thanks in advance!!!