Add Samples from g3
This commit is contained in:
@@ -18,6 +18,7 @@ import com.google.ortools.linearsolver.MPObjective;
|
||||
import com.google.ortools.linearsolver.MPSolver;
|
||||
import com.google.ortools.linearsolver.MPVariable;
|
||||
|
||||
/** Minimal Linear Programming example to showcase calling the solver.*/
|
||||
public class SimpleLpProgram {
|
||||
static {
|
||||
System.loadLibrary("jniortools");
|
||||
@@ -25,8 +26,8 @@ public class SimpleLpProgram {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Create the linear solver with the GLOP backend.
|
||||
MPSolver solver = new MPSolver(
|
||||
"SimpleLpProgram", MPSolver.OptimizationProblemType.valueOf("GLOP_LINEAR_PROGRAMMING"));
|
||||
MPSolver solver =
|
||||
new MPSolver("SimpleLpProgram", MPSolver.OptimizationProblemType.GLOP_LINEAR_PROGRAMMING);
|
||||
|
||||
// Create the variables x and y.
|
||||
MPVariable x = solver.makeNumVar(0.0, 1.0, "x");
|
||||
|
||||
Reference in New Issue
Block a user