Commit 33b77655 authored by Daniel Le Berre's avatar Daniel Le Berre
Browse files

removed deprecated methods ISolver.printStats()

parent 2bbf7264
Pipeline #20207 passed with stages
in 52 minutes and 12 seconds
......@@ -29,7 +29,6 @@
*******************************************************************************/
package org.sat4j.specs;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.Map;
......@@ -326,31 +325,6 @@ public interface ISolver extends IProblem, Serializable {
*/
void reset();
/**
* Display statistics to the given output stream Please use writers instead
* of stream.
*
* @param out
* @param prefix
* the prefix to put in front of each line
* @see #printStat(PrintWriter, String)
*/
@Deprecated
void printStat(PrintStream out, String prefix);
/**
* Display statistics to the given output writer
*
* @param out
* @param prefix
* the prefix to put in front of each line
* @since 1.6
* @deprecated using the prefix does no longer makes sense because the
* solver owns it.
*/
@Deprecated
void printStat(PrintWriter out, String prefix);
/**
* Display statistics to the given output writer
*
......
......@@ -29,7 +29,6 @@
*******************************************************************************/
package org.sat4j.tools;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
......@@ -243,26 +242,6 @@ public class ManyCore<S extends ISolver> implements ISolver, OutcomeListener,
return result;
}
@Deprecated
public void printStat(PrintStream out, String prefix) {
for (var i = 0; i < this.numberOfSolvers; i++) {
out.printf(
"%s>>>>>>>>>> Solver number %d (%d answers) <<<<<<<<<<<<<<<<<<%n",
prefix, i, this.solversStats.get(i).getValue());
this.solvers.get(i).printStat(out, prefix);
}
}
@Deprecated
public void printStat(PrintWriter out, String prefix) {
for (var i = 0; i < this.numberOfSolvers; i++) {
out.printf(
"%s>>>>>>>>>> Solver number %d (%d answers) <<<<<<<<<<<<<<<<<<%n",
prefix, i, this.solversStats.get(i).getValue());
this.solvers.get(i).printStat(out, prefix);
}
}
public boolean removeConstr(IConstr c) {
if (c instanceof ConstrGroup) {
ConstrGroup group = (ConstrGroup) c;
......
......@@ -29,7 +29,6 @@
*******************************************************************************/
package org.sat4j.tools;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Map;
......@@ -177,22 +176,6 @@ public abstract class SolverDecorator<T extends ISolver> implements ISolver {
return this.solver.toString();
}
/*
* (non-Javadoc)
*
* @see org.sat4j.specs.ISolver#printStat(java.io.PrintStream,
* java.lang.String)
*/
@Deprecated
public void printStat(PrintStream out, String prefix) {
this.solver.printStat(out, prefix);
}
@Deprecated
public void printStat(PrintWriter out, String prefix) {
this.solver.printStat(out, prefix);
}
public void printStat(PrintWriter out) {
this.solver.printStat(out);
}
......
......@@ -78,7 +78,7 @@ public class DeletionStrategy implements MinimizationStrategy {
System.out.print(" ");
}
System.out.println();
solver.printStat(new PrintWriter(System.out, true), "c ");
solver.printStat(new PrintWriter(System.out, true));
}
for (var i = 0; i < firstExplanation.size();) {
if (assumps.contains(firstExplanation.get(i))) {
......
......@@ -82,6 +82,5 @@ public class TestGroupedTimeoutModelEnumeration {
this.solver.model(); // needed to discard that solution
}
this.solver.printStat(System.out, ">");
}
}
......@@ -29,7 +29,6 @@
*******************************************************************************/
package org.sat4j.pb.core;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
......@@ -339,16 +338,6 @@ public class ObjectiveReducerPBSolverDecorator implements IPBSolver {
decorated.reset();
}
@SuppressWarnings("deprecation")
public void printStat(PrintStream out, String prefix) {
decorated.printStat(out, prefix);
}
@SuppressWarnings("deprecation")
public void printStat(PrintWriter out, String prefix) {
decorated.printStat(out, prefix);
}
public void printStat(PrintWriter out) {
decorated.printStat(out);
}
......
package org.sat4j.pb.multiobjective;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
......@@ -392,16 +391,6 @@ public class SumLeximinDecompositionOWAOptimizer
return solver.nVars();
}
@SuppressWarnings("deprecation")
public void printStat(PrintStream out, String prefix) {
solver.printStat(out, prefix);
}
@SuppressWarnings("deprecation")
public void printStat(PrintWriter out, String prefix) {
solver.printStat(out, prefix);
}
public void printStat(PrintWriter out) {
solver.printStat(out);
}
......
package org.sat4j.pb.tools;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
......@@ -241,18 +240,6 @@ public class PreprocCardConstrLearningSolver<S extends IPBSolver>
return this.solvers.get(solverIndex).getStat();
}
@Override
@Deprecated
public void printStat(PrintStream out, String prefix) {
this.solvers.get(0).printStat(out, prefix);
}
@Override
@Deprecated
public void printStat(PrintWriter out, String prefix) {
this.solvers.get(0).printStat(out, prefix);
}
@Override
public boolean isSatisfiable() throws TimeoutException {
if (!initDone) {
......
......@@ -3,6 +3,7 @@ package org.sat4j.sat;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import org.apache.commons.cli.CommandLine;
......@@ -519,7 +520,7 @@ public class KTHLauncher {
// stop the solver before displaying solutions
optimizer.expireTimeout();
optimizer.printStat(System.out, "c ");
optimizer.printStat(new PrintWriter(System.out));
}
};
Runtime.getRuntime().addShutdownHook(shutdownHook);
......
Supports Markdown
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