Yes, this is yet another post about Genetic something-or-others and Perl. What seemed like ages ago, I showed up here while working on my research project, which involved tweaking distributed Genetic Programming -- and I had written all of the code in Perl. At the time, I was also tremendously impressed with myself because I had thought myself to be the only person insane enough to attempt such a thing. Of course, nearly the first node I saw showed me how wrong I was. I did, however, promise to post my code once it was in a vaguely readable state.

Well, it's now several months later, and, having graduated from high school, I now have copious free time. Therefore, I present you with what I called GPerl, or Genetic Programming in Perl.

It implements all of the basic steps which are detailed in Koza's first book (overview). As such, it has a few differences from some of the other genetic methods posted here (1,2,3). Firstly, and probably most imoprtantly, each individual is a nested set of valid perl expressions. "Evaluating" the fitness of an individual is simple: just use eval().

As is noted at the bottom of the POD, this implementation isn't really anywhere close to the speed of various other compiled solutions out there. However, speeding it up couldn't possibly be a bad thing. ;> As such, please do make whatever stylistic, functional, or optimizational suggestions that cross your mind!

For an overview, read the POD.

Update (May 2nd, 2002): So that I don't need to remember to update this every time I push out a new version, I've taken the code off of this page. Go here for the code.

 
perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'


In reply to (Genetic) Perls of Evolution by Chmrr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.