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
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
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: 2001/11/30 17:05:16 $ $Header: /cvsroot/opeal/opeal/Mutation.pm,v 1.5 2001/11/30 17:05:16 jmerelo Exp $ $Author: jmerelo $ $Revision: 1.5 $