Commit 6b531087 authored by leberre's avatar leberre
Browse files

Using anonymous inner class instead of using main class as SolutionListener.

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@1680 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent aba92b7b
......@@ -43,8 +43,7 @@ import org.sat4j.tools.xplain.HighLevelXplain;
import org.sat4j.tools.xplain.MinimizationStrategy;
import org.sat4j.tools.xplain.Xplain;
public class MUSLauncher extends AbstractLauncher implements
SolutionFoundListener {
public class MUSLauncher extends AbstractLauncher {
/**
*
......@@ -154,7 +153,21 @@ public class MUSLauncher extends AbstractLauncher implements
+ wallclocktime);
double beginmus = System.currentTimeMillis();
if (allMuses != null) {
allMuses.computeAllMUSes(this);
allMuses.computeAllMUSes(new SolutionFoundListener() {
public void onSolutionFound(int[] solution) {
}
public void onSolutionFound(IVecInt solution) {
System.out.printf("\r found mus number %d",
++muscount);
out.print(ILauncherMode.SOLUTION_PREFIX);
reader.decode(solution.toArray(), out);
out.println();
}
public void onUnsatTermination() {
}
});
log("All MUSes computation wall clock time (in seconds) : "
+ (System.currentTimeMillis() - beginmus) / 1000.0);
} else {
......@@ -189,17 +202,4 @@ public class MUSLauncher extends AbstractLauncher implements
lanceur.run(args);
System.exit(lanceur.getExitCode().value());
}
public void onSolutionFound(int[] solution) {
}
public void onSolutionFound(IVecInt solution) {
System.out.printf("\r found mus number %d", ++muscount);
this.out.print(ILauncherMode.SOLUTION_PREFIX);
this.reader.decode(solution.toArray(), this.out);
this.out.println();
}
public void onUnsatTermination() {
}
}
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