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

Make more objects serializable.

parent 8a3f5023
Pipeline #3354 failed with stages
in 34 minutes and 2 seconds
......@@ -29,11 +29,13 @@
*******************************************************************************/
package org.sat4j.pb.constraints.pb;
import java.io.Serializable;
/**
* Interface to post-process the assertive conflict, e.g. to convert it to a
* clause, to a cardinality.
*
*/
public interface IPostProcess {
public interface IPostProcess extends Serializable {
void postProcess(int dl, ConflictMap conflictMap);
}
\ No newline at end of file
package org.sat4j.pb.constraints.pb;
import java.io.Serializable;
import java.math.BigInteger;
import org.sat4j.minisat.core.ILits;
......@@ -12,8 +13,13 @@ import org.sat4j.minisat.core.ILits;
* @since 2.3.6
*
*/
public interface IWeakeningStrategy {
public interface IWeakeningStrategy extends Serializable {
IWeakeningStrategy UNASSIGNED_FIRST = new IWeakeningStrategy() {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public int findLiteralToRemove(ILits voc, IWatchPb wpb,
final BigInteger[] coefsBis, final int indLitImplied,
......@@ -47,6 +53,11 @@ public interface IWeakeningStrategy {
};
IWeakeningStrategy SATISFIED_FIRST = new IWeakeningStrategy() {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public int findLiteralToRemove(ILits voc, IWatchPb wpb,
final BigInteger[] coefsBis, final int indLitImplied,
......@@ -80,6 +91,11 @@ public interface IWeakeningStrategy {
};
IWeakeningStrategy ANY = new IWeakeningStrategy() {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public int findLiteralToRemove(ILits voc, IWatchPb wpb,
final BigInteger[] coefsBis, final int indLitImplied,
......
......@@ -42,6 +42,11 @@ import org.sat4j.specs.IVecInt;
*/
public class MapPb implements IDataStructurePB {
/**
*
*/
private static final long serialVersionUID = 1L;
/*
* During the process of cutting planes, pseudo-boolean constraints are
* coded with a HashMap <literal, coefficient> and a BigInteger for the
......
......@@ -36,12 +36,10 @@ import java.util.Map;
import java.util.Set;
import org.sat4j.minisat.core.ILits;
import org.sat4j.specs.Constr;
import org.sat4j.specs.ContradictionException;
import org.sat4j.specs.IVecInt;
import org.sat4j.specs.MandatoryLiteralListener;
import org.sat4j.specs.UnitPropagationListener;
import org.sat4j.specs.VarMapper;
/**
* Data structure for pseudo-boolean constraint with watched literals.
......@@ -406,186 +404,4 @@ public final class MaxWatchPbLong extends WatchPbLong {
}
return -1;
}
private static class WatchPbLongPbConstrDecorator implements PBConstr {
private final WatchPbLong cstr;
public WatchPbLongPbConstrDecorator(WatchPbLong cstr) {
this.cstr = cstr;
}
public boolean propagatePI(MandatoryLiteralListener l, int p) {
return cstr.propagatePI(l, p);
}
public boolean isAssertive(int dl) {
return cstr.isAssertive(dl);
}
public void calcReason(int p, IVecInt outReason) {
cstr.calcReason(p, outReason);
}
public int get(int i) {
return cstr.get(i);
}
public double getActivity() {
return cstr.getActivity();
}
public int getAssertionLevel(IVecInt trail, int decisionLevel) {
return cstr.getAssertionLevel(trail, decisionLevel);
}
public void incActivity(double claInc) {
cstr.incActivity(claInc);
}
public void setActivity(double d) {
cstr.setActivity(d);
}
public long slackConstraint() {
return cstr.slackConstraint();
}
public long slackConstraint(long[] theCoefs, long theDegree) {
return cstr.slackConstraint(theCoefs, theDegree);
}
public long computeLeftSide(long[] theCoefs) {
return cstr.computeLeftSide(theCoefs);
}
public long computeLeftSide() {
return cstr.computeLeftSide();
}
public boolean learnt() {
return cstr.learnt();
}
public boolean locked() {
return cstr.locked();
}
public void rescaleBy(double d) {
cstr.rescaleBy(d);
}
public void setLearnt() {
cstr.setLearnt();
}
public boolean simplify() {
return cstr.simplify();
}
public final int size() {
return cstr.size();
}
@Override
public String toString() {
return cstr.toString();
}
public void assertConstraint(UnitPropagationListener s) {
cstr.assertConstraint(s);
}
public void assertConstraintIfNeeded(UnitPropagationListener s) {
cstr.assertConstraintIfNeeded(s);
}
public void register() {
cstr.register();
}
public int[] getLits() {
return cstr.getLits();
}
public ILits getVocabulary() {
return cstr.getVocabulary();
}
public IVecInt computeAnImpliedClause() {
return cstr.computeAnImpliedClause();
}
public boolean coefficientsEqualToOne() {
return cstr.coefficientsEqualToOne();
}
@Override
public boolean equals(Object pb) {
return cstr.equals(pb);
}
@Override
public int hashCode() {
return cstr.hashCode();
}
public void forwardActivity(double claInc) {
cstr.forwardActivity(claInc);
}
public void remove(UnitPropagationListener upl) {
cstr.remove(upl);
}
public boolean propagate(UnitPropagationListener s, int p) {
return cstr.propagate(s, p);
}
public void undo(int p) {
cstr.undo(p);
}
public boolean canBePropagatedMultipleTimes() {
return cstr.canBePropagatedMultipleTimes();
}
public Constr toConstraint() {
return cstr.toConstraint();
}
public void calcReasonOnTheFly(int p, IVecInt trail,
IVecInt outReason) {
cstr.calcReasonOnTheFly(p, trail, outReason);
}
public boolean canBeSatisfiedByCountingLiterals() {
return cstr.canBeSatisfiedByCountingLiterals();
}
public int requiredNumberOfSatisfiedLiterals() {
return cstr.requiredNumberOfSatisfiedLiterals();
}
public boolean isSatisfied() {
return cstr.isSatisfied();
}
public String toString(VarMapper mapper) {
return cstr.toString(mapper);
}
public BigInteger getCoef(int literal) {
return cstr.getCoef(literal);
}
public BigInteger getDegree() {
return cstr.getDegree();
}
public BigInteger[] getCoefs() {
return cstr.getCoefs();
}
}
}
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