Clover Coverage Report
Coverage timestamp: mer. juin 27 2007 07:27:16 CEST
26   170   5   2
2   68   0,65   13
13     1,31  
1    
 
  SearchParams       Line # 37 26 5 46,3% 0.46341464
 
  (164)
 
1    /*
2    * SAT4J: a SATisfiability library for Java Copyright (C) 2004-2006 Daniel Le Berre
3    *
4    * Based on the original minisat specification from:
5    *
6    * An extensible SAT solver. Niklas E?n and Niklas S?rensson. Proceedings of the
7    * Sixth International Conference on Theory and Applications of Satisfiability
8    * Testing, LNCS 2919, pp 502-518, 2003.
9    *
10    * This library is free software; you can redistribute it and/or modify it under
11    * the terms of the GNU Lesser General Public License as published by the Free
12    * Software Foundation; either version 2.1 of the License, or (at your option)
13    * any later version.
14    *
15    * This library is distributed in the hope that it will be useful, but WITHOUT
16    * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17    * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
18    * details.
19    *
20    * You should have received a copy of the GNU Lesser General Public License
21    * along with this library; if not, write to the Free Software Foundation, Inc.,
22    * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23    *
24    */
25   
26    package org.sat4j.minisat.core;
27   
28    import java.io.Serializable;
29    import java.lang.reflect.Field;
30   
31    /**
32    * Some parameters used during the search.
33    *
34    * @author daniel
35    *
36    */
 
37    public class SearchParams implements Serializable {
38   
39    private static final long serialVersionUID = 1L;
40   
41    /**
42    * Default search parameters.
43    *
44    */
 
45  1708 toggle public SearchParams() {
46  1708 this(0.95, 0.999, 1.5, 100);
47    }
48   
49    /**
50    *
51    * @param conflictBound the initial conflict bound for the first restart.
52    */
 
53  107 toggle public SearchParams(int conflictBound) {
54  107 this(0.95, 0.999, 1.5, conflictBound);
55    }
56   
 
57  702 toggle public SearchParams(double confincfactor, int conflictBound) {
58  702 this(0.95, 0.999, confincfactor, conflictBound);
59    }
60   
61    /**
62    * @param d
63    * variable decay
64    * @param e
65    * clause decay
66    * @param f
67    * conflict bound increase factor
68    * @param i
69    * initialConflictBound
70    */
 
71  2517 toggle public SearchParams(double d, double e, double f, int i) {
72  2517 varDecay = d;
73  2517 claDecay = e;
74  2517 conflictBoundIncFactor = f;
75  2517 initConflictBound = i;
76    }
77   
78    /**
79    * @return la valeur de clause decay
80    */
 
81  28993 toggle public double getClaDecay() {
82  28993 return claDecay;
83    }
84   
85    /**
86    * @return la valeur de var decay
87    */
 
88  28993 toggle public double getVarDecay() {
89  28993 return varDecay;
90    }
91   
92    private double claDecay;
93   
94    private double varDecay;
95   
96    private double conflictBoundIncFactor;
97   
98    private int initConflictBound;
99   
100    /*
101    * (non-Javadoc)
102    *
103    * @see java.lang.Object#toString()
104    */
 
105  0 toggle @Override
106    public String toString() {
107  0 StringBuilder stb = new StringBuilder();
108  0 for (Field field : SearchParams.class.getDeclaredFields()) {
109  0 if (!field.getName().startsWith("serial")) {
110  0 stb.append(field.getName());
111  0 stb.append("="); //$NON-NLS-1$
112  0 try {
113  0 stb.append(field.get(this));
114    } catch (IllegalArgumentException e) {
115  0 e.printStackTrace();
116    } catch (IllegalAccessException e) {
117  0 e.printStackTrace();
118    }
119  0 stb.append(" "); //$NON-NLS-1$
120    }
121    }
122  0 return stb.toString();
123    }
124   
125    /**
126    * @param conflictBoundIncFactor
127    * the conflictBoundIncFactor to set
128    */
 
129  0 toggle public void setConflictBoundIncFactor(double conflictBoundIncFactor) {
130  0 this.conflictBoundIncFactor = conflictBoundIncFactor;
131    }
132   
133    /**
134    * @param initConflictBound
135    * the initConflictBound to set
136    */
 
137  0 toggle public void setInitConflictBound(int initConflictBound) {
138  0 this.initConflictBound = initConflictBound;
139    }
140   
141    /**
142    * @return the conflictBoundIncFactor
143    */
 
144  9540 toggle public double getConflictBoundIncFactor() {
145  9540 return conflictBoundIncFactor;
146    }
147   
148    /**
149    * @return the initConflictBound
150    */
 
151  2587 toggle public int getInitConflictBound() {
152  2587 return initConflictBound;
153    }
154   
155    /**
156    * @param claDecay
157    * the claDecay to set
158    */
 
159  0 toggle public void setClaDecay(double claDecay) {
160  0 this.claDecay = claDecay;
161    }
162   
163    /**
164    * @param varDecay
165    * the varDecay to set
166    */
 
167  0 toggle public void setVarDecay(double varDecay) {
168  0 this.varDecay = varDecay;
169    }
170    }