Commit 9278d3c5 authored by Daniel Le Berre's avatar Daniel Le Berre

Make more objects serializable.

parent 2fa2f2e9
Pipeline #3356 passed with stages
in 43 minutes and 6 seconds
......@@ -47,6 +47,11 @@ import org.sat4j.tools.Backbone;
*
*/
final class DecisionMode implements ILauncherMode {
/**
*
*/
private static final long serialVersionUID = 1L;
private volatile ExitCode exitCode = ExitCode.UNKNOWN;
private int nbSolutionFound;
private PrintWriter out;
......
......@@ -158,6 +158,11 @@ public class MUSLauncher extends AbstractLauncher {
double beginmus = System.currentTimeMillis();
if (allMuses != null) {
SolutionFoundListener mssListener = new SolutionFoundListener() {
/**
*
*/
private static final long serialVersionUID = 1L;
private int msscount = 0;
public void onUnsatTermination() {
......@@ -176,6 +181,11 @@ public class MUSLauncher extends AbstractLauncher {
}
};
SolutionFoundListener musListener = new SolutionFoundListener() {
/**
*
*/
private static final long serialVersionUID = 1L;
public void onSolutionFound(int[] solution) {
}
......
......@@ -51,6 +51,11 @@ import org.sat4j.tools.LexicoDecorator;
*
*/
final class OptimizationMode implements ILauncherMode {
/**
*
*/
private static final long serialVersionUID = 1L;
private int nbSolutions;
private volatile ExitCode exitCode = ExitCode.UNKNOWN;
private boolean isIncomplete = false;
......
......@@ -44,6 +44,11 @@ import org.sat4j.specs.VarMapper;
*/
public class ConstrGroup implements IConstr {
/**
*
*/
private static final long serialVersionUID = 1L;
private final IVec<IConstr> constrs = new Vec<IConstr>();
private final boolean disallowNullConstraints;
......
......@@ -29,10 +29,17 @@
*******************************************************************************/
package org.sat4j.minisat.core;
import java.io.Serializable;
/**
* @since 2.1
*/
public class Counter {
public class Counter implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private int value;
public Counter() {
......
......@@ -29,6 +29,8 @@
*******************************************************************************/
package org.sat4j.minisat.core;
import java.io.Serializable;
import org.sat4j.specs.Constr;
/**
......@@ -36,7 +38,7 @@ import org.sat4j.specs.Constr;
*
* @author leberre
*/
public interface Learner {
public interface Learner extends Serializable {
void learn(Constr c);
}
......@@ -31,6 +31,11 @@ package org.sat4j.minisat.orders;
public class ActivityBasedVariableComparator implements VariableComparator {
/**
*
*/
private static final long serialVersionUID = 1L;
private final double[] activity;
public ActivityBasedVariableComparator(double[] activity) {
......
......@@ -31,6 +31,11 @@ package org.sat4j.minisat.orders;
public class LevelAndActivityVariableComparator implements VariableComparator {
/**
*
*/
private static final long serialVersionUID = 1L;
private final double[] activity;
private final int[] level;
......@@ -40,8 +45,8 @@ public class LevelAndActivityVariableComparator implements VariableComparator {
}
public boolean preferredTo(int a, int b) {
return level[a] < level[b]
|| (level[a] == level[b] && this.activity[a] > this.activity[b]);
return level[a] < level[b] || (level[a] == level[b]
&& this.activity[a] > this.activity[b]);
}
@Override
......
......@@ -47,6 +47,11 @@ import org.sat4j.minisat.core.IPhaseSelectionStrategy;
*/
public class NaturalStaticOrder implements IOrder {
/**
*
*/
private static final long serialVersionUID = 1L;
private ILits voc;
private IPhaseSelectionStrategy phaseSelectionStrategy = new NegativeLiteralSelectionStrategy();
......
......@@ -43,6 +43,11 @@ import org.sat4j.minisat.core.IPhaseSelectionStrategy;
*/
public class TabuListDecorator implements IOrder {
/**
*
*/
private static final long serialVersionUID = 1L;
private final VarOrderHeap decorated;
private final int tabuSize;
......
......@@ -29,7 +29,9 @@
*******************************************************************************/
package org.sat4j.minisat.orders;
public interface VariableComparator {
import java.io.Serializable;
public interface VariableComparator extends Serializable {
/**
* Compare two variables according to a heuristic.
......
......@@ -29,6 +29,8 @@
*******************************************************************************/
package org.sat4j.specs;
import java.io.Serializable;
/**
* Interface for engines able to derive unit clauses for the current problem.
*
......@@ -36,10 +38,15 @@ package org.sat4j.specs;
* @since 2.3.4
*
*/
public interface UnitClauseProvider {
public interface UnitClauseProvider extends Serializable {
UnitClauseProvider VOID = new UnitClauseProvider() {
/**
*
*/
private static final long serialVersionUID = 1L;
public void provideUnitClauses(UnitPropagationListener upl) {
// do nothing
}
......
......@@ -29,6 +29,7 @@
*******************************************************************************/
package org.sat4j.specs;
import java.io.Serializable;
/**
* Interface providing the unit propagation capability.
......@@ -39,7 +40,7 @@ package org.sat4j.specs;
*
* @author leberre
*/
public interface UnitPropagationListener {
public interface UnitPropagationListener extends Serializable {
/**
* satisfies a literal
......
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