|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.optimization.direct.BaseAbstractScalarOptimizer<FUNC>
FUNC - Type of the objective function to be optimizedpublic abstract class BaseAbstractScalarOptimizer<FUNC extends MultivariateRealFunction>
Base class for implementing optimizers for multivariate scalar functions. This base class handles the boiler-plate methods associated to thresholds settings, iterations and evaluations counting.
| Field Summary | |
|---|---|
protected Incrementor |
evaluations
Evaluations counter. |
| Constructor Summary | |
|---|---|
protected |
BaseAbstractScalarOptimizer()
Simple constructor with default settings. |
protected |
BaseAbstractScalarOptimizer(ConvergenceChecker<RealPointValuePair> checker)
|
| Method Summary | |
|---|---|
protected double |
computeObjectiveValue(double[] point)
Compute the objective function value. |
protected abstract RealPointValuePair |
doOptimize()
Perform the bulk of the optimization algorithm. |
ConvergenceChecker<RealPointValuePair> |
getConvergenceChecker()
Get the convergence checker. |
int |
getEvaluations()
Get the number of evaluations of the objective function. |
GoalType |
getGoalType()
|
int |
getMaxEvaluations()
Get the maximal number of function evaluations. |
double[] |
getStartPoint()
|
RealPointValuePair |
optimize(int maxEval,
FUNC f,
GoalType goalType,
double[] startPoint)
Optimize an objective function. |
void |
setConvergenceChecker(ConvergenceChecker<RealPointValuePair> convergenceChecker)
Set the convergence checker. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Incrementor evaluations
| Constructor Detail |
|---|
protected BaseAbstractScalarOptimizer()
SimpleScalarValueChecker and
the allowed number of evaluations is set to Integer.MAX_VALUE.
protected BaseAbstractScalarOptimizer(ConvergenceChecker<RealPointValuePair> checker)
checker - Convergence checker.| Method Detail |
|---|
public int getMaxEvaluations()
getMaxEvaluations in interface BaseOptimizer<RealPointValuePair>public int getEvaluations()
optimize method. It is 0 if the method has not been
called yet.
getEvaluations in interface BaseOptimizer<RealPointValuePair>public void setConvergenceChecker(ConvergenceChecker<RealPointValuePair> convergenceChecker)
setConvergenceChecker in interface BaseOptimizer<RealPointValuePair>convergenceChecker - Object to use to check for convergence.public ConvergenceChecker<RealPointValuePair> getConvergenceChecker()
getConvergenceChecker in interface BaseOptimizer<RealPointValuePair>protected double computeObjectiveValue(double[] point)
point - Point at which the objective function must be evaluated.
TooManyEvaluationsException - if the maximal number of
evaluations is exceeded.
public RealPointValuePair optimize(int maxEval,
FUNC f,
GoalType goalType,
double[] startPoint)
optimize in interface BaseMultivariateRealOptimizer<FUNC extends MultivariateRealFunction>maxEval - Maximum number of function evaluations.f - Objective function.goalType - Type of optimization goal: either
GoalType.MAXIMIZE or GoalType.MINIMIZE.startPoint - Start point for optimization.
public GoalType getGoalType()
public double[] getStartPoint()
protected abstract RealPointValuePair doOptimize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||