Algorithm::Evolutionary::Op::GenerationalTerm - Checks for termination of an algorithm.
my $gt = new Algorithm::Evolutionary::Op::GenerationalTerm 100; #apply will return false after 100 generations
Algorithm::Evolutionary::Op::Base
Checks for termination after a number of generations
Creates a new generational terminator:
will make the apply method return false after 100 calls
apply
Resets the number of generations to 0
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
false
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, Algorithm::Evolutionary::Op::Convergence_Terminator and Algorithm::Evolutionary::Op::DeltaTerm.
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/GenerationalTerm.pm,v 3.0 2009/07/24 08:46:59 jmerelo Exp $ $Author: jmerelo $ $Revision: 3.0 $ $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.