Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

RE: Genetic Programming or breeding Perls

by Nooks (Monk)
on Sep 06, 2000 at 03:32 UTC ( [id://31185]=note: print w/replies, xml ) Need Help??


in reply to Genetic Programming or breeding Perls

Well done! I tried to do this several months ago and failed because I didn't hit on the idea of using a sequence of individual statements. (I tried to define a small language I could eval and had trouble making it both expressive and easy to evaluate.)

I notice you left out division---presumably you don't want to have to deal with errors from the eval statement?

  • Comment on RE: Genetic Programming or breeding Perls

Replies are listed 'Best First'.
RE: RE: Genetic Programming or breeding Perls
by gumpu (Friar) on Sep 06, 2000 at 13:12 UTC

    I notice you left out division---presumably you don't want to have to deal with errors from the eval statement?

    Yup that was one of the reasons. It would have made the program longer that it already is.

    Programs with errors in them are not a problem as long as they have different fitness values. For instance as long as program with one error in it has a higher fitness as a program with two errors in it. If all programs that do not evaluate correctly, result in the same fitness value there is no way for the algorithm to gradually move to a better solution.

    GP works only if there are intermediate solutions.

    Have Fun

RE: RE: Genetic Programming or breeding Perls
by BlaisePascal (Monk) on Sep 06, 2000 at 03:50 UTC
    He also left out multiplication and subtraction. Presumably it was to minimize the operators used. I was a bit surprised at "|=" myself.

      Presumably it was to minimize the operators used.

      Yup. It thought it would make it easier to understand the problem (the programming challenge). It is also to limit the number of possible solutions. If there are many building blocks the search space is large but also full of good solutions. Then even a random search works. With this I hoped to demonstrate that even with limited building blocks the algorithm can work to a good solution. (It would be interesting to create a Perl program that can determine the solution density, say using monte carlo or so).

      I was a bit surprised at

      |=

      myself.

      :) I added that to show that the algorithm can come up with solutions that are not easily visable to humans. You can even add things like

      $x ^= 715; $x >>= 1;

      and it will come up with surprising results.

      Have Fun

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://31185]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-16 17:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found