This is the documentation of the Pyevolve release 0.6rc1. Since the version 0.5, Pyevolve has changed in many aspects, many new features was added and many bugs was fixed, this documentation describes those changes, the new API and new features.
Pyevolve was developed to be a complete genetic algorithm framework written in pure python, the main objectives of Pyevolve is:
Pyevolve can be executed on Windows, Linux and Mac platforms.
Note
On the Mac platform, it’s reported that Pyevolve 0.5 can’t enter on the Interactive Mode.
Pyevolve requires the follow modules:
The matplotlib [1] is required to plot the graphs.
The Pydot [3] is used to plot the Genetic Programming Trees.
The MySQL [4] is used by the MySQL DB Adapter.
Footnotes
[1] | Matplotlib is Copyright (c) 2002-2008 John D. Hunter; All Rights Reserved |
[2] | VPython was originated by David Scherer in 2000. |
[3] | Pydot was developed by Ero Carrera. |
[4] | MySQLdb was developed by Andy Dustman and contributors. |
Installers for Microsoft Windows platform:
Installation package for Linux platform:
Examples package for Pyevolve v.0.6rc1:
You can download the specific Pyevolve from the Downloads section, or using easy_install.
The installation can be easy done by using the easy_install:
easy_install pyevolve
You can upgrade your older version too:
easy_install --upgrade pyevolve
or install a downloaded egg package:
easy_install /downloads/downloaded_package.egg
or install from an URL:
easy_install http://site/package.egg
This command will automatic search, download and install a suitable version of pyevolve, once you have installed, you can test:
>>> import pyevolve
>>> print pyevolve.__version__
'v.0.6rc1'
easy_install utility is part of setuptools. Once you have installed setuptools, you will find the easy_install.exe program in your Python Scripts subdirectory.
1D List, 2D List, 1D Binary String, 2D Binary String and Tree
Note
it is important to note, that the 1D List, 2D List and Tree can carry any type of python objects or primitives.
Crossover Methods
- 1D Binary String
- Single Point Crossover, Two Point Crossover, Uniform Crossover
- 1D List
- Single Point Crossover, Two Point Crossover, Uniform Crossover, OX Crossover, Edge Recombination Crossover, Cut and Crossfill Crossover, Real SBX Crossover
- 2D List
- Uniform Crossover, Single Vertical Point Crossover, Single Horizontal Point Crossover
- 2D Binary String
- Uniform Crossover, Single Vertical Point Crossover, Single Horizontal Point Crossover
- Tree
- Single Point Crossover, Strict Single Point Crossover
Mutator Methods
- 1D Binary String
- Swap Mutator, Flip Mutator
- 2D Binary String
- Swap Mutator, Flip Mutator
- 1D List
- Swap Mutator, Integer Range Mutator, Real Range Mutator, Integer Gaussian Mutator, Real Gaussian Mutator, Integer Binary Mutator, Allele Mutator, Simple Inversion Mutator
- 2D List
- Swap Mutator, Integer Gaussian Mutator, Real Gaussian Mutator, Allele Mutator, Integer Range Mutator
- Tree
- Swap Mutator, Integer Range Mutator, Real Range Mutator, Integer Gaussian Mutator, Real Gaussian Mutator
Initializators
- 1D Binary String
- Binary String Initializator
- 2D Binary String
- Binary String Initializator
- 1D List
- Allele Initializator, Integer Initializator, Real Initializator
- 2D List
- Allele Initializator, Integer Initializator, Real Initializator
- Tree
- Integer Initializator, Allele Initializator
Scaling Methods
Linear Scaling, Sigma Truncation Scaling and Power Law Scaling, Raw Scaling, Boltzmann Scaling, Exponential Scaling, Saturated Scaling
Selection Methods
Rank Selection, Uniform Selection, Tournament Selection, Tournament Selection Alternative (doesn’t uses the Roulette Wheel), Roulette Wheel Selection
Chromosomes / Representations
Tree
Warning
the Tree of Genetic Programming is the class GTree.GTreeGP and not the GTree.GTree class of the Genetic Algorithm representation.
Crossover Methods
- Tree
- Single Point Crossover
Mutator Methods
- Tree
- Operation Mutator, Subtree mutator
Initializators
- Tree
- Grow Initializator, Full Initializator, Ramped Half-n-Half
Scaling Methods
Linear Scaling, Sigma Truncation Scaling and Power Law Scaling, Raw Scaling, Boltzmann Scaling, Exponential Scaling, Saturated Scaling
Selection Methods
Rank Selection, Uniform Selection, Tournament Selection, Tournament Selection Alternative (doesn’t uses the Roulette Wheel), Roulette Wheel Selection
In this section, you will find study material to learn more about Genetic Algorithms.
Goldberg, David E (1989), Genetic Algorithms in Search, Optimization and Machine Learning, Kluwer Academic Publishers, Boston, MA.
Goldberg, David E (2002), The Design of Innovation: Lessons from and for Competent Genetic Algorithms, Addison-Wesley, Reading, MA.
Fogel, David B (2006), Evolutionary Computation: Toward a New Philosophy of Machine Intelligence, IEEE Press, Piscataway, NJ. Third Edition
Holland, John H (1975), Adaptation in Natural and Artificial Systems, University of Michigan Press, Ann Arbor
Michalewicz, Zbigniew (1999), Genetic Algorithms + Data Structures = Evolution Programs, Springer-Verlag.
See also
In this section, you will find study material to learn more about Genetic Programming.
Poli, Riccardo; Langdon, William B.; McPhee, Nicholas F., A Field Guide to Genetic Programming, this book is also available online (a GREAT initiative from authors) in Book Site
Koza, John R., Genetic Programming: On the Programming of Computers by Means of Natural Selection, MIT Press, 1992.
See also
Also called Fitness Function or Objective Function, the evaluation function is the function which evaluates the genome, giving it a raw score. The objective of this function is to quantify the solutions (individuals, chromosomes)
See also
Pyevolve have an interactive mode, you can enter in this mode by pressing ESC key before the end of the evolution. When you press ESC, a python environment will be load. In this environment, you have some analysis functions and you can interact with the population of individuals at the specific generation.
See also
The standardized fitness restates the raw score so that a lower numerical value is always a better value.
See also
The adjusted fitness is a measure computed from the Standardized Fitness, the Adjusted Fitness is always between 0 and 1 and it’s always bigger for better individuals.
See also
See also
Pyevolve is compatible with PyS60 2.0 (but older versions of the 1.9.x trunk should work fine too); PyS60 2.0 is a port of Python 2.5.4 core to the S60 smartphones, it was made by Nokia and it’s Open Source. All smartphones based on the S60 2nd and 3rd editions should run PyS60, you can download it from the Maemo garage project home.
To install Pyevolve in PyS60 you simple need to copy the “pyevolve” package (you can use the sources of Pyevolve or even the “pyevolve” of your Python installation to the smartphone in a place that PyS60 can find it, usually in c:\resource\Python25, for more information read the PyS60 documentation. The Genetic Algorithms and the Genetic Programming cores of Pyevolve was tested with PyS60 2.0, but to use Genetic Programming, you must define explicitly the funtions of the GP, like in How to manually add non-terminal functions to Genetic Programming core.
Of course not all features of Pyevolve are supported in PyS60, like for example some DBAdapters and the graphical plotting tool, since no matplotlib port is available to PyS60 at the moment. Pyevolve was tested with PyS60 2.0 in a Nokia N78 and in a Nokia N73 smartphones.
See also
Jython is an implementation of Python language and it’s modules (not all unfortunatelly) which is designed to run over the Java platform. Pyevolve was tested against Jython 2.5.x and worked well, except for the Genetic Programming core which is taking a lot of memory, maybe a Jython issue with the Java JVM.
You’re highly encouraged to run Jython with the JVM “-server” option; this option will enable anoter VM JIT which is optimal for applications where the fast startup times isn’t important, and the overall performance is what matters. This JIT of the “Server mode” has different policies to compile your code into native code, and it’s well designed for long running applications, where the VM can profile and optimize better than the JIT of “Client mode”.
Pyevolve was tested against Jython 2.5.1 in Java v.1.6.0_18 Java(TM) SE Runtime Environment (build 1.6.0_18-b07) Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
See also
IronPython is an open-source implementation of the Python programming language targeting the .NET Framework and Mono, written entirely in C# and created by Jim Hugunin. IronPython is currently language-compatible with Python 2.6.
Pyevolve was tested against the IronPython 2.6 (2.6.10920.0) in a Windows XP SP3 with .NET 2.0.50727.3603.
See also
The Genetic Algorithm core of Pyevolve was tested on iPod Touch 2G with the firmware v.3.1.2. To use it, you first must install the port of Python 2.5+ to the OS of iPod. You just need to put the Pyevolve package inside the directory where you’ll call your application or just put it inside another place where the Python from iPod/iPhone can found in path.
See also
Pyevolve, at least for the versions <= 0.6, have all modules written in pure Python, which enables some very useful features and portability, but sometimes weights in performance. Here are some ways users and developers uses to increase the performance of Pyevolve:
- Psyco
- Psyco is the well know Python specializing compiled, created by Armin Rigo. Psyco is very easy to use and can give you a lot of speed up.
- Cython
- Cython is a specific language used to create C/C++ extensions for Python, it is based on the Python language itself, so if you think Psyco is not enought or aren’t giving too much optimizations, you can use Cython to create your own C/C++ extensions; the best approach is to use Cython to build your Evaluation function, which is usually the most consuming part of Genetic Algorithms.
See also