January 2020
Intermediate to advanced
346 pages
9h 8m
English
Now it's time for the actual flow. This is done with a single call to the algorithms.eaSimple method, one of the built-in evolutionary algorithms provided by the algorithms module of DEAP. When we call the method, we provide it with the population, toolbox, and the statistics object among other parameters:
population, logbook = algorithms.eaSimple(population, toolbox, cxpb=P_CROSSOVER, mutpb=P_MUTATION, ngen=MAX_GENERATIONS, stats=stats, verbose=True)
The algorithms.eaSimple method assumes that we have previously used toolbox to register the following operators—evaluate, select, mate, and mutate—which we have already done when we created the original program. The stopping condition here is set by the value of ngen, the number ...
Read now
Unlock full access