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

java.lang.Object
  extended by es.udc.gii.common.eaf.stoptest.SimpleStopTest
      extended by es.udc.gii.common.eaf.stoptest.EvolveGenerationsStopTest
All Implemented Interfaces:
Configurable, StopTest
Direct Known Subclasses:
MicroGenerationsConvergence

public class EvolveGenerationsStopTest
extends SimpleStopTest
implements Configurable

Concrete simple objective. The problem must complete a number of given generations.

 <StopTest>
      <Class>es.udc.gii.common.eaf.stoptest.EvolveGenerationsStopTest</Class>
      <Generations>value</Generations>
 </StopTest>
 
 

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

Field Summary
private  int generations
          Number of generations that a problem has to reach.
 
Constructor Summary
EvolveGenerationsStopTest()
          Creates a new instance of EvolveGenerationsStopTest
EvolveGenerationsStopTest(int generations)
          Create a new instance of EvoleGenerationsObjective.
 
Method Summary
 void configure(org.apache.commons.configuration.Configuration conf)
          Configure this stop test.
 int getGenerations()
          Returns the number of generations that the algorithm will run.
 boolean isReach(EvolutionaryAlgorithm algorithm)
          Returns true if the problem had done the generation's number determined by this concrete objective.
 void setGenerations(int generations)
          Set the value of the number of generations that the algorithm will run.
 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

generations

private int generations
Number of generations that a problem has to reach.

Constructor Detail

EvolveGenerationsStopTest

public EvolveGenerationsStopTest()
Creates a new instance of EvolveGenerationsStopTest


EvolveGenerationsStopTest

public EvolveGenerationsStopTest(int generations)
Create a new instance of EvoleGenerationsObjective.

Parameters:
generations - Generations' number that a concrete problem has to reach.
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.
See Also:
Configuration

isReach

public boolean isReach(EvolutionaryAlgorithm algorithm)
Returns true if the problem had done the generation's number determined by this concrete objective.

Specified by:
isReach in interface StopTest
Parameters:
algorithm - the algorithm wich has to reach the objective
Returns:
true if the problem do a number of generations, false in other case.

getGenerations

public int getGenerations()
Returns the number of generations that the algorithm will run.

Returns:
number of generations.

setGenerations

public void setGenerations(int generations)
Set the value of the number of generations that the algorithm will run.

Parameters:
generations - new number of generations.

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.