
Algorithm::Evolutionary::Op::Permutation - Per-mutation. Got it?

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.

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: 2009/07/28 11:30:56 $ $Header: /cvsroot/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Op/Permutation.pm,v 3.1 2009/07/28 11:30:56 jmerelo Exp $ $Author: jmerelo $ $Revision: 3.1 $