|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.math.optimization.linear.AbstractLinearOptimizer
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
Default maximal number of iterations allowed. |
| Method Summary | |
|---|---|
int |
getIterations()
Get the number of iterations realized by the algorithm. |
int |
getMaxIterations()
Get the maximal number of iterations of the algorithm. |
RealPointValuePair |
optimize(LinearObjectiveFunction f,
Collection<LinearConstraint> constraints,
GoalType goalType,
boolean restrictToNonNegative)
Optimizes an objective function. |
void |
setMaxIterations(int maxIterations)
Set the maximal number of iterations of the algorithm. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_ITERATIONS
| Method Detail |
|---|
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
public RealPointValuePair optimize(LinearObjectiveFunction f,
Collection<LinearConstraint> constraints,
GoalType goalType,
boolean restrictToNonNegative)
throws OptimizationException
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
OptimizationException - 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 | ||||||||