Mutation - BitFlip mutation, changes several bits, depending on the probability
my $xmlStr=<<EOC; <op name='Mutation' type='unary' rate='2'> <param name='probability' value='0.5' /> </op> EOC my $ref = XMLin($xmlStr);
my $op = OpBase->fromXML( $ref ); print $op->asXML(), "\n*Arity ->", $op->arity(), "\n";
my $op = new Mutation (0.5 ); #Create from scratch
Mutation operator for a GA
Creates a new mutation operator with an application rate. Rate defaults to 0.1.
Called create to distinguish from the classwide ctor, new. It just makes simpler to create a Mutation Operator
Sets the instance variables. Takes a ref-to-hash as input
Applies mutation operator to a ``Chromosome'', a bitstring, really. Can be
applied only to victims with the _str
instance variable; but
it checks before application that both operands are of type
BinaryIndi.
Prints as XML, following the EvoSpec 0.2 XML specification. Should be called from derived classes, not by itself.
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/04/30 18:32:06 $ $Header: /cvsroot/opeal/opeal/Mutation.pm,v 1.7 2002/04/30 18:32:06 jgcastellano Exp $ $Author: jgcastellano $ $Revision: 1.7 $