Package org.sat4j.specs

Examples of org.sat4j.specs.IProblem


            throws FileNotFoundException, ParseFormatException, IOException,
            ContradictionException {
        log("solving " + problemname); //$NON-NLS-1$
        log("reading problem ... "); //$NON-NLS-1$
        reader = createReader(solver, problemname);
        IProblem problem = reader.parseInstance(problemname);
        log("... done. Wall clock time " //$NON-NLS-1$
                + (System.currentTimeMillis() - beginTime) / 1000.0 + "s."); //$NON-NLS-1$
        log("#vars     " + problem.nVars()); //$NON-NLS-1$
        log("#constraints  " + problem.nConstraints()); //$NON-NLS-1$
        problem.printInfos(out,COMMENT_PREFIX);   
        return problem;
    }
View Full Code Here


            solver = configureSolver(args);
            if (solver == null)
                return;
            String instanceName = getInstanceName(args);
            beginTime = System.currentTimeMillis();
            IProblem problem = readProblem(instanceName);
            try {
                solve(problem);
            } catch (TimeoutException e) {
                log("timeout"); //$NON-NLS-1$
            }
View Full Code Here

        solver.setTimeout(3600); // 1 hour timeout
        Reader reader = new InstanceReader(solver);

        // filename is given on the command line
        try {
            final IProblem problem = reader.parseInstance(args[0]);
            if (problem.isSatisfiable()) {
                System.out.println(Messages.getString("MoreThanSAT.0")); //$NON-NLS-1$
                reader.decode(problem.model(), new PrintWriter(System.out));
                IVecInt backbone = RemiUtils.backbone(solver);
                System.out
                        .println(Messages.getString("MoreThanSAT.1") + backbone); //$NON-NLS-1$
                System.out.println(Messages.getString("MoreThanSAT.2")); //$NON-NLS-1$
                System.out.println(Messages.getString("MoreThanSAT.3") //$NON-NLS-1$
View Full Code Here

        in = new FileInputStream(filename);
      }
      if (filename.endsWith(".gz")) {
        in = new GZIPInputStream(in);
      }
      IProblem problem;
      problem = parseInstance(in);
      return problem;
    } catch (FileNotFoundException e) {
      throw e;
    } catch (ParseFormatException e) {
View Full Code Here

TOP

Related Classes of org.sat4j.specs.IProblem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.