Class SimplexOptimizer
- java.lang.Object
-
- org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer<MultivariateFunction>
-
- org.apache.commons.math3.optimization.direct.SimplexOptimizer
-
- All Implemented Interfaces:
BaseMultivariateOptimizer<MultivariateFunction>,BaseOptimizer<PointValuePair>,MultivariateOptimizer
@Deprecated public class SimplexOptimizer extends BaseAbstractMultivariateOptimizer<MultivariateFunction> implements MultivariateOptimizer
Deprecated.As of 3.1 (to be removed in 4.0).This class implements simplex-based direct search optimization.Direct search methods only use objective function values, they do not need derivatives and don't either try to compute approximation of the derivatives. According to a 1996 paper by Margaret H. Wright (Direct Search Methods: Once Scorned, Now Respectable), they are used when either the computation of the derivative is impossible (noisy functions, unpredictable discontinuities) or difficult (complexity, computation cost). In the first cases, rather than an optimum, a not too bad point is desired. In the latter cases, an optimum is desired but cannot be reasonably found. In all cases direct search methods can be useful.
Simplex-based direct search methods are based on comparison of the objective function values at the vertices of a simplex (which is a set of n+1 points in dimension n) that is updated by the algorithms steps.
The
setSimplexmethod must be called prior to calling theoptimizemethod.Each call to
optimizewill re-use the start configuration of the current simplex and move it such that its first vertex is at the provided start point of the optimization. If theoptimizemethod is called to solve a different problem and the number of parameters change, the simplex must be re-initialized to one with the appropriate dimensions.Convergence is checked by providing the worst points of previous and current simplex to the convergence checker, not the best ones.
This simplex optimizer implementation does not directly support constrained optimization with simple bounds, so for such optimizations, either a more dedicated method must be used like
CMAESOptimizerorBOBYQAOptimizer, or the optimized method must be wrapped in an adapter likeMultivariateFunctionMappingAdapterorMultivariateFunctionPenaltyAdapter.- Since:
- 3.0
- See Also:
AbstractSimplex,MultivariateFunctionMappingAdapter,MultivariateFunctionPenaltyAdapter,CMAESOptimizer,BOBYQAOptimizer
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractSimplexsimplexDeprecated.Simplex.-
Fields inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer
evaluations
-
-
Constructor Summary
Constructors Constructor Description SimplexOptimizer()Deprecated.SimplexOptimizer(double rel, double abs)Deprecated.SimplexOptimizer(ConvergenceChecker<PointValuePair> checker)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected PointValuePairdoOptimize()Deprecated.Perform the bulk of the optimization algorithm.protected PointValuePairoptimizeInternal(int maxEval, MultivariateFunction f, GoalType goalType, OptimizationData... optData)Deprecated.Optimize an objective function.private voidparseOptimizationData(OptimizationData... optData)Deprecated.Scans the list of (required and optional) optimization data that characterize the problem.voidsetSimplex(AbstractSimplex simplex)Deprecated.As of 3.1.-
Methods inherited from class org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer
computeObjectiveValue, getConvergenceChecker, getEvaluations, getGoalType, getLowerBound, getMaxEvaluations, getStartPoint, getUpperBound, optimize, optimize, optimizeInternal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.math3.optimization.BaseMultivariateOptimizer
optimize
-
Methods inherited from interface org.apache.commons.math3.optimization.BaseOptimizer
getConvergenceChecker, getEvaluations, getMaxEvaluations
-
-
-
-
Field Detail
-
simplex
private AbstractSimplex simplex
Deprecated.Simplex.
-
-
Constructor Detail
-
SimplexOptimizer
@Deprecated public SimplexOptimizer()
Deprecated.Constructor using a defaultconvergence checker.
-
SimplexOptimizer
public SimplexOptimizer(ConvergenceChecker<PointValuePair> checker)
Deprecated.- Parameters:
checker- Convergence checker.
-
SimplexOptimizer
public SimplexOptimizer(double rel, double abs)Deprecated.- Parameters:
rel- Relative threshold.abs- Absolute threshold.
-
-
Method Detail
-
setSimplex
@Deprecated public void setSimplex(AbstractSimplex simplex)
Deprecated.As of 3.1. The initial simplex can now be passed as an argument of theBaseAbstractMultivariateOptimizer.optimize(int,MultivariateFunction,GoalType,OptimizationData[])method.Set the simplex algorithm.- Parameters:
simplex- Simplex.
-
optimizeInternal
protected PointValuePair optimizeInternal(int maxEval, MultivariateFunction f, GoalType goalType, OptimizationData... optData)
Deprecated.Optimize an objective function.- Overrides:
optimizeInternalin classBaseAbstractMultivariateOptimizer<MultivariateFunction>- Parameters:
maxEval- Allowed number of evaluations of the objective function.f- Objective function.goalType- Optimization type.optData- Optimization data. The following data will be looked for:- Returns:
- the point/value pair giving the optimal value for objective function.
-
parseOptimizationData
private void parseOptimizationData(OptimizationData... optData)
Deprecated.Scans the list of (required and optional) optimization data that characterize the problem.- Parameters:
optData- Optimization data. The following data will be looked for:
-
doOptimize
protected PointValuePair doOptimize()
Deprecated.Perform the bulk of the optimization algorithm.- Specified by:
doOptimizein classBaseAbstractMultivariateOptimizer<MultivariateFunction>- Returns:
- the point/value pair giving the optimal value of the objective function.
-
-