~ubuntu-branches/ubuntu/utopic/deap/utopic-proposed

« back to all changes in this revision

Viewing changes to doc/examples/coev_coop.rst

  • Committer: Package Import Robot
  • Author(s): Daniel Stender, Miriam Ruiz, Daniel Stender, Jakub Wilk
  • Date: 2014-07-06 00:03:41 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140706000341-s7gij1ki3d8xz6t9
Tags: 1.0.1-1
[ Miriam Ruiz ]
* New Upstream Release. Closes: #675200
* Upgraded Standards-Version from 3.9.2 to 3.9.5
* Switched to dh_python2
* Upgraded debian/compat to 9
* Added build-arch and build-indep targets to debian/rules
* Using awk to remove connection from the documentation to google analytics
* Using jquery.js and underscore.js from libjs-jquery and libjs-underscore
* Added patches/doc.patch

[ Daniel Stender ]
* deb/control:
  + Added myself to Uploaders.
  + Added version to b-p on python-all.
  + Updated Homepage.
  + Wrapped and sorted.
* deb/copyright:
  + Changed copyright file towards DEP-5.
  + Updated Source URI (project source moved to Github).
  + Added email addresses for copyright holders.
  + Dropped license for eap/toolbox.py (not included anymore).
  + Extended copyrights to 2014.
  + Added myself to copyrights for deb/*.
  + Specified license location.
* Added watch file [initial version by Jackson Doak].

[ Jakub Wilk ]
* Use canonical URIs for Vcs-* fields.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=======================
 
2
Cooperative Coevolution
 
3
=======================
 
4
 
 
5
This example explores cooperative coevolution using DEAP. This tutorial is not
 
6
as complete as previous examples concerning type creation and other
 
7
basic stuff. Instead, we cover the concepts of coevolution as they would be
 
8
applied in DEAP. Assume that if a function from the toolbox is used,
 
9
it has been properly registered. This example makes a great template for
 
10
implementing your own coevolutionary algorithm, it is based on the description
 
11
of cooperative coevolution by [Potter2001]_.
 
12
 
 
13
Coevolution is, in fact, just an extension of how algorithms works in deap.
 
14
Multiple populations are evolved in turn (or simultaneously on multiple
 
15
processors) just like in traditional genetic algorithms. The implementation of
 
16
the coevolution is thus straightforward. A first loop acts for iterating over
 
17
the populations and a second loop iterates over the individuals of these
 
18
population.
 
19
 
 
20
The first step is to create a bunch of species that will evolve in our
 
21
population.
 
22
 
 
23
.. literalinclude:: /../examples/coev/coop_evol.py
 
24
   :lines: 72
 
25
 
 
26
Cooperative coevolution works by sending the best individual of each species
 
27
(called representative) to help in the evaluation of the individuals of the
 
28
other species. Since the individuals are not yet evaluated we select randomly
 
29
the individuals that will be in the set of representatives. 
 
30
 
 
31
.. literalinclude:: /../examples/coev/coop_evol.py
 
32
   :lines: 77
 
33
 
 
34
The evaluation function takes a list of individuals to be evaluated including
 
35
the representatives of the other species and possibly some other arguments.
 
36
It is not presented in detail for scope reasons, the structure would be, as
 
37
usual, something like this ::
 
38
 
 
39
   def evaluate(individuals):
 
40
       # Compute the collaboration fitness
 
41
       return fitness,
 
42
 
 
43
The evolution can now begin.
 
44
 
 
45
.. literalinclude:: /../examples/coev/coop_evol.py
 
46
   :lines: 85-96,103-106,113-114
 
47
 
 
48
The last lines evolve each species once before sharing their representatives.
 
49
The common parts of an evolutionary algorithm are all present, variation,
 
50
evaluation and selection occurs for each species. The species index is simply
 
51
a unique number identifying each species, it can be used to keep independent
 
52
statistics on each new species added.
 
53
 
 
54
After evolving each species, steps described in [Potter2001]_ are achieved
 
55
to add a species and remove useless species on stagnation. These steps are not
 
56
covered in this example but are present in the complete source code of
 
57
the coevolution examples.
 
58
 
 
59
- :example:`Coevolution Base <coev/coop_base>`
 
60
- :example:`Coevolution Niching <coev/coop_niche>`
 
61
- :example:`Coevolution Generalization <coev/coop_gen>`
 
62
- :example:`Coevolution Adaptation <coev/coop_adapt>`
 
63
- :example:`Coevolution Final <coev/coop_evol>`
 
64
       
 
65
.. [Potter2001] Potter, M. and De Jong, K., 2001, Cooperative
 
66
   Coevolution: An Architecture for Evolving Co-adapted Subcomponents.