Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
15c9b2cb
Commit
15c9b2cb
authored
Nov 11, 2018
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed handling of Interrupted Exception with
Thread.currentThread().interrupt().
parent
e6e2bd59
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
org.sat4j.core/src/main/java/org/sat4j/tools/ManyCore.java
org.sat4j.core/src/main/java/org/sat4j/tools/ManyCore.java
+1
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/multiobjective/AbstractLinMultiObjOptimizer.java
...sat4j/pb/multiobjective/AbstractLinMultiObjOptimizer.java
+4
-4
org.sat4j.pb/src/main/java/org/sat4j/pb/multiobjective/CriterionOptimumComputer.java
...org/sat4j/pb/multiobjective/CriterionOptimumComputer.java
+7
-2
org.sat4j.sat/src/main/java/org/sat4j/sat/RemoteControlStrategy.java
...at/src/main/java/org/sat4j/sat/RemoteControlStrategy.java
+1
-0
org.sat4j.sat/src/main/java/org/sat4j/sat/visu/GnuplotBasedSolverVisualisation.java
...a/org/sat4j/sat/visu/GnuplotBasedSolverVisualisation.java
+1
-0
No files found.
org.sat4j.core/src/main/java/org/sat4j/tools/ManyCore.java
View file @
15c9b2cb
...
...
@@ -360,6 +360,7 @@ public class ManyCore<S extends ISolver>
}
while
(
this
.
remainingSolvers
.
get
()
>
0
);
}
catch
(
InterruptedException
e
)
{
// will happen when one solver found a solution
Thread
.
currentThread
().
interrupt
();
}
if
(!
this
.
solved
)
{
assert
this
.
remainingSolvers
.
get
()
==
0
;
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/multiobjective/AbstractLinMultiObjOptimizer.java
View file @
15c9b2cb
...
...
@@ -58,7 +58,7 @@ public abstract class AbstractLinMultiObjOptimizer extends PseudoOptDecorator
private
static
final
long
serialVersionUID
=
1L
;
protected
final
List
<
ObjectiveFunction
>
objs
=
new
ArrayList
<
ObjectiveFunction
>();
protected
final
transient
List
<
ObjectiveFunction
>
objs
=
new
ArrayList
<
ObjectiveFunction
>();
protected
boolean
initConstraintsSet
=
false
;
...
...
@@ -106,9 +106,9 @@ public abstract class AbstractLinMultiObjOptimizer extends PseudoOptDecorator
}
boolean
res
=
super
.
admitABetterSolution
(
assumps
);
if
(
res
&&
isVerbose
())
{
System
.
out
.
println
(
getLogPrefix
()
+
"Current objective functions values: "
+
Arrays
.
toString
(
getObjectiveValues
()));
System
.
out
.
println
(
getLogPrefix
()
+
"Current objective functions values: "
+
Arrays
.
toString
(
getObjectiveValues
()));
}
return
res
;
}
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/multiobjective/CriterionOptimumComputer.java
View file @
15c9b2cb
...
...
@@ -96,7 +96,7 @@ public class CriterionOptimumComputer<S extends IPBSolver> {
try
{
this
.
lock
.
acquire
();
}
catch
(
InterruptedException
e
)
{
t
hr
ow
new
RuntimeException
(
e
);
T
hr
ead
.
currentThread
().
interrupt
(
);
}
}
}
...
...
@@ -127,12 +127,17 @@ public class CriterionOptimumComputer<S extends IPBSolver> {
try
{
this
.
lock
.
acquire
(
this
.
objs
.
size
());
}
catch
(
InterruptedException
e
)
{
t
hr
ow
new
RuntimeException
(
e
);
T
hr
ead
.
currentThread
().
interrupt
(
);
}
}
class
OptimumValueWriter
implements
SolutionFoundListener
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
final
CriterionOptimumComputer
<
S
>
coc
;
private
final
int
solverIndex
;
...
...
org.sat4j.sat/src/main/java/org/sat4j/sat/RemoteControlStrategy.java
View file @
15c9b2cb
...
...
@@ -225,6 +225,7 @@ public class RemoteControlStrategy implements RestartStrategy,
Thread
.
sleep
(
SLEEP_TIME
);
}
catch
(
InterruptedException
e
)
{
logger
.
log
(
e
.
getMessage
());
Thread
.
currentThread
().
interrupt
();
}
}
this
.
phaseSelectionStrategy
.
assignLiteral
(
p
);
...
...
org.sat4j.sat/src/main/java/org/sat4j/sat/visu/GnuplotBasedSolverVisualisation.java
View file @
15c9b2cb
...
...
@@ -335,6 +335,7 @@ public class GnuplotBasedSolverVisualisation implements SolverVisualisation {
}
catch
(
InterruptedException
e
)
{
GnuplotBasedSolverVisualisation
.
this
.
logger
.
log
(
e
.
getMessage
());
Thread
.
currentThread
().
interrupt
();
}
GnuplotBasedSolverVisualisation
.
this
.
logger
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment