The DEAP framework comes with several built-in evolutionary algorithms provided by the algorithms module. One of them, eaSimple, implements the genetic algorithm flow we have been using, and can replace most of the code we earlier had in the main method. Other useful DEAP objects, Statistics and Logbook, can be used for statistics gathering and printing, as we will soon see.
The program described in this section implements the same solution to the OneMax problem as the program discussed in the previous section, but with less code. The only differences are in the main method. We will describe these differences in the following code snippets.
The complete program can be found here: