Commit e1e01226 authored by Daniel Le Berre's avatar Daniel Le Berre

Add solutionlistener feature.

parent b7ea93a1
Pipeline #8826 passed with stages
in 197 minutes and 26 seconds
......@@ -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
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment