The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

  Algorithm::Evolutionary::Op::Permutation - BitFlip mutation, changes several bits in a bitstring, depending on the probability

SYNOPSIS

  use Algorithm::Evolutionary::Op::Mutation;

  my $xmlStr=<<EOC;
  <op name='Permutation' type='unary' rate='2' />
  EOC
  my $ref = XMLin($xmlStr);

  my $op = Algorithm::Evolutionary::Op::->fromXML( $ref );
  print $op->asXML(), "\n*Arity ->", $op->arity(), "\n";

  my $op = new Algorithm::Evolutionary::Op::Permutation ; #Create from scratch
  my $bitChrom =  new Algorithm::Evolutionary::Individual::BitString 10;
  $op->apply( $bitChrom );

Base Class

Algorithm::Evolutionary::Op::Base

DESCRIPTION

Class independent permutation operator; any individual that has the _str instance variable (like Algorithm::Evolutionary::Individual::String and Algorithm::Evolutionary::Individual::BitString) of its elements swapped.

METHODS

new

Creates a new permutation operator; see Algorithm::Evolutionary::Op::Base for details.

create

Creates a new mutation operator with an application rate. Rate defaults to 0.5.

Called create to distinguish from the classwide ctor, new. It just makes simpler to create a Mutation Operator

apply

Applies mutation operator to a "Chromosome" that includes the _str instance variable, swapping positions for two of its components.

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: 2002/11/17 17:08:10 $ 
  $Header: /cvsroot/opeal/opeal/Algorithm/Evolutionary/Op/Permutation.pm,v 1.3 2002/11/17 17:08:10 jmerelo Exp $ 
  $Author: jmerelo $ 
  $Revision: 1.3 $
  $Name $