Top Description Fields Constructors Methods
org.apache.commons.math3.optimization.direct

public Class SimplexOptimizer

extends BaseAbstractMultivariateOptimizer<MultivariateFunction>
implements MultivariateOptimizer
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optimization.MultivariateOptimizer, org.apache.commons.math3.optimization.BaseMultivariateOptimizer, org.apache.commons.math3.optimization.BaseOptimizer
Annotations
@SuppressWarnings:boxing
@Deprecated
Imports
java.util.Comparator, org.apache.commons.math3.analysis.MultivariateFunction, org.apache.commons.math3.exception.NullArgumentException, org.apache.commons.math3.optimization.GoalType, .ConvergenceChecker, .PointValuePair, .SimpleValueChecker, .MultivariateOptimizer, .OptimizationData

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 setSimplex method must be called prior to calling the optimize method.

Each call to optimize will 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 the optimize method 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 CMAESOptimizer or BOBYQAOptimizer, or the optimized method must be wrapped in an adapter like MultivariateFunctionMappingAdapter or MultivariateFunctionPenaltyAdapter.

Since
3.0
See Also
AbstractSimplex, MultivariateFunctionMappingAdapter, MultivariateFunctionPenaltyAdapter, CMAESOptimizer, BOBYQAOptimizer

Field Summary

Modifier and TypeField and Description
private AbstractSimplex
simplex

Deprecated as a consequence of AbstractSimplex being deprecated.
Simplex.
Inherited from org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer:
evaluations

Constructor Summary

AccessConstructor and Description
public
public
SimplexOptimizer(ConvergenceChecker<PointValuePair>
Convergence checker.
checker
)
Deprecated as a consequence of ConvergenceChecker being deprecated.

public
SimplexOptimizer(double
Relative threshold.
rel
,
double
Absolute threshold.
abs
)

Method Summary

Modifier and TypeMethod and Description
protected PointValuePair
doOptimize()

Implements abstract org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.doOptimize.

Deprecated as a consequence of PointValuePair being deprecated.

Perform the bulk of the optimization algorithm.

protected PointValuePair

Returns:

the point/value pair giving the optimal value for objective function.
optimizeInternal
(int
Allowed number of evaluations of the objective function.
maxEval
,
MultivariateFunction
Objective function.
f
,
GoalType
Optimization type.
goalType
,
OptimizationData...
Optimization data. The following data will be looked for:
optData
)

Overrides org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.optimizeInternal.

Deprecated as a consequence of GoalType, OptimizationData and PointValuePair being deprecated.

Optimize an objective function.

private void
parseOptimizationData(OptimizationData...
Optimization data. The following data will be looked for:
optData
)

Hides org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.parseOptimizationData.

Deprecated as a consequence of OptimizationData being deprecated.

Scans the list of (required and optional) optimization data that characterize the problem.

public void
setSimplex(AbstractSimplex
Simplex.
simplex
)
Deprecated As of 3.1.

Set the simplex algorithm.

Inherited from org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer:
computeObjectiveValuegetConvergenceCheckergetEvaluationsgetGoalTypegetLowerBoundgetMaxEvaluationsgetStartPointgetUpperBoundoptimizeoptimizeoptimizeInternal

Field Detail

simplexback to summary
private AbstractSimplex simplex

Deprecated

as a consequence of AbstractSimplex being deprecated. See corresponding docs for further information.

Simplex.

Constructor Detail

SimplexOptimizerback to summary
public SimplexOptimizer()

Constructor using a default convergence checker.

Annotations
@Deprecated
SimplexOptimizerback to summary
public SimplexOptimizer(ConvergenceChecker<PointValuePair> checker)

Deprecated

as a consequence of ConvergenceChecker being deprecated. See corresponding docs for further information.

Parameters
checker:ConvergenceChecker<PointValuePair>

Convergence checker.

SimplexOptimizerback to summary
public SimplexOptimizer(double rel, double abs)
Parameters
rel:double

Relative threshold.

abs:double

Absolute threshold.

Method Detail

doOptimizeback to summary
protected PointValuePair doOptimize()

Implements abstract org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.doOptimize.

Doc from org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.doOptimize.

Deprecated

as a consequence of PointValuePair being deprecated. See corresponding docs for further information.

Perform the bulk of the optimization algorithm.

Returns:PointValuePair

the point/value pair giving the optimal value of the objective function.

Annotations
@Override
optimizeInternalback to summary
protected PointValuePair optimizeInternal(int maxEval, MultivariateFunction f, GoalType goalType, OptimizationData... optData)

Overrides org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.optimizeInternal.

Deprecated

as a consequence of GoalType, OptimizationData and PointValuePair being deprecated. See corresponding docs for further information.

Optimize an objective function.

Parameters
maxEval:int

Allowed number of evaluations of the objective function.

f:MultivariateFunction

Objective function.

goalType:GoalType

Optimization type.

optData:OptimizationData[]

Optimization data. The following data will be looked for:

Returns:PointValuePair

the point/value pair giving the optimal value for objective function.

Annotations
@Override
parseOptimizationDataback to summary
private void parseOptimizationData(OptimizationData... optData)

Hides org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.parseOptimizationData.

Deprecated

as a consequence of OptimizationData being deprecated. See corresponding docs for further information.

Scans the list of (required and optional) optimization data that characterize the problem.

Parameters
optData:OptimizationData[]

Optimization data. The following data will be looked for:

setSimplexback to summary
public void setSimplex(AbstractSimplex simplex)

Deprecated

As of 3.1. The initial simplex can now be passed as an argument of the optimize(int, MultivariateFunction, GoalType, OptimizationData[]) method.

Set the simplex algorithm.

Parameters
simplex:AbstractSimplex

Simplex.

Annotations
@Deprecated