Package solver

Examples of solver.Solver.nextSolution()


        solver.post(SCF.subsetEq(new SetVar[]{v1, v2}));
        solver.set(SetStrategyFactory.force_first(new SetVar[]{v1, v2}));
        if (solver.findSolution()) {
            do {
//                System.out.println(v1 + " subseteq " + v2);
            } while (solver.nextSolution());
        }
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 4);
    }

    @Test(groups = "1s")
View Full Code Here


                "=",
                VF.minus(VF.bool("bool", solver))));
        if (solver.findSolution()) {
            do {
//        System.out.println(solver);
            } while (solver.nextSolution());
        }
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 2);
    }

    @Test(groups = "1s")
View Full Code Here

            int index = 0;
            do {
                index++;
//                System.out.println(index + " : a=" + a.getValue() + ", b=" + b.getValue() + ",c= " + c.getValue());
            }
            while (solver.nextSolution());
//            System.out.println("nombre total de solutions = " + index);
        }
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 7);
    }
View Full Code Here

                popAll(stack, solver);
                push(ICF.arithm(lbA, "=", bestA), stack, solver);
                push(ICF.arithm(lbB, "=", bestB), stack, solver);
                push(strictlyBetter, stack, solver);
            } while (solver.nextSolution());

            popAll(stack, solver);

            push(ICF.arithm(a, "=", bestA), stack, solver);
            push(ICF.arithm(b, "=", bestB), stack, solver);
View Full Code Here

            if (solver.findSolution()) {
                do {
                    //System.out.println("Found pareto optimal solution: " + a + ", " + b + ", " + c);
                    nbSolution++;
                } while (solver.nextSolution());
            }

            popAll(stack, solver);

            solver.getEngine().flush();
View Full Code Here

        int count = 0;
        if (solver.findSolution()) {
            do {
                count++;
//                System.out.println(b1 + " " + b2);
            } while (solver.nextSolution());
        }
        Assert.assertEquals(count, 2);
    }

  @Test(groups = "1s")
View Full Code Here

        s.post(c);
        //SearchMonitorFactory.log(s, true, true);
        if (s.findSolution()) {
            do {
                Assert.assertEquals(ESat.TRUE, c.isSatisfied());
            } while (s.nextSolution());
        }

    }

View Full Code Here

        s.post(SCF.member(VF.one(s), set));
        s.set(ISF.minDom_UB(bool));
        if (s.findSolution()) {
            do {
//              System.out.println(bool + " : " + set + " : " + s.isSatisfied());
            } while (s.nextSolution());
        }
        Assert.assertEquals(s.getMeasures().getSolutionCount(), 1);
    }

    @Test(groups = "1s")
View Full Code Here

                if (tuple[i] == val) checkocc++;
            }
            if (checkocc == tuple[tuple.length - 1]) {
                tuples.add(tuple);
            }
        } while (solver.nextSolution() == Boolean.TRUE);

        IntVar[] newvs = new IntVar[vs.length + 1];
        System.arraycopy(vs, 0, newvs, 0, vs.length);
        newvs[vs.length] = occ;
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.