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
e1e01226
Commit
e1e01226
authored
Jun 09, 2020
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add solutionlistener feature.
parent
b7ea93a1
Pipeline
#8826
passed with stages
in 197 minutes and 26 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
1 deletion
+11
-1
org.sat4j.core/features.properties
org.sat4j.core/features.properties
+3
-1
org.sat4j.core/src/main/java/org/sat4j/DecisionMode.java
org.sat4j.core/src/main/java/org/sat4j/DecisionMode.java
+2
-0
org.sat4j.core/src/main/java/org/sat4j/OptimizationMode.java
org.sat4j.core/src/main/java/org/sat4j/OptimizationMode.java
+2
-0
org.sat4j.core/src/main/java/org/sat4j/tools/CheckMUSSolutionListener.java
...c/main/java/org/sat4j/tools/CheckMUSSolutionListener.java
+2
-0
org.sat4j.core/src/main/java/org/sat4j/tools/SolutionFoundListener.java
.../src/main/java/org/sat4j/tools/SolutionFoundListener.java
+2
-0
No files found.
org.sat4j.core/features.properties
View file @
e1e01226
...
...
@@ -6,4 +6,6 @@ simplifications=Learned constraints simplification policy
deletion
=
Learned constraints deletion policy
varheuristics
=
Variable selection heuristics
phaseheuristics
=
Phase selection policy for a given variable
reader
=
Reader responsible for feeding the solver
\ No newline at end of file
reader
=
Reader responsible for feeding the solver
solver
=
The complexity hierarchy of solvers in Sat4j
solutionlistener
=
A listener called when a model is found by the solver
\ No newline at end of file
org.sat4j.core/src/main/java/org/sat4j/DecisionMode.java
View file @
e1e01226
...
...
@@ -31,6 +31,7 @@ package org.sat4j;
import
java.io.PrintWriter
;
import
org.sat4j.annotations.Feature
;
import
org.sat4j.reader.Reader
;
import
org.sat4j.specs.AssignmentOrigin
;
import
org.sat4j.specs.ILogAble
;
...
...
@@ -46,6 +47,7 @@ import org.sat4j.tools.Backbone;
* @author leberre
*
*/
@Feature
(
"solutionlistener"
)
final
class
DecisionMode
implements
ILauncherMode
{
private
ExitCode
exitCode
=
ExitCode
.
UNKNOWN
;
private
int
nbSolutionFound
;
...
...
org.sat4j.core/src/main/java/org/sat4j/OptimizationMode.java
View file @
e1e01226
...
...
@@ -31,6 +31,7 @@ package org.sat4j;
import
java.io.PrintWriter
;
import
org.sat4j.annotations.Feature
;
import
org.sat4j.core.Vec
;
import
org.sat4j.core.VecInt
;
import
org.sat4j.reader.Reader
;
...
...
@@ -50,6 +51,7 @@ import org.sat4j.tools.LexicoDecorator;
* @author leberre
*
*/
@Feature
(
"solutionlistener"
)
final
class
OptimizationMode
implements
ILauncherMode
{
private
int
nbSolutions
;
private
ExitCode
exitCode
=
ExitCode
.
UNKNOWN
;
...
...
org.sat4j.core/src/main/java/org/sat4j/tools/CheckMUSSolutionListener.java
View file @
e1e01226
...
...
@@ -35,6 +35,7 @@ import java.util.List;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.sat4j.annotations.Feature
;
import
org.sat4j.core.ASolverFactory
;
import
org.sat4j.core.VecInt
;
import
org.sat4j.specs.ContradictionException
;
...
...
@@ -42,6 +43,7 @@ import org.sat4j.specs.ISolver;
import
org.sat4j.specs.IVecInt
;
import
org.sat4j.specs.TimeoutException
;
@Feature
(
"solutionlistener"
)
public
class
CheckMUSSolutionListener
implements
SolutionFoundListener
{
private
List
<
IVecInt
>
clauses
;
...
...
org.sat4j.core/src/main/java/org/sat4j/tools/SolutionFoundListener.java
View file @
e1e01226
...
...
@@ -29,6 +29,7 @@
*******************************************************************************/
package
org.sat4j.tools
;
import
org.sat4j.annotations.Feature
;
import
org.sat4j.specs.IVecInt
;
/**
...
...
@@ -40,6 +41,7 @@ import org.sat4j.specs.IVecInt;
* @since 2.3.3
*
*/
@Feature
(
"solutionlistener"
)
public
interface
SolutionFoundListener
{
SolutionFoundListener
VOID
=
new
SolutionFoundListener
()
{
...
...
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