es.udc.gii.common.eaf.stoptest
Class PerformanceFitnessStopTest

java.lang.Object
  extended by es.udc.gii.common.eaf.stoptest.SimpleStopTest
      extended by es.udc.gii.common.eaf.stoptest.PerformanceFitnessStopTest
All Implemented Interfaces:
Configurable, StopTest

public class PerformanceFitnessStopTest
extends SimpleStopTest
implements Configurable

This class implements the abstract class SimpleStopTest. To reach the implemented objective in this class the fitness value of the best population individual must reach a value specified on the configuration file. To use and configure this stop test, you must add the following xml code in the appropriate section of the configuration file:

 <StopTest>
      <Class>es.udc.gii.common.eaf.stoptest.PerformanceFitnessStopTest</Class>
      <Goal>value</Goal>
 </StopTest>
 
 

Author:
Grupo Integrado de IngenierĂ­a (www.gii.udc.es)

Field Summary
private  double goal
          This attribute represents the desired fitness value that has to reach an algorithm to finish its execution.
 
Constructor Summary
PerformanceFitnessStopTest()
          Creates a new instance of PerformanceFitnessStopTest
PerformanceFitnessStopTest(double goal)
          Creates a new instance of PerformanceFitnessStopTest
 
Method Summary
 void configure(org.apache.commons.configuration.Configuration conf)
          Configure this stop test.
 boolean isReach(EvolutionaryAlgorithm algorithm)
          Implements the method isReach.
 java.lang.String toString()
          Returns a String representing this objective.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

goal

private double goal
This attribute represents the desired fitness value that has to reach an algorithm to finish its execution.

Constructor Detail

PerformanceFitnessStopTest

public PerformanceFitnessStopTest()
Creates a new instance of PerformanceFitnessStopTest


PerformanceFitnessStopTest

public PerformanceFitnessStopTest(double goal)
Creates a new instance of PerformanceFitnessStopTest

Parameters:
goal - Represents the fitness value that has to reach an algorithm to finish its execution.
Method Detail

configure

public void configure(org.apache.commons.configuration.Configuration conf)
Configure this stop test.

Specified by:
configure in interface Configurable
Parameters:
conf - Configuration object which contains the configuration values.

isReach

public boolean isReach(EvolutionaryAlgorithm algorithm)
Implements the method isReach. Test if the best individual of the current algorithm reach a fitness value that is specified on the configuration file.

Specified by:
isReach in interface StopTest
Parameters:
algorithm - The algorithm wich has to reach the objective
Returns:
true if the algorithm reach the desired fitness value, false in other case.

toString

public java.lang.String toString()
Returns a String representing this objective.

Overrides:
toString in class java.lang.Object
Returns:
a string representing this objective.