Java Reference
Java Reference
ModelBuilderTest.java
Go to the documentation of this file.
Load native libraries needed for using ortools-java.
Definition: Loader.java:33
static synchronized void loadNativeLibraries()
Definition: Loader.java:104
Wrapper around a linear constraint stored in the ModelBuilderHelper instance.
Definition: LinearConstraint.java:17
String getName()
Returns the name of the variable given upon creation.
Definition: LinearConstraint.java:54
LinearExprBuilder addTerm(LinearArgument expr, double coeff)
Definition: modelbuilder/LinearExprBuilder.java:39
void setUp()
Definition: ModelBuilderTest.java:25
void runMinimalLinearExample_ok()
Definition: ModelBuilderTest.java:30
void importFromLpString()
Definition: ModelBuilderTest.java:121
void importFromMpsString()
Definition: ModelBuilderTest.java:96
Variable newNumVar(double lb, double ub, String name)
Creates an continuous variable with domain [lb, ub].
Definition: ModelBuilder.java:59
boolean importFromMpsString(String mpsString)
Definition: ModelBuilder.java:228
String exportToLpString(boolean obfuscate)
Definition: ModelBuilder.java:224
int numConstraints()
Returns the number of constraints in the model.
Definition: ModelBuilder.java:156
LinearConstraint addLessOrEqual(LinearArgument expr, double value)
Adds.
Definition: ModelBuilder.java:130
boolean importFromLpString(String lpString)
Definition: ModelBuilder.java:236
String exportToMpsString(boolean obfuscate)
Definition: ModelBuilder.java:220
double getDualValue(LinearConstraint ct)
Checks that the solver has found a solution, and returns the dual value of the given constraint.
Definition: ModelSolver.java:125
double getReducedCost(Variable var)
Checks that the solver has found a solution, and returns the reduced cost of the given variable.
Definition: ModelSolver.java:113
double getObjectiveValue()
Checks that the solver has found a solution, and returns the objective value.
Definition: ModelSolver.java:84
SolveStatus solve(ModelBuilder model)
Solves given model, and returns the status of the response.
Definition: ModelSolver.java:35
double getValue(Variable var)
Checks that the solver has found a solution, and returns the value of the given variable.
Definition: ModelSolver.java:102
double getActivity(LinearConstraint ct)
Checks that the solver has found a solution, and returns the activity of the given constraint.
Definition: ModelSolver.java:136
void setTimeLimit(Duration limit)
Sets the time limit for the solve in seconds.
Definition: ModelSolver.java:54
boolean solverIsSupported()
Returns whether solver specified during the ctor was found and correctly installed.
Definition: ModelSolver.java:64
double getObjectiveCoefficient()
Returns the objective coefficient of the variable.
Definition: Variable.java:74
void setLowerBound(double lowerBound)
Sets the lower bound of the variable.
Definition: Variable.java:49
A linear expression (sum (ai * xi) + b).
Definition: modelbuilder/LinearExpr.java:17
static LinearExpr weightedSum(LinearArgument[] exprs, double[] coeffs)
Shortcut for newBuilder().addWeightedSum(exprs, coeffs).build()
Definition: modelbuilder/LinearExpr.java:56
static LinearExpr sum(LinearArgument[] exprs)
Shortcut for newBuilder().addSum(exprs).build()
Definition: modelbuilder/LinearExpr.java:51