Package com.darkcollective.relix.solver
Interface SolverResult
- All Known Implementing Classes:
SolverResult.Infeasible,SolverResult.Solved,SolverResult.Undetermined
public sealed interface SolverResult
permits SolverResult.Solved, SolverResult.Infeasible, SolverResult.Undetermined
What a solver has to say about a
LinearProgram: it found an optimum, it
proved there is none, or it did not decide.
The third case is the reason this is a type rather than an Optional.
"No assignment satisfies the constraints" and "the search ran out of road" are
both answers with no values attached, and a caller that cannot tell them apart
has to guess — which in practice means reporting a failed search as an empty
result and returning rows that are quietly wrong. A provider says which it means;
the engine decides what to do about it.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe program is proved infeasible — no assignment satisfies its constraints.static final recordAn optimal assignment.static final recordThe search did not decide: it failed, hit a limit, found the program unbounded or malformed, or stopped for any other reason short of an answer. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic SolverResultReturns the proved-infeasible result.static SolverResultsolved(double[] values) Returns a solved result.static SolverResultundetermined(String reason) Returns an undecided result.
-
Method Details
-
solved
Returns a solved result.- Parameters:
values- the variable values- Returns:
- the result
-
infeasible
Returns the proved-infeasible result.- Returns:
- the result
-
undetermined
Returns an undecided result.- Parameters:
reason- a short explanation of why the search did not answer- Returns:
- the result
-