GeneralGeneration - Customizable single generation for an evolutionary algorithm.
#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 $replacementRate = 0.3; #Replacement rate my $selector = new RouletteWheel $popSize; #One of the possible selectors my $generation = new GeneralGeneration( $evalFunc, $selector, [$m, $c], $replacementRate );
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
Applies the algorithm to the population, which should have been evaluated first; 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 http://www.fsf.org/licenses/gpl.txt
CVS Info: $Date: 2002/05/29 10:02:11 $ $Header: /cvsroot/opeal/opeal/GeneralGeneration.pm,v 1.4 2002/05/29 10:02:11 jmerelo Exp $ $Author: jmerelo $