OT: Genetic Algorithm Recipe Bug Fix

Sean Ross frobozz_electric at hotmail.com
Wed Jul 9 11:17:09 EDT 2003


"Anton Vredegoor" <anton at vredegoor.doge.nl> wrote in message
news:beh8ad$dm0$1 at news.hccnet.nl...
> 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 ...

Thank you! I tacked on the fitness proportional stuff (roulette selection,
sigma scaling, expected values) on at the end to try to make the offering
more well-rounded, but I only did a couple of quick runs on one problem to
test. It looked fine, so I went ahead. I won't do that again - heh.

I had *no* idea that the sigma scaling was unreachable. I'm stunned and
embarassed. Thank you for making me aware the problem. I've done the
imported math module fix but, as for the sigma scaling, that will be
resolved in the newer version I'm working on: refactoring, renaming,
redesigning, reworking, that sort of thing. That version should be available
on my site sometime in early August. I already prefer it over the old
version, and I'm not quite finished :)

> 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'm glad you like it. I enjoyed watching it try to solve problems too.
Seeing where it would get stalled, trying to fiddle with the parameters to
make it work faster, better. Unfortunately, I did that display for a course,
so it was a matter of "just meet the deadline" code production. So, for
instance, the builtin scaling mechanisms are poorly designed - you can't
easily introduce a TSP problem that is different from the one provided and
have it display well. I don't know if I'll get around to fixing that soon -
I have other things to work on at the moment.

> I had been looking at it before but I failed to comprehend what you
> were doing.

There's a lot there. I'm a bit torn. I wanted to give people some examples
of operators that you may not find in other Genetic Algorithm code, but I
also think there's just a bit too much code there. When I post the next
version, I'm thinking I will just post a kernel of the system with a few
interesting tidbits, and then make the entire module available on my site.
That way it will be easier to read on the recipe page, and you can still get
more if you like.
We'll see.

> 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 :-)

Wait til you read the next version ;)  It has 3 whole classes! (heh). Thanks
again for making me aware of the bugs in this code. I was hoping people
might get some benefit from this code, and I'm glad that someone has. I'm
just sorry it's not better.






More information about the Python-list mailing list