Who can do genetic programming with Python

J.Jacob joost_jacob at hotmail.com
Wed Nov 21 10:54:40 EST 2001


Does anyone have code that produces correct but random Python code ?
This would be useful for a genetic programming (GP) test we want to
do.

Suppose you need a function that accepts a list (of unknown length and
containing values of unknown type) and outputs a list of integer
values with length outputlength.
The function you are looking for would look like:

def myFunction( inputlist, outputlength ):
    # black box code here, building outputlist
    return outputlist

But you have no idea how to code the function, you only know it
accepts a list and outputs a list of integers.
You also have a way to test if the function does what you want, in
some environment script.  For example if you call the function with
myFunction([3, 4], 1) you want it to return [12], being a list
containing the product of the variables in inputlist.
Suppose you cannot code the black box part yourself, now you would
like a system that does if for you.  With GP you can do things like
this, it has been done before in lisp and even in C and Python seems
very suitable for it.

Before we are going to try to implement something we would like to
know if somebody else has been doing this already.  We did search
internet and there are tons of GP links but we did not find a GP
example with Python.



More information about the Python-list mailing list