From 2a8c8dd0dd9753230fae389db815647d72df6a59 Mon Sep 17 00:00:00 2001 From: Marcel Kronfeld Date: Mon, 29 Nov 2010 14:28:13 +0000 Subject: [PATCH] Merging mk branch rev. 675 (bugfix) --- resources/MatlabInterface/@JEInterface/optimize.m | 2 +- .../operators/terminators/HistoryConvergenceTerminator.java | 4 +++- .../go/operators/terminators/PopulationMeasureTerminator.java | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/resources/MatlabInterface/@JEInterface/optimize.m b/resources/MatlabInterface/@JEInterface/optimize.m index fce24ef1..1346c4a8 100644 --- a/resources/MatlabInterface/@JEInterface/optimize.m +++ b/resources/MatlabInterface/@JEInterface/optimize.m @@ -54,7 +54,7 @@ if ((nargin == 2) || (nargin == 3)) else if (xTol > 0) % only phenotye convergence convTerm = MatlabProblem.makePhenConvTerm(xTol, int.opts.TolXEvals); else if (fTol > 0 ) % only fitness covnergence - convTerm = MatlabProbelm.makeFitConvTerm(fTol, int.opts.TolFunEvals); + convTerm = MatlabProblem.makeFitConvTerm(fTol, int.opts.TolFunEvals); else convTerm = 'undef'; % signal that there is no terminator yet end diff --git a/src/eva2/server/go/operators/terminators/HistoryConvergenceTerminator.java b/src/eva2/server/go/operators/terminators/HistoryConvergenceTerminator.java index eab83299..3f4af124 100644 --- a/src/eva2/server/go/operators/terminators/HistoryConvergenceTerminator.java +++ b/src/eva2/server/go/operators/terminators/HistoryConvergenceTerminator.java @@ -58,6 +58,8 @@ public class HistoryConvergenceTerminator implements InterfaceTerminator, Serial } } else { // look at improvements AbstractEAIndividual historicHWAgo = subHist.get(0); +// System.out.println("Ref indy: " + historicHWAgo); +// System.out.println("Best historic: " + ((Population)pop).getBestHistoric()); res = true; for (int i = 1; i < haltingWindowLen; i++) { // if historic[-hW] is worse than historic[-hW+i] return false @@ -79,7 +81,7 @@ public class HistoryConvergenceTerminator implements InterfaceTerminator, Serial return res; } - /** + /** * Define the criterion by which individual improvement is judged. The original version defined * improvement strictly, but for some EA this should be done more laxly. E.g. DE will hardly ever * stop improving slightly, so optionally use an epsilon-bound: improvement only counts if it is diff --git a/src/eva2/server/go/operators/terminators/PopulationMeasureTerminator.java b/src/eva2/server/go/operators/terminators/PopulationMeasureTerminator.java index 48a29278..852d0724 100644 --- a/src/eva2/server/go/operators/terminators/PopulationMeasureTerminator.java +++ b/src/eva2/server/go/operators/terminators/PopulationMeasureTerminator.java @@ -211,7 +211,7 @@ Serializable { */ protected boolean isStillConverged(PopulationInterface pop) { double measure = calcPopulationMeasure(pop); - double allowedLower=Double.MIN_VALUE, allowedUpper=Double.MAX_VALUE; + double allowedLower=Double.NEGATIVE_INFINITY, allowedUpper=Double.POSITIVE_INFINITY; boolean ret; switch (changeType) { case absoluteChange: @@ -219,7 +219,7 @@ Serializable { if (!doCheckImprovement()) allowedUpper=oldMeasure+convThresh; break; case absoluteValue: - allowedLower=convThresh; + allowedUpper=convThresh; // if (!doCheckImprovement()) allowedUpper = convThreshUpper; break; case relativeChange: