Skip to content

Commit fe09507

Browse files
committed
change Gurobi parameters to defaults
1 parent 1240dc8 commit fe09507

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/asr/Mip.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@ public static void printAncestralIndels(IdxTree tree, HashMap<Integer, Integer[]
161161
public HashMap<Integer, Integer[]> runMPSolverIndelInference() {
162162

163163
Loader.loadNativeLibraries(); // link to Google-OR Tools
164-
this.solver = MPSolver.createSolver(solverName);
164+
165+
if (solverName.equalsIgnoreCase("SCIP")) {
166+
this.solver = new MPSolver("SCIP", MPSolver.OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING);
167+
} else if (solverName.equalsIgnoreCase("Gurobi")) {
168+
this.solver = MPSolver.createSolver(solverName);
169+
}
170+
171+
165172
if (this.solver == null) {
166173
GRASP.usage(6, "Could not create MIP solver with " + solverName);
167174
}
@@ -185,8 +192,8 @@ public HashMap<Integer, Integer[]> runMPSolverIndelInference() {
185192
System.out.println("SCIP solver detected - using single thread for solving.");
186193
solver.setNumThreads(1);
187194
actualThreadsUsed = 1;
188-
} else {
189-
solver.setNumThreads(this.nThreads);
195+
} else if (solverName.equalsIgnoreCase("Gurobi")) {
196+
solver.setSolverSpecificParametersAsString("Presolve=-1, FeasibilityTol=1e-06, IntFeasTol=1e-05, OptimalityTol=1e-06, Method=1, DegenMoves=0, Threads=" + this.nThreads);
190197
}
191198

192199
if (GRASP.VERBOSE) {

0 commit comments

Comments
 (0)