Tests for MaximumTimeTerminator

refs #61
This commit is contained in:
halfdan committed 2015-12-23 03:52:18 +01:00
1 parent 469e2033d6
commit 327a95b037
3 files changed
+55 -5

No files matched your search

@@ -29,12 +29,12 @@ public class KnownOptimaFoundTerminator implements InterfaceTerminator, Serializ
}
@Override
public void initialize(InterfaceOptimizationProblem prob) {
public void initialize(InterfaceOptimizationProblem prob) throws IllegalArgumentException {
if (prob != null) {
if (prob instanceof InterfaceMultimodalProblemKnown) {
mProblem = (InterfaceMultimodalProblemKnown) prob;
} else {
LOGGER.log(Level.WARNING, "KnownOptimaFoundTerminator only works with InterfaceMultimodalProblemKnown instances!");
throw new IllegalArgumentException("KnownOptimaFoundTerminator only works with InterfaceMultimodalProblemKnown instances!");
}
} else {
LOGGER.log(Level.WARNING, "KnownOptimaFoundTerminator wont work with null problem!");
@@ -722,9 +722,7 @@ public class Population extends ArrayList<AbstractEAIndividual> implements Popul
this.historyList.add((AbstractEAIndividual) this.getBestEAIndividual().clone());
}
if (isAutoAging()) {
for (AbstractEAIndividual individual : this) {
individual.incrAge();
}
this.forEach(AbstractEAIndividual::incrAge);
}
this.generationCount++;
firePropertyChangedEvent(NEXT_GENERATION_PERFORMED);