Skip to content
Snippets Groups Projects
Commit 40927bf3 authored by Sebastian Krings's avatar Sebastian Krings
Browse files

fix passing around timeout variable

parent a5ab98ae
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ public class KodkodSession { ...@@ -35,7 +35,7 @@ public class KodkodSession {
final Solver solver = new Solver(); final Solver solver = new Solver();
SATFactory satFactory = SolverChecker.determineSatFactory(sat); SATFactory satFactory = SolverChecker.determineSatFactory(sat, timeout);
solver.options().setSolver(satFactory); solver.options().setSolver(satFactory);
solver.options().setSymmetryBreaking(symmetry); solver.options().setSymmetryBreaking(symmetry);
......
...@@ -27,15 +27,20 @@ public class SolverChecker { ...@@ -27,15 +27,20 @@ public class SolverChecker {
private static final Logger LOGGER = Logger.getLogger("de.stups.probkodkod"); private static final Logger LOGGER = Logger.getLogger("de.stups.probkodkod");
public static SATFactory determineSatFactory(SATSolver satSolver) { public static SATFactory determineSatFactory(SATSolver satSolver) {
// a default timeout - an individual one is requested by prob anyway
return determineSatFactory(satSolver, 1500);
}
public static SATFactory determineSatFactory(SATSolver satSolver, long timeout) {
switch (satSolver) { switch (satSolver) {
case glucose: case glucose:
return determineSatFactory(SATFactory.Glucose, new SAT4JWithTimeoutFactory()); return determineSatFactory(SATFactory.Glucose, new SAT4JWithTimeoutFactory(timeout));
case lingeling: case lingeling:
return determineSatFactory(SATFactory.Lingeling, new SAT4JWithTimeoutFactory()); return determineSatFactory(SATFactory.Lingeling, new SAT4JWithTimeoutFactory(timeout));
case minisat: case minisat:
return determineSatFactory(SATFactory.MiniSat, new SAT4JWithTimeoutFactory()); return determineSatFactory(SATFactory.MiniSat, new SAT4JWithTimeoutFactory(timeout));
case sat4j: case sat4j:
return determineSatFactory(new SAT4JWithTimeoutFactory()); return determineSatFactory(new SAT4JWithTimeoutFactory(timeout));
default: default:
throw new Error("No valid SAT solver back-end for Kodkod selected."); throw new Error("No valid SAT solver back-end for Kodkod selected.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment