|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math3.optimization.linear.AbstractLinearOptimizer
@Deprecated public abstract class AbstractLinearOptimizer
Base class for implementing linear optimizers.
This base class handles the boilerplate methods associated to thresholds settings and iterations counters.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_ITERATIONS
Deprecated. Default maximal number of iterations allowed. |
| Constructor Summary | |
|---|---|
protected |
AbstractLinearOptimizer()
Deprecated. Simple constructor with default settings. |
| Method Summary | |
|---|---|
protected abstract PointValuePair |
doOptimize()
Deprecated. Perform the bulk of optimization algorithm. |
protected Collection<LinearConstraint> |
getConstraints()
Deprecated. |
protected LinearObjectiveFunction |
getFunction()
Deprecated. |
protected GoalType |
getGoalType()
Deprecated. |
int |
getIterations()
Deprecated. Get the number of iterations realized by the algorithm. |
int |
getMaxIterations()
Deprecated. Get the maximal number of iterations of the algorithm. |
protected void |
incrementIterationsCounter()
Deprecated. Increment the iterations counter by 1. |
PointValuePair |
optimize(LinearObjectiveFunction f,
Collection<LinearConstraint> constraints,
GoalType goalType,
boolean restrictToNonNegative)
Deprecated. Optimizes an objective function. |
protected boolean |
restrictToNonNegative()
Deprecated. |
void |
setMaxIterations(int maxIterations)
Deprecated. Set the maximal number of iterations of the algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_ITERATIONS
| Constructor Detail |
|---|
protected AbstractLinearOptimizer()
The maximal number of evaluation is set to its default value.
| Method Detail |
|---|
protected boolean restrictToNonNegative()
true if the variables are restricted to non-negative values.protected GoalType getGoalType()
protected LinearObjectiveFunction getFunction()
protected Collection<LinearConstraint> getConstraints()
public void setMaxIterations(int maxIterations)
setMaxIterations in interface LinearOptimizermaxIterations - maximal number of function callspublic int getMaxIterations()
getMaxIterations in interface LinearOptimizerpublic int getIterations()
The number of evaluations corresponds to the last call to the
optimize
method. It is 0 if the method has not been called yet.
getIterations in interface LinearOptimizer
protected void incrementIterationsCounter()
throws MaxCountExceededException
MaxCountExceededException - if the maximal number of iterations is exceeded
public PointValuePair optimize(LinearObjectiveFunction f,
Collection<LinearConstraint> constraints,
GoalType goalType,
boolean restrictToNonNegative)
throws MathIllegalStateException
optimize in interface LinearOptimizerf - linear objective functionconstraints - linear constraintsgoalType - type of optimization goal: either GoalType.MAXIMIZE or GoalType.MINIMIZErestrictToNonNegative - whether to restrict the variables to non-negative values
MathIllegalStateException - if no solution fulfilling the constraints
can be found in the allowed number of iterations
protected abstract PointValuePair doOptimize()
throws MathIllegalStateException
MathIllegalStateException - if no solution fulfilling the constraints
can be found in the allowed number of iterations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||