pySTEP |
A light Genetic Programming API that allows the user to easily evolve populations of trees with precise grammatical and structural constraints. In other worlds you can set up building blocks and rules that define individuals during the evolution.
Why using rules and constraints ? Let's take the example of the DNA of a human being which is 95% similar to the DNA of a chimp. This means that there is some strong similarity in the building blocks and the structure of the genetic code. A completely random genetic code would make no sense on a functional practical point of view because it would give some kind of unfit and disfunctional goo... I just think that, to be useful, artificial evolution has to be able to integrate basic rules that determine the shape of the individuals generated, so that we can get practical results. This does not mean we eliminate random search and we still admit poorly fit individuals. But at least we focus the search in the direction of the problem by only generating potentially useful solutions. |
pySTEP is presently functional, running and stable. Still in the process of adding extra tutorials, extra features for reading the populations from the database, and modify some of the crossover code (so far, only 1-point crossover is used).
There has been a lot of improvement going on since the first version:
You can download the last version here.
copyright: (c) 2009 Mehdi Khoury under the mit license.
http://www.opensource.org/licenses/mit-license.html
This distribution comes with several pieces of documentation:
In order to be able to use this package, you need to have installed on your machine:
- psyco for python 2.6
- pysqlite for python 2.6 and the corresponding version of SQlite
- numpy for python 2.6
A detailed html documentation explains how to set the parameters in the settings module and describes each and every of the 5 different tutorials (see tutorial1 to tutorial5 in the api documentation).
To execute the evolution run of the first tutorial, create a main method in Python (there is one main module already made for you in the package if you want...).
Inside, you need to:
1- import the module called "evolver"
2- define a name and path for you database.
3- and then call the EvolutionRun method from the evolver module.
e.g. of a main file:
import evolver
if __name__ == "__main__":
dbname=r'C:\pop_db'
evolver.EvolutionRun(2000,(0,1,'root'),2,8,'AddHalfNode',100, 0.001 ,0.5,0.49,dbname,True)
This means that we define:
The run will create a database file containing tables of names tab0, tab1,... where every table contains the population for the corresponding generation.
For those who want details of the populations, there are methods in the module writepop that allow to:
- get stats from a database table: GetPopStatFromDB(dbname,tablename)
- print the population from a database table to a file: PrintPopFromDB(dbname,tablename,filename)
On a more personal note, I enjoyed programming this API using the Eclipse IDE (there is a pyDev module that allows to use Eclipse to program in Python).
It's great and I recommend it !
Feedback and input are highly welcomed :)
ECJ : Java Genetic Programming Package
pyGP : The Python Genetic Programming Project implements a Genetic Programming System a la J Koza in Python.
Dione : Genetic Programming framework written in Python. Takes advantage of python\'s compiler to make things simple. Includes basic genetic operations (rank/roulette selection,crossover,mutation,steady state,elitistm ...)