|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
FixedLengthLearning.java | - | 66,7% | 66,7% | 66,7% |
|
1 | /* | |
2 | * SAT4J: a SATisfiability library for Java | |
3 | * Copyright (C) 2004 Daniel Le Berre | |
4 | * | |
5 | * Based on the original minisat specification from: | |
6 | * | |
7 | * An extensible SAT solver. Niklas Eï¿œn and Niklas Sï¿œrensson. | |
8 | * Proceedings of the Sixth International Conference on Theory | |
9 | * and Applications of Satisfiability Testing, LNCS 2919, | |
10 | * pp 502-518, 2003. | |
11 | * | |
12 | * This library is free software; you can redistribute it and/or | |
13 | * modify it under the terms of the GNU Lesser General Public | |
14 | * License as published by the Free Software Foundation; either | |
15 | * version 2.1 of the License, or (at your option) any later version. | |
16 | * | |
17 | * This library is distributed in the hope that it will be useful, | |
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 | * Lesser General Public License for more details. | |
21 | * | |
22 | * You should have received a copy of the GNU Lesser General Public | |
23 | * License along with this library; if not, write to the Free Software | |
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
25 | * | |
26 | */ | |
27 | package org.sat4j.minisat.learning; | |
28 | ||
29 | /** | |
30 | * A learning scheme for learning constraints of size smaller than a given | |
31 | * constant. | |
32 | * | |
33 | * @author leberre | |
34 | */ | |
35 | public class FixedLengthLearning extends LimitedLearning { | |
36 | ||
37 | private static final long serialVersionUID = 1L; | |
38 | ||
39 | private final int maxlength; | |
40 | ||
41 | /** | |
42 | * | |
43 | */ | |
44 | 103 | public FixedLengthLearning(int maxlength) { |
45 | 103 | this.maxlength = maxlength; |
46 | } | |
47 | ||
48 | /* | |
49 | * (non-Javadoc) | |
50 | * | |
51 | * @see org.sat4j.minisat.LimitedLearning#learningCondition(org.sat4j.minisat.Constr) | |
52 | */ | |
53 | 103 | @Override |
54 | public void init() { | |
55 | 103 | setBound(maxlength); |
56 | } | |
57 | ||
58 | 0 | @Override |
59 | public String toString() { | |
60 | 0 | return "Limit learning to clauses of size smaller or equal to " //$NON-NLS-1$ |
61 | + maxlength; | |
62 | } | |
63 | } |
|