GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ALGORITHM::EVOLUTIONARY::OP::FULLALGORITHM (3)

.ds Aq ’

NAME

Algorithm::Evolutionary::Op::FullAlgorithm - Skeleton class for a fully-featured evolutionary algorithm

CONTENTS

SYNOPSIS



  use Algorithm::Evolutionary qw( Op::Base Op::Bitflip Op::Crossover
                                  Op::RouletteWheel Op::GeneralGeneration
                                  Op::GenerationalTerm Op::FullAlgorithm );

  # Using the base class as factory
  my $easyEA = Algorithm::Evolutionary::Op::Base->fromXML( $ref->{$xml} );
  $easyEA->apply(\@pop );

  #Or using the constructor
  my $m = new Algorithm::Evolutionary::Op::Bitflip; #Changes a single bit
  my $c = new Algorithm::Evolutionary::Op::Crossover; #Classical 2-point crossover
  my $replacementRate = 0.3; #Replacement rate
  my $popSize = 20;
  my $selector = new Algorithm::Evolutionary::Op::RouletteWheel $popSize; #One of the possible selectors
  my $onemax = sub {
    my $indi = shift;
    my $total = 0;
    my $len = $indi->length();
    my $i = 0;
    while ($i < $len ) {
      $total += substr($indi->{_str}, $i, 1);
      $i++;
    }
    return $total;
  };
  my $generation =
    new Algorithm::Evolutionary::Op::GeneralGeneration( $onemax, $selector, [$m, $c], $replacementRate );
  my $g100 = new Algorithm::Evolutionary::Op::GenerationalTerm 10;
  my $f = new Algorithm::Evolutionary::Op::FullAlgorithm $generation, $g100;
  print $f->asXML();

  $f->apply( $pop ); # Pop should be defined else where



Base Class

Algorithm::Evolutionary::Op::Base

DESCRIPTION

Class for a configurable evolutionary algoritm. It takes a single-generarion object, and mixes it with a termination condition to create a full algorithm. Includes a sensible default (100-generation generational algorithm) if it is issued only an object of class Algorithm::Evolutionary::Op::GeneralGeneration.

new( CW$single_generation[, CW$termination_test] [, CW$verboseness] )

Takes an already created algorithm and a terminator, and creates an object

set( CW$hashref, CW$codehash, CW$opshash )

Sets the instance variables. Takes hashes to the different options of
the algorithm: parameters, fitness functions and operators

apply( CW$reference_to_population_array )

Applies the algorithm to the population; checks that it receives a ref-to-array as input, croaks if it does not. Returns a sorted, culled, evaluated population for next generation.

SEE ALSO

More or less in the same ballpark, alternatives to this one
o Algorithm::Evolutionary::Op::CanonicalGA.
o Algorithm::Evolutionary::Op::Easy.
Classes you can use within FullAlgorithm:
o Algorithm::Evolutionary::Op::Convergence_Terminator
o Algorithm::Evolutionary::Op::GenerationalTerm
o Algorithm::Evolutionary::Op::Generation_Skeleton

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/07/24 08:46:59 $
  $Header: /media/Backup/Repos/opeal/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Op/FullAlgorithm.pm,v 3.0 2009/07/24 08:46:59 jmerelo Exp $
  $Author: jmerelo $



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ALGORITHM::EVOLUTIONARY::OP::FULLALGORITHM (3) 2014-10-25

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.