Class SolutionCallback
- java.lang.Object
-
- org.apache.commons.math3.optim.linear.SolutionCallback
-
- All Implemented Interfaces:
OptimizationData
public class SolutionCallback extends java.lang.Object implements OptimizationData
A callback object that can be provided to a linear optimizer to keep track of the best solution found.- Since:
- 3.3
-
-
Field Summary
Fields Modifier and Type Field Description private SimplexTableautableauThe SimplexTableau used by the SimplexSolver.
-
Constructor Summary
Constructors Constructor Description SolutionCallback()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PointValuePairgetSolution()Retrieve the best solution found so far.booleanisSolutionOptimal()Returns if the found solution is optimal.(package private) voidsetTableau(SimplexTableau tableau)Set the simplex tableau used during the optimization once a feasible solution has been found.
-
-
-
Field Detail
-
tableau
private SimplexTableau tableau
The SimplexTableau used by the SimplexSolver.
-
-
Method Detail
-
setTableau
void setTableau(SimplexTableau tableau)
Set the simplex tableau used during the optimization once a feasible solution has been found.- Parameters:
tableau- the simplex tableau containing a feasible solution
-
getSolution
public PointValuePair getSolution()
Retrieve the best solution found so far.Note: the returned solution may not be optimal, e.g. in case the optimizer did reach the iteration limits.
- Returns:
- the best solution found so far by the optimizer, or
nullif no feasible solution could be found
-
isSolutionOptimal
public boolean isSolutionOptimal()
Returns if the found solution is optimal.- Returns:
trueif the solution is optimal,falseotherwise
-
-