Commit f919c4f8 authored by leberre's avatar leberre

Fixed restarts strategies to be properly initialized in case of multiple calls to isSatisfiable.

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@1736 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent 0cb6972c
......@@ -53,7 +53,7 @@ public class FixedPeriodRestarts implements RestartStrategy {
}
public void init(SearchParams params) {
conflictCount = 0;
this.conflictCount = 0;
}
@Deprecated
......@@ -62,13 +62,11 @@ public class FixedPeriodRestarts implements RestartStrategy {
}
public boolean shouldRestart() {
if (conflictCount < period)
return false;
conflictCount = 0;
return true;
return conflictCount >= period;
}
public void onRestart() {
this.conflictCount = 0;
}
public void onBackjumpToRootLevel() {
......
......@@ -65,6 +65,9 @@ public class Glucose21Restarts implements RestartStrategy {
}
public void reset() {
sumOfAllLBD = 0;
bufferLBD.clear();
bufferTrail.clear();
}
public void newConflict() {
......@@ -88,6 +91,7 @@ public class Glucose21Restarts implements RestartStrategy {
public void init(SearchParams params) {
this.params = params;
reset();
}
public long nextRestartNumberOfConflict() {
......
......@@ -55,6 +55,7 @@ public final class MiniSATRestarts implements RestartStrategy {
public void init(SearchParams theParams) {
this.params = theParams;
this.nofConflicts = theParams.getInitConflictBound();
this.conflictcount = 0;
}
public long nextRestartNumberOfConflict() {
......
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