Package org.hipparchus.optim
Class AbstractOptimizationProblem<P>
- java.lang.Object
-
- org.hipparchus.optim.AbstractOptimizationProblem<P>
-
- Type Parameters:
P- Type of the point/value pair returned by the optimization algorithm.
- All Implemented Interfaces:
OptimizationProblem<P>
public abstract class AbstractOptimizationProblem<P> extends Object implements OptimizationProblem<P>
Base class for implementing optimization problems. It contains the boiler-plate code for counting the number of evaluations of the objective function and the number of iterations of the algorithm, and storing the convergence checker.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOptimizationProblem(int maxEvaluations, int maxIterations, ConvergenceChecker<P> checker)Create anAbstractOptimizationProblemfrom the given data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConvergenceChecker<P>getConvergenceChecker()Gets the convergence checker.IncrementorgetEvaluationCounter()Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception.IncrementorgetIterationCounter()Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception.
-
-
-
Constructor Detail
-
AbstractOptimizationProblem
protected AbstractOptimizationProblem(int maxEvaluations, int maxIterations, ConvergenceChecker<P> checker)Create anAbstractOptimizationProblemfrom the given data.- Parameters:
maxEvaluations- the number of allowed model function evaluations.maxIterations- the number of allowed iterations.checker- the convergence checker.
-
-
Method Detail
-
getEvaluationCounter
public Incrementor getEvaluationCounter()
Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception.- Specified by:
getEvaluationCounterin interfaceOptimizationProblem<P>- Returns:
- a counter for the evaluations.
-
getIterationCounter
public Incrementor getIterationCounter()
Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception.- Specified by:
getIterationCounterin interfaceOptimizationProblem<P>- Returns:
- a counter for the evaluations.
-
getConvergenceChecker
public ConvergenceChecker<P> getConvergenceChecker()
Gets the convergence checker.- Specified by:
getConvergenceCheckerin interfaceOptimizationProblem<P>- Returns:
- the object used to check for convergence.
-
-