DEAP (software)


Distributed Evolutionary Algorithms in Python is an evolutionary computation framework for rapid prototyping and testing of ideas. It incorporates the data structures and tools required to implement most common evolutionary computation techniques such as genetic algorithm, genetic programming, evolution strategies, particle swarm optimization, differential evolution, traffic flow and estimation of distribution algorithm. It is developed at Université Laval since 2009.

Example

The following code gives a quick overview how the Onemax problem optimization with genetic algorithm can be implemented with DEAP.

import array
import random
from deap import creator, base, tools, algorithms
creator.create
creator.create
toolbox = base.Toolbox
toolbox.register
toolbox.register
evalOneMax = lambda individual:
toolbox.register
toolbox.register
toolbox.register
toolbox.register
population = toolbox.population
NGEN = 40
for gen in range:
offspring = algorithms.varAnd
fits = toolbox.map
for fit, ind in zip:
ind.fitness.values = fit
population = offspring