Commit 64eefd49 authored by leberre's avatar leberre

Fixed potentially problematic rounding issue. Uncommented an important feature...

Fixed potentially problematic rounding issue. Uncommented an important feature of the dynamic restart strategy.

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@1707 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent 88f87a1d
......@@ -77,11 +77,13 @@ public class Glucose21Restarts implements RestartStrategy {
bufferLBD.push(lbd);
sumOfAllLBD += lbd;
bufferTrail.push(trailLevel);
// if (stats.conflicts > 10000 && bufferTrail.isFull()) {
// && trailLevel > 1.4 * bufferTrail.average()) {
// System.out.println("*");
// bufferLBD.clear();
// }
// was
// ... trailLevel > 1.4 * bufferTrail.average()
// uses now only integers to avoid rounding issues
if (stats.conflicts > 10000 && bufferTrail.isFull()
&& trailLevel * 5 > 7 * bufferTrail.average()) {
bufferLBD.clear();
}
}
public void init(SearchParams params) {
......@@ -93,8 +95,11 @@ public class Glucose21Restarts implements RestartStrategy {
}
public boolean shouldRestart() {
// was
// ... && bufferLBD.average() * 0.8 > sumOfAllLBD / stats.conflicts
// uses now only integers to avoid rounding issues
return bufferLBD.isFull()
&& bufferLBD.average() * 0.8 > sumOfAllLBD / stats.conflicts;
&& bufferLBD.average() * stats.conflicts * 4 > sumOfAllLBD * 5;
}
public void onRestart() {
......
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