Clover coverage report -
Coverage timestamp: jeu. juin 15 2006 08:24:33 CEST
file stats: LOC: 98   Methods: 6
NCLOC: 53   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LanceurPseudo2005.java 0% 0% 0% 0%
coverage
 1    /*
 2    * Created on 14 mars 2005
 3    *
 4    * TODO To change the template for this generated file go to Window -
 5    * Preferences - Java - Code Style - Code Templates
 6    */
 7    package org.sat4j;
 8   
 9    import static java.lang.System.out;
 10   
 11    import org.sat4j.minisat.SolverFactory;
 12    import org.sat4j.minisat.core.IOrder;
 13    import org.sat4j.minisat.core.Solver;
 14    import org.sat4j.minisat.orders.VarOrderHeapObjective;
 15    import org.sat4j.opt.PseudoOptDecorator;
 16    import org.sat4j.reader.OPBReader2005;
 17    import org.sat4j.reader.OPBReader2006;
 18    import org.sat4j.reader.ObjectiveFunction;
 19    import org.sat4j.reader.Reader;
 20    import org.sat4j.specs.IProblem;
 21    import org.sat4j.specs.ISolver;
 22    import org.sat4j.specs.TimeoutException;
 23   
 24    /**
 25    * Launcher especially dedicated to the pseudo boolean 05 evaluation (@link
 26    * http://www.cril.univ-artois.fr/PB05/).
 27    *
 28    * @author mederic
 29    */
 30    public class LanceurPseudo2005 extends AbstractOptimizationLauncher {
 31   
 32    /**
 33    *
 34    */
 35    private static final long serialVersionUID = 1L;
 36   
 37    /**
 38    * Lance le prouveur sur un fichier Dimacs
 39    *
 40    * @param args
 41    * doit contenir le nom d'un fichier Dimacs, eventuellement
 42    * compress?.
 43    */
 44  0 public static void main(String[] args) {
 45  0 AbstractLauncher lanceur = new LanceurPseudo2005();
 46  0 lanceur.run(args);
 47  0 System.exit(lanceur.getExitCode().value());
 48    }
 49   
 50    protected ObjectiveFunction obfct;
 51   
 52    /*
 53    * (non-Javadoc)
 54    *
 55    * @see org.sat4j.Lanceur#createReader(org.sat4j.specs.ISolver)
 56    */
 57  0 @Override
 58    protected Reader createReader(ISolver solver, String problemname) {
 59  0 return new OPBReader2006(solver);
 60    }
 61   
 62   
 63  0 @Override
 64    protected void solve(IProblem problem) throws TimeoutException {
 65  0 ObjectiveFunction obj = ((OPBReader2005)getReader()).getObjectiveFunction();
 66  0 ((PseudoOptDecorator)problem).setObjectTiveFunction(obj);
 67  0 IOrder order = ((Solver)((PseudoOptDecorator)problem).decorated()).getOrder();
 68  0 if (order instanceof VarOrderHeapObjective) {
 69  0 ((VarOrderHeapObjective)order).setObjectiveFunction(obj);
 70    }
 71  0 super.solve(problem);
 72    }
 73   
 74   
 75    /*
 76    * (non-Javadoc)
 77    *
 78    * @see org.sat4j.Lanceur#configureSolver(java.lang.String[])
 79    */
 80  0 @Override
 81    protected ISolver configureSolver(String[] args) {
 82  0 ISolver solver = new PseudoOptDecorator(SolverFactory.newMiniOPBClauseCardConstrMaxSpecificOrder());//SolverFactory.newMiniOPBClauseCardMin());//
 83  0 solver.setTimeout(Integer.MAX_VALUE);
 84  0 out.println(solver.toString(COMMENT_PREFIX)); //$NON-NLS-1$
 85  0 return solver;
 86    }
 87   
 88  0 @Override
 89    protected void usage() {
 90  0 out.println("java -jar sat4jPseudo instancename.opb"); //$NON-NLS-1$
 91    }
 92   
 93  0 @Override
 94    protected String getInstanceName(String[] args) {
 95    assert args.length == 1;
 96  0 return args[0];
 97    }
 98    }