Clover coverage report -
Coverage timestamp: jeu. juin 15 2006 08:24:33 CEST
file stats: LOC: 57   Methods: 5
NCLOC: 31   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ActiveLearning.java 100% 88,9% 80% 88,9%
coverage coverage
 1    /*
 2    * Created on 1 juin 2004
 3    *
 4    * To change the template for this generated file go to
 5    * Window - Preferences - Java - Code Generation - Code and Comments
 6    */
 7    package org.sat4j.minisat.learning;
 8   
 9    import org.sat4j.minisat.core.Constr;
 10    import org.sat4j.minisat.core.IOrder;
 11   
 12    /**
 13    * Learn clauses with a great number of active variables.
 14    *
 15    * @author leberre
 16    */
 17    public class ActiveLearning extends LimitedLearning {
 18   
 19    private static final long serialVersionUID = 1L;
 20   
 21    private final double percent;
 22   
 23    private IOrder order;
 24   
 25  102 public ActiveLearning() {
 26  102 this(0.95);
 27    }
 28   
 29  102 public ActiveLearning(double d) {
 30  102 this.percent = d;
 31    }
 32   
 33  102 public void setOrder(IOrder order) {
 34  102 this.order = order;
 35    }
 36   
 37    /*
 38    * (non-Javadoc)
 39    *
 40    * @see org.sat4j.minisat.LimitedLearning#learningCondition(org.sat4j.minisat.Constr)
 41    */
 42  86109 @Override
 43    protected boolean learningCondition(Constr clause) {
 44  86109 int nbactivevars = 0;
 45  86109 for (int i = 0; i < clause.size(); i++) {
 46  2498007 if (order.varActivity(clause.get(i)) > 1) {
 47  2493254 nbactivevars++;
 48    }
 49    }
 50  86109 return nbactivevars > clause.size() * percent;
 51    }
 52   
 53  0 @Override
 54    public String toString() {
 55  0 return "Limit learning to clauses containing active literals"; //$NON-NLS-1$
 56    }
 57    }