public class SimpleUnivariateValueChecker extends AbstractConvergenceChecker<UnivariatePointValuePair>
ConvergenceChecker interface
that uses only objective function values.
Convergence is considered to have been reached if either the relative
difference between the objective function values is smaller than a
threshold or if either the absolute difference between the objective
function values is smaller than another threshold.
converged method will also return true if the number of iterations
has been set (see this constructor).| Constructor and Description |
|---|
SimpleUnivariateValueChecker(double relativeThreshold,
double absoluteThreshold)
Build an instance with specified thresholds.
|
SimpleUnivariateValueChecker(double relativeThreshold,
double absoluteThreshold,
int maxIter)
Builds an instance with specified thresholds.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
converged(int iteration,
UnivariatePointValuePair previous,
UnivariatePointValuePair current)
Check if the optimization algorithm has converged considering the
last two points.
|
getAbsoluteThreshold, getRelativeThresholdpublic SimpleUnivariateValueChecker(double relativeThreshold, double absoluteThreshold)
relativeThreshold - relative tolerance thresholdabsoluteThreshold - absolute tolerance thresholdpublic SimpleUnivariateValueChecker(double relativeThreshold, double absoluteThreshold, int maxIter)
relativeThreshold - relative tolerance thresholdabsoluteThreshold - absolute tolerance thresholdmaxIter - Maximum iteration count.NotStrictlyPositiveException - if maxIter <= 0.public boolean converged(int iteration, UnivariatePointValuePair previous, UnivariatePointValuePair current)
converged in interface ConvergenceChecker<UnivariatePointValuePair>converged in class AbstractConvergenceChecker<UnivariatePointValuePair>iteration - Index of current iterationprevious - Best point in the previous iteration.current - Best point in the current iteration.true if the algorithm has converged.Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.