Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
062d697d
Commit
062d697d
authored
Oct 23, 2017
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.ow2.org/sat4j/sat4j
parents
89348d05
d39d0800
Pipeline
#325
passed with stages
in 24 minutes and 6 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
25 deletions
+20
-25
org.sat4j.core/src/main/java/org/sat4j/tools/DotSearchTracing.java
....core/src/main/java/org/sat4j/tools/DotSearchTracing.java
+15
-17
org.sat4j.pb/src/main/java/org/sat4j/pb/reader/OPBReader2005.java
...j.pb/src/main/java/org/sat4j/pb/reader/OPBReader2005.java
+3
-4
org.sat4j.sat/src/main/java/org/sat4j/sat/Lanceur.java
org.sat4j.sat/src/main/java/org/sat4j/sat/Lanceur.java
+1
-2
org.sat4j.sat/src/main/java/org/sat4j/sat/Solvers.java
org.sat4j.sat/src/main/java/org/sat4j/sat/Solvers.java
+1
-2
No files found.
org.sat4j.core/src/main/java/org/sat4j/tools/DotSearchTracing.java
View file @
062d697d
...
...
@@ -67,23 +67,21 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
*/
private
static
final
long
serialVersionUID
=
1L
;
private
final
Vec
<
String
>
pile
;
private
final
Vec
<
String
>
stack
;
private
String
currentNodeName
=
null
;
private
transient
Writer
out
;
private
boolean
estOrang
e
=
false
;
private
boolean
assertiv
e
=
false
;
private
Map
<
Integer
,
T
>
mapping
;
/**
* @since 2.1
*/
public
DotSearchTracing
(
final
String
fileNameToSave
,
Map
<
Integer
,
T
>
mapping
)
{
this
.
pile
=
new
Vec
<
String
>();
this
.
mapping
=
mapping
;
public
DotSearchTracing
(
final
String
fileNameToSave
)
{
this
.
stack
=
new
Vec
<
String
>();
try
{
this
.
out
=
new
FileWriter
(
fileNameToSave
);
}
catch
(
IOException
e
)
{
...
...
@@ -115,13 +113,13 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
String
newName
;
if
(
this
.
currentNodeName
==
null
)
{
newName
=
""
+
absP
;
this
.
pile
.
push
(
newName
);
newName
=
Integer
.
toString
(
absP
)
;
this
.
stack
.
push
(
newName
);
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\", shape=circle, color=blue, style=filled]"
));
}
else
{
newName
=
this
.
currentNodeName
;
this
.
pile
.
push
(
newName
);
this
.
stack
.
push
(
newName
);
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\", shape=circle, color=blue, style=filled]"
));
}
...
...
@@ -133,12 +131,12 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
*/
@Override
public
final
void
propagating
(
final
int
p
)
{
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
"."
+
this
.
estOrang
e
;
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
"."
+
this
.
assertiv
e
;
if
(
this
.
currentNodeName
==
null
)
{
saveLine
(
lineTab
(
"\"null\" [label=\"\", shape=point]"
));
}
final
String
couleur
=
this
.
estOrang
e
?
"orange"
:
"green"
;
final
String
couleur
=
this
.
assertiv
e
?
"orange"
:
"green"
;
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\",shape=point, color=black]"
));
...
...
@@ -147,14 +145,14 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
+
"\", fontcolor ="
+
couleur
+
", color = "
+
couleur
+
", style = bold]"
));
this
.
currentNodeName
=
newName
;
this
.
estOrang
e
=
false
;
this
.
assertiv
e
=
false
;
}
@Override
public
final
void
enqueueing
(
final
int
p
,
IConstr
reason
)
{
if
(
reason
!=
null
)
{
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
"."
+
this
.
estOrang
e
;
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
".
propagated.
"
+
this
.
assertiv
e
;
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\",shape=point, color=black]"
));
saveLine
(
lineTab
(
"\""
+
this
.
currentNodeName
+
"\""
+
" -- "
+
"\""
...
...
@@ -173,8 +171,8 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
@Override
public
final
void
backtracking
(
final
int
p
)
{
final
String
temp
=
this
.
pile
.
last
();
this
.
pile
.
pop
();
final
String
temp
=
this
.
stack
.
last
();
this
.
stack
.
pop
();
saveLine
(
"\""
+
temp
+
"\""
+
"--"
+
"\""
+
this
.
currentNodeName
+
"\""
+
"[label=\"\", color=red, style=dotted]"
);
this
.
currentNodeName
=
temp
;
...
...
@@ -182,7 +180,7 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
@Override
public
final
void
adding
(
final
int
p
)
{
this
.
estOrang
e
=
true
;
this
.
assertiv
e
=
true
;
}
/**
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/reader/OPBReader2005.java
View file @
062d697d
...
...
@@ -704,10 +704,9 @@ public class OPBReader2005 extends Reader implements Serializable {
readMetaData
();
skipComments
();
readVariablesExplanation
();
if
(
mapping
!=
null
)
{
readVariablesExplanation
();
}
skipComments
();
readObjective
();
...
...
org.sat4j.sat/src/main/java/org/sat4j/sat/Lanceur.java
View file @
062d697d
...
...
@@ -172,8 +172,7 @@ public class Lanceur extends AbstractLauncher implements ILogAble {
if
(
dotfilename
==
null
)
{
dotfilename
=
"sat4j.dot"
;
}
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
,
null
));
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
));
}
if
(
cmd
.
hasOption
(
"m"
))
{
...
...
org.sat4j.sat/src/main/java/org/sat4j/sat/Solvers.java
View file @
062d697d
...
...
@@ -392,8 +392,7 @@ public final class Solvers {
if
(
dotfilename
==
null
)
{
dotfilename
=
"sat4j.dot"
;
}
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
,
null
));
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
));
}
return
asolver
;
...
...
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