-- Please use the updated code in the second posting below, it runs faster than this 1st draft. --
Here is my 1st round of tested code for the genetic algorithm Differential Evolution (
http://www.icsi.berkeley.edu/~storn/code.html) using Parallel Python.
The two attached code files are in the form of:
DESolver.py - encapsulates the Differential Evolution algorithm and Parallel Python code
DETest.py - test code and example usage
and requires Numeric Python (numpy,
http://numpy.scipy.org) - Debian and Ubuntu users can 'apt-get install python-numpy'. Since generating random numbers can be time and computationally expensive, there is an option to use one-time fixed arrays of random numbers again speeding the code. I also include an optional polisher to speed up the algorithm, this requires Scientific Python (scipy,
http://www.scipy.org) - Debian and Ubuntu users can 'apt-get install python-scipy'.
In DETest.py, the small TestSolver class consists only of the test data and the function calculation to be minimized, in this case a simple sum-of-squared-error curve fit to the test data points. Just run 'python DETest.py' to see the code in action.
The DESolver.py file holds most of the code, including everything related to Parallel Python.
James