Examples of plugMonitor()


Examples of solver.Solver.plugMonitor()

    // set search strategy (ABS)
    solver.set(IntStrategyFactory.minDom_LB(kid_gift));
    // displays resolution statistics
    SearchMonitorFactory.log(solver,true,false);
    // print each solution
        solver.plugMonitor(new IMonitorSolution() {
            @Override
            public void onSolution() {
                if (LoggerFactory.getLogger("solver").isInfoEnabled()) {
                    LoggerFactory.getLogger("solver").info("*******************");
                    for (int i = 0; i < n_kids; i++) {
View Full Code Here

Examples of solver.Solver.plugMonitor()

    final IntVar[] XS = VF.enumeratedArray("XS", 4, 0, 2, solver);
    final IntVar N = VF.enumerated("N", 2, 3, solver);
    solver.post(ICF.atleast_nvalues(XS, N, false));
    SMF.log(solver, true, false);
    final BitSet values = new BitSet(3);
    solver.plugMonitor(new IMonitorSolution() {
      @Override
      public void onSolution() {
        values.clear();
        for(IntVar v:XS){
          if(!v.isInstantiated()){
View Full Code Here

Examples of solver.Solver.plugMonitor()

    final IntVar[] XS = VF.enumeratedArray("XS", 4, 0, 2, solver);
    final IntVar N = VF.enumerated("N", 2, 3, solver);
    solver.post(ICF.atmost_nvalues(XS, N, false));
    SMF.log(solver, true, false);
    final BitSet values = new BitSet(3);
    solver.plugMonitor(new IMonitorSolution() {
      @Override
      public void onSolution() {
        values.clear();
        for(IntVar v:XS){
          if(!v.isInstantiated()){
View Full Code Here

Examples of solver.Solver.plugMonitor()

        final IntVar Z = VariableFactory.enumerated("Z", 1, 2, solver);
        final Constraint c1 = IntConstraintFactory.arithm(X, "=", Y);
        final Constraint c2 = IntConstraintFactory.arithm(X, "=", Z);
        solver.post(c1);
        solver.post(c2);
        solver.plugMonitor(new IMonitorSolution() {
            @Override
            public void onSolution() {
                solver.unpost(c1);
                solver.unpost(c2);
            }
View Full Code Here

Examples of solver.Solver.plugMonitor()

        new ObjectiveStrategy(a,OptimizationPolicy.TOP_DOWN),
        ISF.minDom_LB(a));
    SMF.restartAfterEachSolution(solver);
    NogoodStoreFromSolutions ng = new NogoodStoreFromSolutions(new IntVar[]{a});
    solver.post(ng);
    solver.plugMonitor(ng);

    solver.findAllOptimalSolutions(ResolutionPolicy.MAXIMIZE, a, false);
    Assert.assertEquals(solver.hasReachedLimit(),false);
  }
}
View Full Code Here

Examples of solver.Solver.plugMonitor()

            IntVar b = VF.enumerated("b", new int[]{-1, 1, 3, 4}, s);
            IntVar c = VF.enumerated("c", new int[]{-3, 1, 4}, s);
            s.post(ICF.eucl_div(a, b, c));
            s.set(ISF.random_value(new IntVar[]{a, b, c}, i));
            //SMF.log(s, true, true);
            s.plugMonitor(new IMonitorSolution() {
                @Override
                public void onSolution() {
                    if (!ESat.TRUE.equals(s.isSatisfied())) {
                        throw new Error(s.toString());
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.