public abstract class UnchangedBase extends NumberIterationsBase
TerminationCondition
that rely on some attribute remaining unchanged for
a certain number of iterations.Constructor and Description |
---|
UnchangedBase() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
assignPrevious(double score,
int size)
Assigns the previous value to be remembered for comparison next time.
|
boolean |
continueFurther(int iteration,
double score,
int size,
MessageLogger logger)
Whether to continue for an additional iteration step or not.
|
void |
initialize()
Called before
TerminationCondition.continueFurther(int, double, int, org.anchoranalysis.core.log.MessageLogger) once to setup state in the bean. |
protected abstract boolean |
isUnchanged(double score,
int size)
Whether the current value is unchanged compared to the previous value.
|
getIterations, setIterations
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public void initialize()
TerminationCondition
TerminationCondition.continueFurther(int, double, int, org.anchoranalysis.core.log.MessageLogger)
once to setup state in the bean.
If called again, it resets the current state.
initialize
in class TerminationCondition
public boolean continueFurther(int iteration, double score, int size, MessageLogger logger)
TerminationCondition
continueFurther
in class TerminationCondition
iteration
- the current iteration of the optimization.score
- the current score associated with the optimizationsize
- the current size associated with the optimization.logger
- a logger to write messages toprotected abstract boolean isUnchanged(double score, int size)
protected abstract void assignPrevious(double score, int size)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.