|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.udc.gii.common.eaf.stoptest.SimpleStopTest
es.udc.gii.common.eaf.stoptest.BitwiseConvergence
public class BitwiseConvergence
This class implements a simple stoptest. The objective is reached when the current population of the passed evolutionary algorithm has converged to a specified rate. The convergence is messured as the average number of bits that each two individuals from the population share.
The convergence rate is specified as a configuration parameter. A convergence rate of 1.0 means that all individuals in the population have the same genotype. A convergence rate of 0.x means that, in average, each two individuals from the population share their genotypes at x %.
Convergence rates between 0.6 and 0.9 have yield good results for populations of 5 individuals. This class is only suitable for individuals with the same number of genes and for internal values of type 'double'.
This class uses an algorithm with a computational cost of O(n**2), beeing n the number of individuals of the population of the passed evolutionary algorithm. So, consider using other approaches for calculating the population's convergence (such as a fixed number of generations) if you plan to use an algorithm with a big population. 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.BitwiseConvergence</Class>
<ConvergenceRate>value</ConvergenceRate>
</StopTest>
Field Summary | |
---|---|
private double |
convergenceRate
|
Constructor Summary | |
---|---|
BitwiseConvergence()
Creates a new instance of BitwiseConvergence |
Method Summary | |
---|---|
void |
configure(org.apache.commons.configuration.Configuration conf)
Configure this stop test. |
private double |
convergence(Individual i1,
Individual i2)
Calculates the convergence rate between two individuals. |
boolean |
isReach(EvolutionaryAlgorithm algorithm)
Returns true if the problem reach the objective. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double convergenceRate
Constructor Detail |
---|
public BitwiseConvergence()
Method Detail |
---|
private double convergence(Individual i1, Individual i2)
public boolean isReach(EvolutionaryAlgorithm algorithm)
StopTest
algorithm
- The algorithm wich has to reach the objective
public void configure(org.apache.commons.configuration.Configuration conf)
conf
- Configuration object which contains the configuration values.Configuration
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |