Fixed problem in RankMuCMA mutator with large ranges
This commit is contained in:
parent
a9a8559e69
commit
29c655f874
@ -82,7 +82,9 @@ public class MutateESRankMuCMA implements InterfaceMutationGenerational, Seriali
|
|||||||
*/
|
*/
|
||||||
private double getInitSigma(Population initGen) {
|
private double getInitSigma(Population initGen) {
|
||||||
switch (initialSig) {
|
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.;
|
case halfRange: return getAvgRange()/2.;
|
||||||
default: return 0.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());
|
if (TRACE_2) System.out.println("Aft: C is \n" + mC.toString());
|
||||||
|
|
||||||
/* update of sigma */
|
/* update of sigma */
|
||||||
sigma *= Math.exp(((psNorm / expRandStepLen) - 1) * getCs()
|
double sigFact = Math.exp(((psNorm / expRandStepLen) - 1) * getCs()
|
||||||
/ getDamps());
|
/ 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)) {
|
if (Double.isInfinite(sigma) || Double.isNaN(sigma)) {
|
||||||
System.err.println("Error, unstable sigma!");
|
System.err.println("Error, unstable sigma!");
|
||||||
}
|
}
|
||||||
|
@ -873,6 +873,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the average, minimal and maximal phenotypic individual distance as diversity measure for the population.
|
* 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
|
* @return the average, minimal and maximal mean distance of individuals in an array of three
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user