Clover coverage report -
Coverage timestamp: jeu. juin 15 2006 08:24:33 CEST
file stats: LOC: 123   Methods: 3
NCLOC: 70   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SolverStats.java - 39,4% 33,3% 38,9%
coverage coverage
 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   
 28    package org.sat4j.minisat.core;
 29   
 30    import java.io.PrintWriter;
 31    import java.io.Serializable;
 32    import java.lang.reflect.Field;
 33    import java.util.HashMap;
 34    import java.util.Map;
 35   
 36    /*
 37    * Created on 15 janv. 2004 To change the template for this generated file go to
 38    * Window>Preferences>Java>Code Generation>Code and Comments
 39    */
 40   
 41    public class SolverStats implements Serializable {
 42    private static final long serialVersionUID = 1L;
 43   
 44    public int starts;
 45   
 46    public long decisions;
 47   
 48    public long propagations;
 49   
 50    public long inspects;
 51   
 52    public long conflicts;
 53   
 54    public long learnedliterals;
 55   
 56    public long learnedbinaryclauses;
 57   
 58    public long learnedternaryclauses;
 59   
 60    public long learnedclauses;
 61   
 62    public long rootSimplifications;
 63   
 64    public long reducedliterals;
 65   
 66    public long changedreason;
 67   
 68    public int reduceddb;
 69   
 70  2490 public void reset() {
 71  2490 starts = 0;
 72  2490 decisions = 0;
 73  2490 propagations = 0;
 74  2490 inspects = 0;
 75  2490 conflicts = 0;
 76  2490 learnedliterals = 0;
 77  2490 learnedclauses = 0;
 78  2490 learnedbinaryclauses = 0;
 79  2490 learnedternaryclauses = 0;
 80  2490 rootSimplifications = 0;
 81  2490 reducedliterals=0;
 82  2490 changedreason=0;
 83  2490 reduceddb=0;
 84    }
 85   
 86  0 public void printStat(PrintWriter out, String prefix) {
 87  0 out.println(prefix + "starts\t\t: " + starts);
 88  0 out.println(prefix + "conflicts\t\t: " + conflicts);
 89  0 out.println(prefix + "decisions\t\t: " + decisions);
 90  0 out.println(prefix + "propagations\t\t: " + propagations);
 91  0 out.println(prefix + "inspects\t\t: " + inspects);
 92  0 out.println(prefix + "learnt literals\t: " + learnedliterals);
 93  0 out.println(prefix + "learnt binary clauses\t: "
 94    + learnedbinaryclauses);
 95  0 out.println(prefix + "learnt ternary clauses\t: "
 96    + learnedternaryclauses);
 97  0 out.println(prefix + "learnt clauses\t: " + learnedclauses);
 98  0 out.println(prefix + "root simplifications\t: "
 99    + rootSimplifications);
 100  0 out.println(prefix + "removed literals (reason simplification)\t: "
 101    + reducedliterals);
 102  0 out.println(prefix + "reason swapping (by a shorter reason)\t: "
 103    + changedreason);
 104  0 out.println(prefix + "Calls to reduceDB\t: "
 105    + reduceddb);
 106    }
 107   
 108  0 public Map<String,Number> toMap() {
 109  0 Map<String,Number> map = new HashMap<String,Number>();
 110  0 for (Field f : this.getClass().getDeclaredFields()) {
 111  0 try {
 112  0 map.put(f.getName(),(Number)f.get(this));
 113    } catch (IllegalArgumentException e) {
 114    // TODO Auto-generated catch block
 115  0 e.printStackTrace();
 116    } catch (IllegalAccessException e) {
 117    // TODO Auto-generated catch block
 118  0 e.printStackTrace();
 119    }
 120    }
 121  0 return map;
 122    }
 123    }