Algorithm::Evolutionary::Op::Permutation - BitFlip mutation, changes several bits in a bitstring, depending on the probability
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 );
Algorithm::Evolutionary::Op::Base
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.
_str
Creates a new permutation operator; see Algorithm::Evolutionary::Op::Base for details.
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
Applies mutation operator to a "Chromosome" that includes the _str instance variable, swapping positions for two of its components.
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 $
To install Algorithm::Evolutionary, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::Evolutionary
CPAN shell
perl -MCPAN -e shell install Algorithm::Evolutionary
For more information on module installation, please visit the detailed CPAN module installation guide.