org.biojavax.ga
Class GAStoppingCriteria.MaximumGeneration

java.lang.Object
  extended by org.biojavax.ga.GAStoppingCriteria.MaximumGeneration
All Implemented Interfaces:
GAStoppingCriteria
Enclosing interface:
GAStoppingCriteria

public static class GAStoppingCriteria.MaximumGeneration
extends Object
implements GAStoppingCriteria

Simple Implementation of GAStoppingCriteria, signals a GeneticAlgorithm to stop after n generations

Useful for pausing and seeing what the state of the algorithm is at any particular time and possibly changing parameters etc before calling the run() method of the GeneticAlgorithm again.

Version:
1.0
Author:
Mark Schreiber

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojavax.ga.GAStoppingCriteria
GAStoppingCriteria.MaximumGeneration
 
Constructor Summary
GAStoppingCriteria.MaximumGeneration(int maxGenerations)
          Public Constructer
 
Method Summary
 int getMaxGenerations()
           
 boolean stop(GeneticAlgorithm ga)
          Stops the Algorithm if the iterations are >= maxGenerations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GAStoppingCriteria.MaximumGeneration

public GAStoppingCriteria.MaximumGeneration(int maxGenerations)
Public Constructer

Parameters:
maxGenerations - the number of generations to stop after
Method Detail

stop

public boolean stop(GeneticAlgorithm ga)
Stops the Algorithm if the iterations are >= maxGenerations

Specified by:
stop in interface GAStoppingCriteria
Parameters:
ga - the genetic algorithm to assess for stopping
Returns:
true if the ga should stop

getMaxGenerations

public int getMaxGenerations()