Package org.hipparchus.optim.linear
Class SolutionCallback
java.lang.Object
org.hipparchus.optim.linear.SolutionCallback
- All Implemented Interfaces:
OptimizationData
A callback object that can be provided to a linear optimizer to keep track
of the best solution found.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieve the best solution found so far.boolean
Returns if the found solution is optimal.
-
Constructor Details
-
SolutionCallback
public SolutionCallback()Empty constructor.This constructor is not strictly necessary, but it prevents spurious javadoc warnings with JDK 18 and later.
- Since:
- 3.0
-
-
Method Details
-
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
null
if no feasible solution could be found
-
isSolutionOptimal
public boolean isSolutionOptimal()Returns if the found solution is optimal.- Returns:
true
if the solution is optimal,false
otherwise
-