Package hampi.utils

Examples of hampi.utils.StopWatch


   * characters). The solution is optionally verified (depending on
   * {@link #validateSolution} variable).
   */
  public Solution solve(Constraint c, int size){
    assert c != null;
    StopWatch sw = new StopWatch("Solving using " + solver.getName());
    if (verbose){
      System.out.println("Solving using " + solver.getName());
      sw.start();
    }
    Solution sol = solver.solve(c, size);
    if (verbose){
      sw.stop();
      System.out.println(sw);
    }

    if (validateSolution && sol.isSatisfiable()){
      assert sol.isValidFor(c) : "invalid solution:\n" + c + "\n" + sol;
View Full Code Here


    run(check, verbose, istream);
  }

  public static Solution run(boolean check, boolean verbose, InputStream istream) throws IOException,RecognitionException{
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    StopWatch parseTimer = new StopWatch("parsing");
    parseTimer.start();
    HProgram parse = HProgramParser.parse(baos, istream);
    parseTimer.stop();
    if (verbose){
      System.out.println(parseTimer);
    }
    if (parse == null)
      throw HampiResultException.parse("Parse errors \n" + baos.toString());
View Full Code Here

TOP

Related Classes of hampi.utils.StopWatch

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.