1
2
3
4
5
6
7 package org.sat4j.minisat.learning;
8
9 import org.sat4j.minisat.constraints.cnf.WLClause;
10 import org.sat4j.minisat.core.Constr;
11 import org.sat4j.minisat.core.ILits;
12
13 public class ClauseOnlyLearning<L extends ILits> extends LimitedLearning<L> {
14
15
16
17
18 private static final long serialVersionUID = 1L;
19 private int maxpercent;
20
21 @Override
22 protected boolean learningCondition(Constr constr) {
23 return constr instanceof WLClause;
24 }
25
26 public void setLimit(int percent) {
27 maxpercent = percent;
28 }
29
30 public int getLimit() {
31 return maxpercent;
32 }
33
34 @Override
35 public String toString() {
36 return "Limit learning to clauses using watched literals only";
37 }
38 }