GPIndi - Array as an individual for evolutionary computation

SYNOPSIS #Hash with primitives and arity. my $primitives = { sum => 2, multiply => 2, substract => 2, divide => 2, x => 0, y => 0 };

    my $indi = new GPIndi $primitives, 5 ; # Build random tree with knwo primitives
                                           # and depth up to 5
    my $indi5 = $indi->clone(); #Creates a copy of the individual
    print $indi3->asString(); #Prints the individual
    print $indi3->asXML() #Prints it as XML. See L<XML> for more info on this

Base Class



Array individual for a genetic programming. Uses Direct Acyclic graphs as representation for trees, which is very convenient.


Creates a new random array individual, with fixed initial length, and uniform distribution of values within a range


Sets values of an individual; takes a hash as input


Assigns random values to the elements


Similar to a copy ctor; creates a bitstring individual from a string composed of stuff separated by a separator


Similar to a copy ctor: creates a new individual from another one


Prints it


Prints it as XML. See the XML OPEAL manual for details.

Print the list of lists that composes the tree, using prefix notation

Grows a random tree, with primitives as indicated, and a certain depth. Depth defaults to 4


  This file is released under the GPL. See the LICENSE file included in this distribution,
  or go to
  CVS Info: $Date: 2001/12/17 13:36:03 $ 
  $Header: /cvsroot/opeal/opeal/,v 1.3 2001/12/17 13:36:03 jmerelo Exp $ 
  $Author: jmerelo $ 
  $Revision: 1.3 $