public final class ModelSolver
extends java.lang.Object
Constructor and Description |
---|
ModelSolver(java.lang.String solverName)
Creates the solver with the supplied solver backend.
|
Modifier and Type | Method and Description |
---|---|
void |
enableOutput(boolean enable)
Enables or disables the underlying solver output.
|
double |
getActivity(LinearConstraint ct)
Checks that the solver has found a solution, and returns the activity of the given constraint.
|
double |
getBestObjectiveBound()
Checks that the solver has found a solution, and returns the objective value.
|
double |
getDualValue(LinearConstraint ct)
Checks that the solver has found a solution, and returns the dual value of the given
constraint.
|
double |
getObjectiveValue()
Checks that the solver has found a solution, and returns the objective value.
|
double |
getReducedCost(Variable var)
Checks that the solver has found a solution, and returns the reduced cost of the given
variable.
|
double |
getUserTime()
Returns the user time since the creation of the solver.
|
double |
getValue(Variable var)
Checks that the solver has found a solution, and returns the value of the given variable.
|
double |
getWallTime()
Returns the elapsed time since the creation of the solver.
|
boolean |
hasResponse()
Returns true if solve() was called, and a response was returned.
|
boolean |
hasSolution()
Returns true if solve() was called, and a solution was returned.
|
boolean |
interruptSolve()
Tries to interrupt the solve.
|
void |
setLogCallback(java.util.function.Consumer<java.lang.String> cb)
Sets the log callback for the solver.
|
void |
setSolverSpecificParameters(java.lang.String parameters)
Sets solver specific parameters as string.
|
void |
setTimeLimit(java.time.Duration limit)
Sets the time limit for the solve in seconds.
|
SolveStatus |
solve(ModelBuilder model)
Solves given model, and returns the status of the response.
|
boolean |
solverIsSupported()
Returns whether solver specified during the ctor was found and correctly installed.
|
public ModelSolver(java.lang.String solverName)
public SolveStatus solve(ModelBuilder model)
public void enableOutput(boolean enable)
public void setTimeLimit(java.time.Duration limit)
public void setSolverSpecificParameters(java.lang.String parameters)
public boolean solverIsSupported()
public boolean interruptSolve()
public boolean hasResponse()
public boolean hasSolution()
public double getObjectiveValue()
public double getBestObjectiveBound()
public double getValue(Variable var)
public double getReducedCost(Variable var)
public double getDualValue(LinearConstraint ct)
public double getActivity(LinearConstraint ct)
public void setLogCallback(java.util.function.Consumer<java.lang.String> cb)
public double getWallTime()
public double getUserTime()
Copyright © 2025. All rights reserved.