View on
MetaCPAN
J. J. Merelo-Guervós > Algorithm-Evolutionary-0.79_1 > Algorithm::Evolutionary::Op::CX

Download:
Algorithm-Evolutionary-0.79_1.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 3.2   Source   Latest Release: Algorithm-Evolutionary-0.80

NAME ^

Algorithm::Evolutionary::Op::CX (Cycle crossover) - 2-point crossover operator; Builds offspring in such a way that each gene comes from one of the parents. Preserves the absolute position of the elements in the parent sequence

SYNOPSIS ^

  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 );

Base Class ^

Algorithm::Evolutionary::Op::Base

DESCRIPTION ^

Cycle Crossover operator for a GA. It is applied to chromosomes that are a permutation of each other; even as the class it applies to is Algorithm::Evolutionary::Individual::Vector, 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 this evolutionary computation tutorial

METHODS ^

new

Creates a new Algorithm::Evolutionary::Op::CX operator.

create

Creates a new Algorithm::Evolutionary::Op::CX operator. But this is just to have a non-empty chromosome

apply

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 Individual::Vector.

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
syntax highlighting: