Using the DEAP Framework
In this chapter – as promised – the real fun begins! You will be introduced to Distributed Evolutionary Algorithms in Python (DEAP) – a powerful and flexible evolutionary computation framework capable of solving real-life problems using genetic algorithms. After a brief introduction, you will get acquainted with two of its main modules – the creator and the toolbox – and learn how to create the various components needed for the genetic algorithm flow. We will then write a Python program that solves the OneMax problem – the Hello World of genetic algorithms – using the DEAP framework. This will be followed by a more concise version of the same program, where we’ll take advantage of the built-in algorithms of the framework. We’ve saved the best for the last part of this chapter, where we will be experimenting with various settings of the genetic algorithm we created and discover the effects of our...