Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Perl Programming

Cultured Perl: Genetic Algorithms, The Next Generation 35

BritMit writes "One of the more intriguing types of algorithm is the genetic algorithm. Genetic algorithms mimic Darwinian natural selection, where "fitness" selects individuals for survival, breeding, and, hence, adaptive mutation. A previous article: Genetic algorithms applied with Perl covered the background on this, and provided two Perl implementations, one that bred bytes and another that bred words. This follow-up article expands this idea of Perl evolution with more advanced material on genetic algorithms."
This discussion has been archived. No new comments can be posted.

Cultured Perl: Genetic Algorithms, The Next Generation

Comments Filter:
  • We don't see genetic algorithms and evolutionarily-created software taking over the software industry. If it was truly better, you think we would see some startup in a meteoric rise or at least see some "old" companies like MS taking advantage of it. Instead the entire world of practical software is based on a creationism model, where a master designer plans and executes each step.

    I think this is an important demonstration of the lack of real substance to Darwin's ideas. Perhaps those inefficiencies in the human body (appendix and so forth) are really just bugs or backwards compatibility modules in an engineered product.

    • This is typical creationist rhetoric. "I can't see evolution so it doesn't happen".

      The fact is, Genetic algorithms are quite good at answering questions like. What's the best sequence of events to follow in order to survive (survive doesn't neccesarily mean live here) a circumstance. End users don't want to teach a program they buy to work they want a working program. Genetic algorithms ARE used to help develop these programs.

      Perhaps as people get more tech savy they will see more genetic algorithms in their everyday lives. Thinks like handwriting or voice recognition on PDA's.

      Just because something isn't in mainstream use is a poor argument for it's validity. I mean by your argument Brittany spears is one of the greatest vocalists of all time!

      • You think, the parent was for real?

        >Perhaps as people get more tech savy they will see more genetic algorithms in their everyday lives.

        Not likely. GAs (or better Evolutionary algorithms) are quite good at finding an abritrary good solution in a practicably unknown problem space in restricted time, but are terribly inefficient.
        So, if you want to find several solutions, it's more efficient to have a good look at the problem space and to find a more efficient algorithm. Often random-search or hill-climber delivers an acceptable solution in much shorter time.

        At least, that is what I'm told. I'm lacking practical experience in that field.

        > [...] like handwriting or voice recognition on PDA's.

        Another EA has delivered us a quite good solution for pattern recognition: the brain. Now, we just have to understand it :).

        On a sidenote, where are the advanced topics the poster spoke of? Not seeing a single link to meta-eas, multipopulations (island models) or speciation.

        Links to more Perl, and a link to algorithms for genetics, but evolutionary algorithms?
    • God is a fast programmer. If you follow Genesys, it takes him 4 caffeine induced late night days to write the alogrythm (night, day, universe, earth and water), 2 days to create the base code(humans and animals), but starting on the 7th day on, he sat back and watched.

      God's been sitting back for 5000-5 million years watching his genetic algorithm work, and only had to reboot once . Compare that to the creationism methods of MS that produces systems that have to be rebooted daily, I'd say God's Darwn system works better....
  • How is it possible that these algorithms work?

    I mean, didn't Darwin denounce evolution on his deathbed?


    ---Lane
    • No, that's a lie that was invented by and perpetuated by Xtians who just wanted to smear the good name of Darwin. Darwin did not denounce evolution, nor did he have a conversion to Xtianity on his deathbed.
    • I know that's a joke, but just in case someone decides to take it seriously....

      This is one of those persistent myths. Darwin apparently did dislike the way certain atheists tried to appropriate his work as a theological agrument, but there's no proof he ever disavowed evolution or converted back to Christianity at the end of his life. (Review: The Darwin Legend by James Moore) [rpi.edu]

      That said, evolution and theology have little to do with each other. If you believe in God (or some version thereof), there's no reason to disbelieve that she/he/it used evolution as a mechanism of creation. Personally, I think a supreme being is an unnecessary complication, but that's not related to evolution either.

    • I mean, didn't Darwin denounce evolution on his deathbed?

      Sounds like a great hedge to me. If God exists, then the denunciation may save him. If not, then the Universe does not give a fudge about what he denounces because it is "un-caring". Thus, no risk.
  • Performance (Score:2, Funny)

    by Yokaze ( 70883 )
    Wow... the performance of Genetic Algorithms and Perl combined.

    Almost like real evolution at work.
    • Wow... the performance of Genetic Algorithms and Perl combined. Almost like real evolution at work.

      Well, to me Perl does indeed look like the raw guts of some kind of living creature.
  • Genetic Algorithms: Cool
    Perl: Kinda Cool

    I hate to say it but Perl+GA's sounds like an education in ridiculousness. GA's are slow, Perl is slow. GA's are complicated and esoteric, Perl is esoteric and (in some cases) unmaintainable. Hmm. Can you image the number of bugs that must exist in this code?

    Anyway, I'm all for new tech GA's but implementing in perl seems like a wasted effort.

    -Sean
    • Re:Uhh, but why? (Score:4, Interesting)

      by legLess ( 127550 ) on Wednesday October 02, 2002 @02:40PM (#4375362) Journal
      Perl is slow
      Tell me, Sean, can Perl execute a program faster than you can write it? Of course the answer's yes, and in most cases that's all the speed you need. Perl is often slower than compiled C, but so are many languages. Perl explicitly trades run-time efficiency for write-time efficiency.
      Perl is esoteric...
      Do you even know what esoteric means? Can you give me a definition of it that applies to Perl but not, for instance, C? Very few people on this planet can program, so the activity is by definition esoteric.

      Now, I bet you mean that Perl is idiosyncratic, which is another thing entirely. It certainly is, especially compared with say Python, which is very structured. But here we get back to programmer efficiency. Perl's motto is, "There's more than one way to do it." If you can't handle the complexity, you're free to do it your own way. Even if your own way is using another language. Many Perl programmers swear by the language's flexibility and power; those people who prefer more restricted languages are free to use them.
      ... and (in some cases) unmaintainable
      I hope you realize, in retrospect, what a silly statement that is. Yes, poorly-written Perl is hard to maintain. Reply and give me a list of languages that make shitty code easy to maintain, eh?

      Your comment about bugs is just as silly. Good programmers write good code; poor programmers write poor code and then blame their tools.

      GAs and Perl are a great fit; it's precisely because they're both so alive that they work well together. A highly structured language would make it more difficult to do all sorts of wierd shit that you're not "supposed" to do. GAs are developing faster than the languages we use to describe them. It only makes sense to use the most expressive, idiomatic languages we have to manipulate them.
      • Yes, poorly-written Perl is hard to maintain. Reply and give me a list of languages that make shitty code easy to maintain, eh?

        OT, but that's excactly what languages like COBOL and Java attempt to do, and why they're so popular with business. They enforce a certain minimum structure on every piece of code, they force you to declare (and think about!) types, and they limit the degree to which obfuscation is possible, by restricting certain kinds of features.

        To some extent, these languages do succeed at this goal. I've been called in to take over projects in Perl, C++, Java and other languages. I do think it's more difficult to screw up Java code as much as one can in other languages - which is also why it's the last language I'd pick for a personal project, since it's frustratingly restrictive.

    • You're right, GA is best implemented in machine language. I don't know what I was thinking.

      Thanks!
      Ted
    • Maybe you want to checkout this article before claiming Perl is slow again:

      http://www.perl.com/pub/a/2001/06/27/ctoperl.html [perl.com]>

      Also in the Apache world mod_perl is known to be very fast, even compared to native CGI:s Did you even know that you can save a Perl program to a binary by a certain switch after the interpreter has done its job?

      Perl Rules!

      Starbar!
  • by dgmartin98 ( 576409 ) <slashdotusername&gmail,com> on Wednesday October 02, 2002 @02:17PM (#4375164)
    Here's a great site if you just want to learn a little more about genetic algorithms and how they work. The Java applets on the pages are kinda interesting too.

    http://cs.felk.cvut.cz/~xobitko/ga/ [felk.cvut.cz]


    Dave
  • perl -e'print qw/G A T C/[rand 3] while 1'

    ok, who wants to build this DNA and see what happens?

    *patent pending

  • The editors applied an HTML filter to the Perl source and took out parts of numbers.pl and words.pl. I got several reports of this. I reported the problem to the developerWorks editors a while ago, but I guess it's not fixed yet. So you can find the scripts at

    http://lifelogs.com/source/words.txt
    http://lif elogs.com/source/numbers.txt

    Basically the '' characters were filtered out. Sorry for the inconvenience.

    Ted

"Ninety percent of baseball is half mental." -- Yogi Berra

Working...