NAME

Algorithm::Evolutionary::Op::GenerationalTerm  - Checks for termination of an algorithm.
             

SYNOPSIS

my $gt = new Algorithm::Evolutionary::Op::GenerationalTerm 100; #apply will return false after 100 generations

Base Class

Algorithm::Evolutionary::Op::Base

DESCRIPTION

Checks for termination after a number of generations

METHODS

new( [$number_of_generations] )

Creates a new generational terminator: my $gt = new Algorithm::Evolutionary::Op::GenerationalTerm 100; #apply will return false after 100 generations will make the apply method return false after 100 calls

reset

Resets the number of generations to 0

apply()

Checks if the counter has arrived to the allotted number of generations, returns false when it does. $gt->apply(); will return false when it has been run for the number of times it has been initialized to

See Also

Algorithm::Evolutionary::Op::FullAlgorithm needs an object of this class to check for the termination condition. It's normally used alongside "generation-type" objects such as Algorithm::Evolutionary::Op::Easy

There are other options for termination conditions: Algorithm::Evolutionary::Op::NoChangeTerm and Algorithm::Evolutionary::Op::DeltaTerm.

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/02/16 16:16:40 $ 
$Header: /cvsroot/opeal/Algorithm-Evolutionary/lib/Algorithm/Evolutionary/Op/GenerationalTerm.pm,v 2.3 2009/02/16 16:16:40 jmerelo Exp $ 
$Author: jmerelo $ 
$Revision: 2.3 $
$Name $