I wrote this function and used it as a callback to attemp elitist selection without success:
best_chromosome = None
def save_best(population):
global best_chromosome
population_best = population.current_best
if best_chromosome is None or population_best.fitness > best_chromosome.fitness:
best_chromosome = deepcopy(population_best)
Is there a way to do it?