January 2020
Intermediate to advanced
346 pages
9h 8m
English
Before we start the actual genetic algorithm flow, we need to set things up, and the DEAP framework has a quite distinct way of doing it, as shown in the rest of this section:
from deap import basefrom deap import creatorfrom deap import toolsimport randomimport matplotlib.pyplot as plt
# problem constants:ONE_MAX_LENGTH = 100 # length of bit string to be optimized# Genetic Algorithm constants:POPULATION_SIZE = 200 # number of individuals in populationP_CROSSOVER = 0.9 # probability for crossover ...
Read now
Unlock full access