"Unfortunately my lack of knowledge in genetic" Unfortunately I misread this as "my lack of knowledge is genetic", but I am running on a caffeine shortage :) I don't have time to work with your code right now, but generally speaking throwing some classes and object methods in there would improve the readability quite a bit -- I do understand you were trying a more-or-less direct port. I've frequently looked at Perl code on developerworks and thought it could be improved significantly with better modularity. Developer works does not do a good job of technical editing, IMHO, so they turn into a bit of a "submit article, get $$$" farm. You might want to search perlmonks.org for better Perl examples, or you could look at some of the genetic algorithm stuff already on CPAN. On Wed, 15 Dec 2004 00:27:26 +0900, Phil Tomson <ptkwt / aracnet.com> wrote: > In article <YsCvd.14841$3U4.403540 / news02.tsnz.net>, > Robo <robo / mars.com> wrote: > >-=-=-=-=-=- > > > >Hi, I took an interest in genetic algorithm after reading this article: > > > >http://www-106.ibm.com/developerworks/linux/library/l-genperl/ > > > >The code listing is here: > > > >http://www-106.ibm.com/developerworks/linux/library/l-genperl/numbers.html > > > >To gain a better understanding, I tried the convert the code to Ruby, > >and on the way I should be able to understand how it works. > > > >Unfortunately my lack of knowledge in genetic and Perl means I couldn't > >quite get the code working. When it runs, each generation doesn't seem > >to improve. It would be great if someone could take a look, compare it > >to the original Perl version and see where I've gone wrong, and the fix > >require to get it working. The code's attached to this post. > > > > > > That's a lot of code. :) > > If you're interested I've got some Ruby code I wrote for a GA class I took > a couple of years ago. At least I know it works (as in there is > improvement from generation to generation). email me if you're interested > and I'll try to dig it up. > > Phil > >