Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
probkodkod
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
probkodkod
Commits
40927bf3
Commit
40927bf3
authored
8 years ago
by
Sebastian Krings
Browse files
Options
Downloads
Patches
Plain Diff
fix passing around timeout variable
parent
a5ab98ae
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/stups/probkodkod/KodkodSession.java
+1
-1
1 addition, 1 deletion
src/main/java/de/stups/probkodkod/KodkodSession.java
src/main/java/de/stups/probkodkod/SolverChecker.java
+9
-4
9 additions, 4 deletions
src/main/java/de/stups/probkodkod/SolverChecker.java
with
10 additions
and
5 deletions
src/main/java/de/stups/probkodkod/KodkodSession.java
+
1
−
1
View file @
40927bf3
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/stups/probkodkod/SolverChecker.java
+
9
−
4
View file @
40927bf3
...
@@ -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."
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment