in reply to Re: Brute force perl
in thread Brute force perl

I thought about GAs for a bit. What I'm missing is a good fitness function..

I suppose something like the following psuedocode might produce results:

return ( valid_perl_p($individual) ? length($individual) : 0 );

It looks like I have some work to do :)

Replies are listed 'Best First'.
Re^3: Brute force perl
by jdporter (Paladin) on Jun 12, 2007 at 16:25 UTC
    What I'm missing is a good fitness function.

    eval? Safe?

    A word spoken in Mind will reach its own level, in the objective world, by its own weight
      Right, but from those I'll get ``it works'' or ``it doesn't'', nothing more.

      I'm working on it, though :). AI::Genetic is producing interesting results already..
        from those I'll get "it works" or "it doesn't", nothing more.

        What more do you want? You said you were looking for valid perl. Code is either valid, or it's not. Since you haven't defined what "works" means, a natural assumption is that it means it's valid, i.e. it compiles and runs without error.