Fixed problem in RankMuCMA mutator with large ranges

This commit is contained in:
Marcel Kronfeld 2008-09-04 11:15:08 +00:00
parent a9a8559e69
commit 29c655f874
2 changed files with 9 additions and 3 deletions

View File

@ -82,7 +82,9 @@ public class MutateESRankMuCMA implements InterfaceMutationGenerational, Seriali
*/
private double getInitSigma(Population initGen) {
switch (initialSig) {
case avgInitialDistance: return initGen.getPopulationMeasures()[0];
case avgInitialDistance:
// scaled by average range as the measures are normed
return initGen.getPopulationMeasures()[0]*getAvgRange();
case halfRange: return getAvgRange()/2.;
default: return 0.2;
}
@ -181,8 +183,11 @@ public class MutateESRankMuCMA implements InterfaceMutationGenerational, Seriali
if (TRACE_2) System.out.println("Aft: C is \n" + mC.toString());
/* update of sigma */
sigma *= Math.exp(((psNorm / expRandStepLen) - 1) * getCs()
double sigFact = Math.exp(((psNorm / expRandStepLen) - 1) * getCs()
/ getDamps());
if (Double.isInfinite(sigFact)) sigma *= 10.; // in larger search spaces sigma tends to explode after init.
else sigma *= sigFact;
if (Double.isInfinite(sigma) || Double.isNaN(sigma)) {
System.err.println("Error, unstable sigma!");
}

View File

@ -873,7 +873,8 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
/**
* Returns the average, minimal and maximal phenotypic individual distance as diversity measure for the population.
*
* Distances are thus scaled by the problem range.
*
* @return the average, minimal and maximal mean distance of individuals in an array of three
*/
public double[] getPopulationMeasures() {