org.dbe.eve.ga
Class StopCondition

java.lang.Object
  extended by org.dbe.eve.ga.StopCondition

public class StopCondition
extends java.lang.Object

The StopCondition class try to store the three possible conditions that can be specified by the user to stop the GeneticAlgorithm iterations. Notice that this object only stores values and is the REAL GeneticAlgorithm implementation that need to check this values (each iteration of gap of time) in order to stop the execution. This class will not stop the execution magically.

Author:
bob

Constructor Summary
StopCondition(long maxSeconds, long maxIterations, float minFitness)
          Create a new StopCondition.
 
Method Summary
 float getFitPercentage()
           
 long getIterations()
           
 long getSeconds()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopCondition

public StopCondition(long maxSeconds,
                     long maxIterations,
                     float minFitness)
Create a new StopCondition. It is necessary to specify: - the maximun seconds we want to wait - the maximun iteration we want to wait - the maximun fitness we want to acomplish If one of this conditions doesn't matter or we are too lazy to specify, we can agree that the StopCondition.INDIFERENT value must be used

Method Detail

getFitPercentage

public float getFitPercentage()
Returns:
Returns the fitPercentage.

getIterations

public long getIterations()
Returns:
Returns the iterations.

getSeconds

public long getSeconds()
Returns:
Returns the seconds.