J. J. Merelo-Guervós > Algorithm-Evolutionary-0.67 > Algorithm::Evolutionary::Op::Mutation

Download:
Algorithm-Evolutionary-0.67.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 2.1   Source   Latest Release: Algorithm-Evolutionary-0.71

NAME ^

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

SYNOPSIS ^

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

  my $xmlStr=<<EOC;
  <op name='Mutation' type='unary' rate='2'>
    <param name='probability' value='0.5' />
  </op>
  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::Mutation (0.5 ); #Create from scratch

Base Class ^

Algorithm::Evolutionary::Op::Base

DESCRIPTION ^

Mutation operator for a GA

METHODS ^

new( [$mutation_rate] [, $operator_probability] )

Creates a new mutation operator with a bitflip application rate, which defaults to 0.5, and an operator application rate (general for all ops), which defaults to 1.

create( [$operator_probability] )

Creates a new mutation operator with an application rate. Rate defaults to 0.5 (which is rather bit, you should not rely on it).

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

apply( $chromosome )

Applies mutation operator to a "Chromosome", a bitstring, really. Can be applied only to victims with the _str instance variable; it checks before application that the operand is of type Algorithm::Evolutionary::Individual::BitString. It returns the victim.

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: 2009/02/04 20:43:14 $ 
  $Header: /cvsroot/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Op/Mutation.pm,v 2.1 2009/02/04 20:43:14 jmerelo Exp $ 
  $Author: jmerelo $ 
  $Revision: 2.1 $
  $Name $