fix examples
This commit is contained in:
@@ -27,17 +27,18 @@ import com.google.ortools.linearsolver.MPVariable;
|
||||
public class IntegerProgramming {
|
||||
static { System.loadLibrary("jniortools"); }
|
||||
|
||||
private static MPSolver createSolver (String solverType)
|
||||
throws java.lang.IllegalArgumentException {
|
||||
return new MPSolver("IntegerProgrammingExample",
|
||||
MPSolver.OptimizationProblemType.valueOf(solverType));
|
||||
private static MPSolver createSolver (String solverType) {
|
||||
try {
|
||||
return new MPSolver("IntegerProgrammingExample",
|
||||
MPSolver.OptimizationProblemType.valueOf(solverType));
|
||||
} catch (java.lang.IllegalArgumentException e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void runIntegerProgrammingExample(String solverType) {
|
||||
MPSolver solver = null;
|
||||
try {
|
||||
solver = createSolver(solverType);
|
||||
} catch (java.lang.IllegalArgumentException e) {
|
||||
MPSolver solver = createSolver(solverType);
|
||||
if (solver == null) {
|
||||
System.out.println("Could not create solver " + solverType);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user