Skip to content

Commit

Permalink
Merge pull request DEAP#1 from DEAP/master
Browse files Browse the repository at this point in the history
Pull from upstream
  • Loading branch information
wvangeit authored Oct 26, 2016
2 parents f8236fe + 232ed17 commit 41578d9
Show file tree
Hide file tree
Showing 53 changed files with 3,773 additions and 478 deletions.
22 changes: 18 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sudo: false
language: python
matrix:
include:
Expand All @@ -6,12 +7,25 @@ matrix:
- python: "3.4"
env: NUMPY=numpy
- python: "pypy"
env: NUMPY="git+https://bitbucket.org/pypy/numpy.git"
# command to install dependencies
env: NUMPY="git+https://bitbucket.org/pypy/[email protected]#egg=numpy"
addons:
apt:
packages:
- gfortran
- libblas-dev
- liblapack-dev
# command to install dependencies and translate deap in py3k
install:
- python setup.py install
- pip install $NUMPY
- if [[ ${TRAVIS_PYTHON_VERSION%%.*} == '3' ]]; then 2to3 --output-dir=py3k/deap -W -n deap; fi
# command to run tests
script:
# run python3 tests from build/lib because the 2to3 from setup.py does not modify files in-place
- if [[ ${TRAVIS_PYTHON_VERSION%%.*} == '3' ]]; then nosetests -v --where=build/lib; else nosetests -v; fi
- if [[ ${TRAVIS_PYTHON_VERSION%%.*} == '3' ]]; then nosetests -v --where=py3k; else nosetests -v; fi
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/f17745fc250ffb09c0e9
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include *.txt
include *.md
recursive-include deap *.cpp
recursive-include examples *.py *.csv *.json *.txt *.cpp *.hpp
recursive-include doc *
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# DEAP

[![Build status](https://travis-ci.org/DEAP/deap.svg?branch=master)](https://travis-ci.org/DEAP/deap) [![Download](https://img.shields.io/pypi/dm/deap.svg)](https://pypi.python.org/pypi/deap) [![Join the chat at https://gitter.im/DEAP/deap](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DEAP/deap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

DEAP is a novel evolutionary computation framework for rapid prototyping and testing of
ideas. It seeks to make algorithms explicit and data structures transparent. It works in perfect harmony with parallelisation mechanism such as multiprocessing and [SCOOP](http://scoop.googlecode.com).
ideas. It seeks to make algorithms explicit and data structures transparent. It works in perfect harmony with parallelisation mechanism such as multiprocessing and [SCOOP](http://pyscoop.org).

DEAP includes the following features:

* Genetic algorithm using any imaginable representation
* List, Array, Set, Dictionary, Tree, Numpy Array, etc.
* Genetic programing using prefix trees
* Loosely typed, Strongly typed
* Automatically defined functions
* Evolution strategies (including CMA-ES)
* Multi-objective optimisation (NSGA-II, SPEA-II)
* Multi-objective optimisation (NSGA-II, SPEA2, MO-CMA-ES)
* Co-evolution (cooperative and competitive) of multiple populations
* Parallelization of the evaluations (and more)
* Hall of Fame of the best individuals that lived in the population
Expand Down Expand Up @@ -60,19 +63,19 @@ Since version 0.8, DEAP is compatible out of the box with Python 3. The installa

## Example

The following code gives a quick overview how simple it is to implement the Onemax problem optimization with genetic algorithm using DEAP. More examples are provided [here](http://deap.gel.ulaval.ca/doc/default/examples/index.html).
The following code gives a quick overview how simple it is to implement the Onemax problem optimization with genetic algorithm using DEAP. More examples are provided [here](http://deap.readthedocs.org/en/master/examples/index.html).

```python
import array, random
import random
from deap import creator, base, tools, algorithms

creator.create("FitnessMax", base.Fitness, weights=(1.0,))
creator.create("Individual", array.array, typecode='b', fitness=creator.FitnessMax)
creator.create("Individual", list, fitness=creator.FitnessMax)

toolbox = base.Toolbox()

toolbox.register("attr_bool", random.randint, 0, 1)
toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool, 100)
toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool, n=100)
toolbox.register("population", tools.initRepeat, list, toolbox.individual)

def evalOneMax(individual):
Expand All @@ -91,7 +94,8 @@ for gen in range(NGEN):
fits = toolbox.map(toolbox.evaluate, offspring)
for fit, ind in zip(fits, offspring):
ind.fitness.values = fit
population = offspring
population = toolbox.select(offspring, k=len(population))
top10 = tools.selBest(population, k=10)
```

## How to cite DEAP
Expand All @@ -116,6 +120,8 @@ Authors of scientific papers including results generated using DEAP are encourag
* François-Michel De Rainville, Félix-Antoine Fortin, Marc-André Gardner, Marc Parizeau and Christian Gagné, "DEAP: A Python Framework for Evolutionary Algorithms", in !EvoSoft Workshop, Companion proc. of the Genetic and Evolutionary Computation Conference (GECCO 2012), July 07-11 2012. [Paper](http://goo.gl/pXXug)

## Projects using DEAP
* Van Geit, W., M. Gevaert, G. Chindemi, C. Rössert, J.-D. Courcol, E. Muller, F. Schürmann, I. Segev, and H. Markram (2016, March). BluePyOpt: Leveraging open source software and cloud infrastructure to optimise model parameters in neuroscience. ArXiv e-prints.
http://arxiv.org/abs/1603.00500
* Lara-Cabrera, R., Cotta, C. and Fernández-Leiva, A.J. (2014). Geometrical vs topological measures for the evolution of aesthetic maps in a rts game, Entertainment Computing,
* Macret, M. and Pasquier, P. (2013). Automatic Tuning of the OP-1 Synthesizer Using a Multi-objective Genetic Algorithm. In Proceedings of the 10th Sound and Music Computing Conference (SMC). (pp 614-621).
* Fortin, F. A., Grenier, S., & Parizeau, M. (2013, July). Generalizing the improved run-time complexity algorithm for non-dominated sorting. In Proceeding of the fifteenth annual conference on Genetic and evolutionary computation conference (pp. 615-622). ACM.
Expand Down
Loading

0 comments on commit 41578d9

Please sign in to comment.