Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SAT4J
sat4j
Commits
179b56a6
Commit
179b56a6
authored
Jul 05, 2017
by
Daniel Le Berre
Browse files
Add volatile for ExitCode in LauncherMode.
parent
171059c7
Pipeline
#202
passed with stage
in 11 minutes and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
org.sat4j.core/src/main/java/org/sat4j/DecisionMode.java
View file @
179b56a6
...
...
@@ -47,7 +47,7 @@ import org.sat4j.tools.Backbone;
*
*/
final
class
DecisionMode
implements
ILauncherMode
{
private
ExitCode
exitCode
=
ExitCode
.
UNKNOWN
;
private
volatile
ExitCode
exitCode
=
ExitCode
.
UNKNOWN
;
private
int
nbSolutionFound
;
private
PrintWriter
out
;
private
long
beginTime
;
...
...
org.sat4j.core/src/main/java/org/sat4j/OptimizationMode.java
View file @
179b56a6
...
...
@@ -52,7 +52,7 @@ import org.sat4j.tools.LexicoDecorator;
*/
final
class
OptimizationMode
implements
ILauncherMode
{
private
int
nbSolutions
;
private
ExitCode
exitCode
=
ExitCode
.
UNKNOWN
;
private
volatile
ExitCode
exitCode
=
ExitCode
.
UNKNOWN
;
private
boolean
isIncomplete
=
false
;
private
PrintWriter
out
;
private
long
beginTime
;
...
...
@@ -62,8 +62,8 @@ final class OptimizationMode implements ILauncherMode {
this
.
isIncomplete
=
isIncomplete
;
}
public
void
displayResult
(
ISolver
solver
,
IProblem
problem
,
ILogAble
logger
,
PrintWriter
out
,
Reader
reader
,
long
beginTime
,
public
void
displayResult
(
ISolver
solver
,
IProblem
problem
,
ILogAble
logger
,
PrintWriter
out
,
Reader
reader
,
long
beginTime
,
boolean
displaySolutionLine
)
{
if
(
solver
==
null
)
{
return
;
...
...
@@ -73,8 +73,8 @@ final class OptimizationMode implements ILauncherMode {
solver
.
printStat
(
out
);
out
.
println
(
ANSWER_PREFIX
+
exitCode
);
if
(
exitCode
==
ExitCode
.
SATISFIABLE
||
exitCode
==
ExitCode
.
OPTIMUM_FOUND
||
isIncomplete
&&
exitCode
==
ExitCode
.
UPPER_BOUND
)
{
||
exitCode
==
ExitCode
.
OPTIMUM_FOUND
||
isIncomplete
&&
exitCode
==
ExitCode
.
UPPER_BOUND
)
{
assert
this
.
nbSolutions
>
0
;
logger
.
log
(
"Found "
+
this
.
nbSolutions
+
" solution(s)"
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment