1
2
3
4
5
6
7 package org.sat4j.minisat.restarts;
8
9 import org.sat4j.minisat.core.RestartStrategy;
10 import org.sat4j.minisat.core.SearchParams;
11
12 public class MiniSATRestarts implements RestartStrategy {
13
14
15
16
17 private static final long serialVersionUID = 1L;
18
19 private double nofConflicts;
20
21 private SearchParams params;
22
23 public void init(SearchParams params) {
24 this.params = params;
25 nofConflicts = params.getInitConflictBound();
26 }
27
28 public long nextRestartNumberOfConflict() {
29 return Math.round(nofConflicts);
30 }
31
32 public void onRestart() {
33 nofConflicts *= params.getConflictBoundIncFactor();
34 }
35
36 @Override
37 public String toString() {
38 return "MiniSAT restarts strategy";
39 }
40 }