Package hampi.stp

Examples of hampi.stp.STPSolver


  private AbstractSolver solver;
  public boolean         validateSolution = true;
  public boolean         verbose          = false;

  public Hampi(){
    solver = new STPSolver();
  }
View Full Code Here


  private AbstractSolver[] all(){
    return new AbstractSolver[] { stp() };
  }

  private STPSolver stp(){
    return new STPSolver();
  }
View Full Code Here

    Hampi h = new Hampi();
    Expression v = h.varExpr("v0");
    Constraint c1 = h.regexpConstraint(v, true, h.starRegexp(h.constRegexp("bb")));
    Constraint c2 = h.regexpConstraint(v, true, h.constRegexp("bb"));
    Constraint c = h.andConstraint(c1, c2);
    h.setSolver(new STPSolver());
    Solution solve = h.solve(c, 2);
    System.out.println(solve);

    Solution s = Solution.createSAT();
    s.setValue((VariableExpression) v, "bb");
View Full Code Here

    long seed = System.currentTimeMillis();
    System.out.println("seed:" + seed);
    Randomness.reset(seed);
    for (int i = 0; i < 100; i++){
      Hampi h = new Hampi();
      h.setSolver(new STPSolver());

      Constraint c = null;
      Solution solSTP = null;
      Solution solMona = null;
      try{
        //        System.out.println("-------------------------------------------");
        System.out.println(" " + i);
        int size = 1 + Randomness.nextRandomInt(2);
        Constraint[] cs = new Constraint[size];
        int varNum = 1;//just 1 var
        cs[0] = randomConstraint(varNum, h);
        for (int j = 1; j < cs.length; j++){
          cs[j] = randomConstraint(varNum, h);
        }
        c = h.andConstraint(cs);
        System.out.println("-----------------------------------------------");
        System.out.println(c.toJavaCode("h"));
        System.out.println();

        h.setSolver(new STPSolver());
        StopWatch sw = new StopWatch("Solving");
        sw.start();
        solSTP = h.solve(c, 10);
        sw.stop();
        System.out.println(sw);
View Full Code Here

import junit.framework.TestCase;

public class SolverBenchmarks extends TestCase{
  private STPSolver stp(){
    return new STPSolver();
  }
View Full Code Here

TOP

Related Classes of hampi.stp.STPSolver

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.