public class SimplexSolver extends LinearOptimizer
The SimplexSolver
supports the following OptimizationData
data provided
as arguments to optimize(OptimizationData...)
:
LinearObjectiveFunction
- mandatoryLinearConstraintSet
- mandatoryGoalType
- optional, default: MINIMIZE
NonNegativeConstraint
- optional, default: truePivotSelectionRule
- optional, default PivotSelectionRule.DANTZIG
SolutionCallback
- optionalMaxIter
- optional, default: Integer.MAX_VALUE
Note: Depending on the problem definition, the default convergence criteria
may be too strict, resulting in NoFeasibleSolutionException
or
TooManyIterationsException
. In such a case it is advised to adjust these
criteria with more appropriate values, e.g. relaxing the epsilon value.
Default convergence criteria:
The cut-off value has been introduced to handle the case of very small pivot elements
in the Simplex tableau, as these may lead to numerical instabilities and degeneracy.
Potential pivot elements smaller than this value will be treated as if they were zero
and are thus not considered by the pivot selection mechanism. The default value is safe
for many problems, but may need to be adjusted in case of very small coefficients
used in either the LinearConstraint
or LinearObjectiveFunction
.
Constructor and Description |
---|
SimplexSolver()
Builds a simplex solver with default settings.
|
SimplexSolver(double epsilon)
Builds a simplex solver with a specified accepted amount of error.
|
SimplexSolver(double epsilon,
int maxUlps)
Builds a simplex solver with a specified accepted amount of error.
|
SimplexSolver(double epsilon,
int maxUlps,
double cutOff)
Builds a simplex solver with a specified accepted amount of error.
|
Modifier and Type | Method and Description |
---|---|
PointValuePair |
doOptimize()
Performs the bulk of the optimization algorithm.
|
PointValuePair |
optimize(OptimizationData... optData)
Stores data and performs the optimization.
|
computeObjectiveValue, getGoalType
getLowerBound, getStartPoint, getUpperBound
getConvergenceChecker, getEvaluations, getIterations, getMaxEvaluations, getMaxIterations, optimize
public SimplexSolver()
public SimplexSolver(double epsilon)
epsilon
- Amount of error to accept for algorithm convergence.public SimplexSolver(double epsilon, int maxUlps)
epsilon
- Amount of error to accept for algorithm convergence.maxUlps
- Amount of error to accept in floating point comparisons.public SimplexSolver(double epsilon, int maxUlps, double cutOff)
epsilon
- Amount of error to accept for algorithm convergence.maxUlps
- Amount of error to accept in floating point comparisons.cutOff
- Values smaller than the cutOff are treated as zero.public PointValuePair optimize(OptimizationData... optData) throws TooManyIterationsException
The list of parameters is open-ended so that sub-classes can extend it with arguments specific to their concrete implementations.
When the method is called multiple times, instance data is overwritten only when actually present in the list of arguments: when not specified, data set in a previous call is retained (and thus is optional in subsequent calls).
Important note: Subclasses must override
BaseOptimizer.parseOptimizationData(OptimizationData[])
if they need to register
their own options; but then, they must also call
super.parseOptimizationData(optData)
within that method.
optimize
in class LinearOptimizer
optData
- Optimization data. In addition to those documented in
LinearOptimizer
, this method will register the following data:
TooManyIterationsException
- if the maximal number of iterations is exceeded.public PointValuePair doOptimize() throws TooManyIterationsException, UnboundedSolutionException, NoFeasibleSolutionException
TooManyIterationsException
UnboundedSolutionException
NoFeasibleSolutionException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics