|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
andy pondering Re: Re: Re: Re: JAPH-ing Geneticallyby andye (Curate) |
| on May 23, 2001 at 13:46 UTC ( [id://82551]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Problem is, an individual that generates a syntax error might only be one character different to an individual that prints the required string. Or it might be total rubbish.
The first should (for this method to work) be fitter than the second, but I don't know a way to quantify that. Also, p(syntax error) is very high for constructing a valid Perl string randomly. The chances are that all members of a population would generate syntax errors - at which point they'd all have the same fitness. A better approach would be to create a baby language safe (or safer) from syntax errors and eval that. Like maybe just arithmetic operators and numbers. Although - it's just occured to me - you'd be on fairly safe ground with a subset of a highly structured language like Logo. And you could evaluate fitness by checking how similar the figure drawn was to your target figure. Andy.
In Section
Cool Uses for Perl
|
|
||||||||||||||||||||||||||||||||||