Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.terminate
Class RunningAverageScoreCondition

java.lang.Object
  extended byorg.evolvica.core.terminate.ScoreComparingCondition
      extended byorg.evolvica.core.terminate.RunningAverageScoreCondition
All Implemented Interfaces:
ICondition

public class RunningAverageScoreCondition
extends ScoreComparingCondition

Termination dependent on the running average score. The termination condition is fulfilled, if current average score - average value of the scores of last n generations falls under a particular threshold.

Since:
0.4.0
Version:
$Revision: 1.6 $ $Date: 2004/05/26 11:58:20 $
Author:
Andreas Rummler

Field Summary
protected  int nextIndex
          Next index.
protected  double[] stack
          Stack.
protected  boolean stackFull
          Indicator if the stack is full.
protected  double threshold
          Threshold.
 
Fields inherited from class org.evolvica.core.terminate.ScoreComparingCondition
comparator
 
Constructor Summary
RunningAverageScoreCondition()
          Constructor.
RunningAverageScoreCondition(double threshold, int generations, IScoreComparator comparator)
          Constructor.
 
Method Summary
 int getGenerations()
          Returns the number of generations.
 double getThreshold()
          Returns the threshold.
 boolean isTrue(IIndividualSet iset)
          Checks if this condition is true for the given individual set.
 void setGenerations(int i)
          Sets the number of generations.
 void setThreshold(double d)
          Sets the threshold.
 
Methods inherited from class org.evolvica.core.terminate.ScoreComparingCondition
getComparator, setComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

threshold

protected double threshold
Threshold.


stack

protected double[] stack
Stack.


nextIndex

protected int nextIndex
Next index.


stackFull

protected boolean stackFull
Indicator if the stack is full.

Constructor Detail

RunningAverageScoreCondition

public RunningAverageScoreCondition()
Constructor.


RunningAverageScoreCondition

public RunningAverageScoreCondition(double threshold,
                                    int generations,
                                    IScoreComparator comparator)
Constructor.

Parameters:
threshold - threshold
generations - number of generations
comparator - score comparator
Method Detail

isTrue

public boolean isTrue(IIndividualSet iset)
Description copied from interface: ICondition
Checks if this condition is true for the given individual set.

Parameters:
iset - individual set to check for the truth of the condition
Returns:
true if the condition is fulfilled, false otherwise
See Also:
ICondition.isTrue(org.evolvica.core.IIndividualSet)

getGenerations

public int getGenerations()
Returns the number of generations.

Returns:
number of generations

getThreshold

public double getThreshold()
Returns the threshold.

Returns:
threshold

setGenerations

public void setGenerations(int i)
Sets the number of generations.

Parameters:
i - number of generations

setThreshold

public void setThreshold(double d)
Sets the threshold.

Parameters:
d - threshold

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems