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

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

public class CompositeStopTest
extends java.lang.Object
implements StopTest

This class implements the interface StopTest. A CompositeStopTest consists of a SimpleStopTest list. To reach this objective an algorithm must reach at least one of these objectives.

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

Field Summary
private  java.util.List<StopTest> stopTests
          Condicitions' list of a composite stop test.
 
Constructor Summary
CompositeStopTest()
          Creates a new instance of CompositeStopTest
 
Method Summary
 void addStopTest(StopTest stopTest)
          Add a stop test to the list of a composite stop test.
 void configure(org.apache.commons.configuration.Configuration conf)
          Configure this stop test.
 java.util.List<StopTest> getStopTests()
          Return the list of stop test that contains this Composite stop test.
 boolean isReach(EvolutionaryAlgorithm algorithm)
          Test if an algorithm reach the condition represented by this stop test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stopTests

private java.util.List<StopTest> stopTests
Condicitions' list of a composite stop test.

Constructor Detail

CompositeStopTest

public CompositeStopTest()
Creates a new instance of CompositeStopTest

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.

getStopTests

public java.util.List<StopTest> getStopTests()
Return the list of stop test that contains this Composite stop test.

Returns:
a list of stop test.

addStopTest

public void addStopTest(StopTest stopTest)
Add a stop test to the list of a composite stop test.

Parameters:
stopTest - A stop test to be added to the stop tests' list.

isReach

public boolean isReach(EvolutionaryAlgorithm algorithm)
Test if an algorithm reach the condition represented by this stop test. This class represents a concrete stop test, so to reach the represented objective the algorithm has to reach almost one of the stop tests.

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