Commit 8a3f5023 authored by Daniel Le Berre's avatar Daniel Le Berre

rename stats into pbStats to avoid confusion with Solver.stats.

parent 9235c056
......@@ -65,21 +65,21 @@ public abstract class PBSolver extends Solver<PBDataStructureFactory> implements
*/
private static final long serialVersionUID = 1L;
protected PBSolverStats stats;
protected PBSolverStats pbStats;
public PBSolver(LearningStrategy<PBDataStructureFactory> learner,
PBDataStructureFactory dsf, IOrder order, RestartStrategy restarter) {
super(learner, dsf, order, restarter);
this.stats = new PBSolverStats();
initStats(this.stats);
this.pbStats = new PBSolverStats();
initStats(this.pbStats);
}
public PBSolver(LearningStrategy<PBDataStructureFactory> learner,
PBDataStructureFactory dsf, SearchParams params, IOrder order,
RestartStrategy restarter) {
super(learner, dsf, params, order, restarter);
this.stats = new PBSolverStats();
initStats(this.stats);
this.pbStats = new PBSolverStats();
initStats(this.pbStats);
}
public IConstr addPseudoBoolean(IVecInt literals, IVec<BigInteger> coeffs,
......@@ -270,7 +270,7 @@ public abstract class PBSolver extends Solver<PBDataStructureFactory> implements
System.out
.println(getLogPrefix()
+ "cleaning " + (learnedConstrs.size() - j) //$NON-NLS-1$
+ " clauses out of " + learnedConstrs.size() + "/" + PBSolver.this.stats.getConflicts()); //$NON-NLS-1$ //$NON-NLS-2$
+ " clauses out of " + learnedConstrs.size() + "/" + PBSolver.this.pbStats.getConflicts()); //$NON-NLS-1$ //$NON-NLS-2$
System.out.flush();
}
PBSolver.this.learnts.shrinkTo(j);
......
......@@ -203,7 +203,7 @@ public class PBSolverCP extends PBSolver {
protected IConflict chooseConflict(PBConstr myconfl, int level) {
return conflictFactory.createConflict(myconfl, level, noRemove,
skipAllow, postprocess, weakeningStrategy, autoDivisionStrategy,
stats);
pbStats);
}
@Override
......
......@@ -92,7 +92,7 @@ public class PBSolverCPCardLearning extends PBSolverCPLong {
return ConflictMapReduceToClause.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), PostProcessToCard.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -97,7 +97,7 @@ public class PBSolverCPClauseLearning extends PBSolverCPLong {
return ConflictMapReduceToClause.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), PostProcessToClause.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -86,7 +86,7 @@ public class PBSolverCPLong extends PBSolverCP {
return ConflictMapReduceToClause.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -92,7 +92,7 @@ public class PBSolverCPLongDivideBy2 extends PBSolverCPLong {
return ConflictMap.createConflict(myconfl, level, isNoRemove(),
isSkipAllow(), PostProcessDivideBy2.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -69,7 +69,7 @@ public class PBSolverCPLongDivideByGCD extends PBSolverCPLong {
return ConflictMap.createConflict(myconfl, level, isNoRemove(),
isSkipAllow(), PostProcessDivideBy2.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -94,7 +94,7 @@ public class PBSolverCPLongReduceToCard extends PBSolverCPLong {
return ConflictMapReduceToCard.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -92,7 +92,7 @@ public class PBSolverCPLongRounding extends PBSolverCPLong {
return ConflictMapRounding.createConflict(myconfl, level, isNoRemove(),
isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -69,7 +69,7 @@ public class PBSolverCPReduceByGCD extends PBSolverCP {
return ConflictMapReduceByGCD.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -69,7 +69,7 @@ public class PBSolverCPReduceByPowersOf2 extends PBSolverCP {
return ConflictMapReduceByPowersOf2.createConflict(myconfl, level,
isNoRemove(), isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -71,14 +71,14 @@ public class PBSolverCautious extends PBSolverCP {
@Override
protected void updateNumberOfReductions(IConflict confl) {
this.stats.incNumberOfReductions(
this.pbStats.incNumberOfReductions(
((ConflictMapSwitchToClause) confl).getNumberOfReductions());
}
@Override
protected void updateNumberOfReducedLearnedConstraints(IConflict confl) {
if (((ConflictMapSwitchToClause) confl).hasBeenReduced()) {
this.stats.incNumberOfLearnedConstraintsReduced();
this.pbStats.incNumberOfLearnedConstraintsReduced();
}
}
......
......@@ -55,7 +55,7 @@ public class PBSolverClause extends PBSolverCP {
return ConflictMapClause.createConflict(myconfl, level, isNoRemove(),
isSkipAllow(), NoPostProcess.instance(),
IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, stats);
AutoDivisionStrategy.ENABLED, pbStats);
}
@Override
......
......@@ -70,16 +70,16 @@ public class PBSolverResCP extends PBSolverCP {
@Override
boolean someCriteria() {
if (this.stats.getConflicts() == this.bound) {
if (this.pbStats.getConflicts() == this.bound) {
this.setSimplifier(NO_SIMPLIFICATION);
this.reduceDB();
this.stats.incNumberOfCP();
this.pbStats.incNumberOfCP();
return true;
} else if (this.stats.getConflicts() > this.bound) {
this.stats.incNumberOfCP();
} else if (this.pbStats.getConflicts() > this.bound) {
this.pbStats.incNumberOfCP();
return true;
} else {
this.stats.incNumberOfResolution();
this.pbStats.incNumberOfResolution();
return false;
}
}
......
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