NAME

Algorithm::Evolutionary::Op::Quad_Crossover_Diff - Uniform crossover, but interchanges only those atoms that are different

SYNOPSIS

my $xmlStr3=<<EOC;
<op name='Quad_Crossover_Diff' type='binary' rate='1'>
  <param name='numPoints' value='2' /> #Max is 2, anyways
</op>
EOC
my $ref3 = XMLin($xmlStr3);

my $op3 = Algorithm::Evolutionary::Op::Base->fromXML( $ref3 );
print $op3->asXML(), "\n";

my $indi = new Algorithm::Evolutionary::Individual::BitString 10;
my $indi2 = $indi->clone();
my $indi3 = $indi->clone(); #Operands are modified, so better to clone them
$op3->apply( $indi2, $indi3 );

my $op4 = new Algorithm::Evolutionary::Op::Quad_Crossover_Diff 1; #Quad_Crossover_Diff with 1 crossover points

Base Class

Algorithm::Evolutionary::Op::Base

DESCRIPTION

Crossover operator for a GA, takes args by reference and issues two children from two parents

METHODS

new( [$options_hash] [, $operation_priority] )

Creates a new n-point crossover operator, with 2 as the default number of points, that is, the default would be my $options_hash = { crossover_rate => 0.5 }; my $priority = 1;

apply( $parent_1, $parent_2 )

Same as Algorithm::Evolutionary::Op::Crossover, but changes parents, does not return anything; that is, $parent_1 and $parent_2 interchange genetic material.

Copyright

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: 2011/02/13 11:02:11 $ 
$Header: /cvsroot/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Op/Uniform_Crossover_Diff.pm,v 3.3 2011/02/13 11:02:11 jmerelo Exp $ 
$Author: jmerelo $ 
$Revision: 3.3 $
$Name $