OT: Genetic Algorithm Recipe Bug Fix

Anton Vredegoor anton at vredegoor.doge.nl
Wed Jul 9 10:12:41 EDT 2003


"Sean Ross" <sross at connectmail.carleton.ca> wrote:

>Hi. For anyone who has chosen to use my Genetic Algorithm recipe
>(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/199121), I'd like
>to make you aware of a fairly serious oversite on my part - I left out the
>division part of the standard deviation routine! That's been fixed on the
>recipe page, but not on my personal web site - which will be done when I
>post the new version I'm building for a study I'll be working on this fall.

Importing the math module should also make a big difference for the
standard deviation routine :-) Also stddev was only used by the
sigmascaling code, which was unreachable ... However, this is a very
nice module and I especially like the graphical TSP-solver that is in
the other package on your website.

I had been looking at it before but I failed to comprehend what you
were doing. However recently I developed a taste for Genetic
Algorithms as a side result of a thread on c.l.py here ("getting a
submatrix of all true"). 

In the process of finding a heuristic solution to the problem I came
to understand your module a bit better and I've also tinkered a bit
with it (minor changes) and I have produced a heuristic solution for
the submatrix problem. (it counts 59928 zero's, for insiders :-)

If someone is interested it's here:

http://home.hccnet.nl/a.vredegoor/twomax


Anyway, maybe seeing your code used and *changed* will give enough of
a jolt to start working on it some more (which I would welcome :-)

Anton






More information about the Python-list mailing list