EasyAlgorithm - evolutionary algorithm, single generation, with 
                    variable operators.


  my $easyEA = OpBase->fromXML( $ref->{initial}{section}{pop}{op} );
  # Parsed XML fragment, see samples
  for ( my $i = 0; $i < $ref->{initial}{section}{pop}{op}{param}{maxgen}{value}; $i++ ) {
    print "<", "="x 20, "Generation $i", "="x 20, ">\n"; 
    $easyEA->apply(\@pop ); 
    for ( @pop ) { 
      print $_->asString, "\n"; 
  #Define a default algorithm with predefined evaluation function,
  #Mutation and crossover. Default selection rate ls 4
  my $algo = new EasyAlgorithm( $eval );
  #Define an easy single-generation algorithm with predefined mutation and crossover
  my $m = new MutationOne; #Changes a single bit
  my $c = new Crossover; #Classical 2-point crossover
  my $generation = new EasyAlgorithm( $rr, 0.2, [$m, $c] );

Base Class



Genetic algorithm that uses the other component. Must take as input the operators thar are going to be used, along with its priorities


Creates an algorithm, with the usual operators. Includes a default mutation and crossover, in case they are not passed as parameters


Sets the instance variables. Takes a ref-to-hash as input


Applies the algorithm to the population; checks that it receives a ref-to-array as input, croaks if it does not. Returns a sorted, culled, evaluated population for next generation.


  This file is released under the GPL. See the LICENSE file included in this distribution,
  or go to
  CVS Info: $Date: 2001/11/29 16:57:26 $ 
  $Header: /cvsroot/opeal/opeal/,v 1.9 2001/11/29 16:57:26 jmerelo Exp $ 
  $Author: jmerelo $