Algorithm::Evolutionary::Op::CX (Cycle crossover) - 2-point crossover operator; Builds offspreing in such a way that each gene comes from one of the parents. Preserves the absolute position of the elements in the parent sequence
my $xmlStr3=<<EOC; <op name='CX' type='binary' rate='1' /> EOC my $ref3 = XMLin($xmlStr3);
my $op3 = Algorithm::Evolutionary::Op::Base->fromXML( $ref3 ); print $op3->asXML(), "\n";
my $op4 = new Algorithm::Evolutionary::Op::CX 3;
my $indi = new Algorithm::Evolutionary::Individual::Vector 10; my $indi2 = $indi->clone(); my $indi3 = $indi->clone(); $op3->apply( $indi2, $indi3 );
Cycle Crossover operator for a GA. It applies to chromosomes that are a permutation of each other; even as the class it applies to is the Algorithm::Evolutionary::Individual::Vector manpage, it will issue lots of ``La jodimos!'' messages if the parents do not fulfill this condition.
Some information on this operator can be obtained from http://www.cs.bham.ac.uk/~rmp/slide_book/node4.html#SECTION00444300000000000000|this evolutionary computation tutorial
Creates a new Algorithm::Evolutionary::Op::CX operator.
Creates a new Algorithm::Evolutionary::Op::CX operator. But this is just to have a non-empty chromosome
Applies Algorithm::Evolutionary::Op::CX operator to a ``Chromosome'', a bitstring, really. Can be
applied only to victims with the
_bitstring instance variable; but
it checks before application that both operands are of type
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/06/18 12:24:00 $ $Header: /cvsroot/opeal/opeal/Algorithm/Evolutionary/Op/CX.pm,v 1.2 2002/06/18 12:24:00 jmerelo Exp $ $Author: jmerelo $ $Revision: 1.2 $ $Name $