Package solver

Examples of solver.Solver.findAllSolutions()


        IntVar X = VF.enumerated("X", 1, 3, solver);
        IntVar Y = VF.enumerated("Y", -1, 1, solver);
        IntVar Z = VF.enumerated("Z", 2, 3, solver);
        solver.post(ICF.eucl_div(X, Y, Z));
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }

    @Test(groups = "1s")
    public void testmaximum() {
        Solver solver = new Solver();
View Full Code Here


        IntVar MAX = VF.enumerated("MAX", 1, 3, solver);
        IntVar Y = VF.enumerated("Y", -1, 1, solver);
        IntVar Z = VF.enumerated("Z", 2, 3, solver);
        solver.post(ICF.maximum(MAX, Y, Z));
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }

    @Test(groups = "1s")
    public void testminimum() {
        Solver solver = new Solver();
View Full Code Here

    @Test(groups = "1m")
    public void testBinary() {
        log.info("modelBinary {}", parameters());
        Solver s = modeler(new NQueenBinary(), size);
        s.findAllSolutions();
        assertIt(s);
    }

    @Test(groups = "1m")
    public void testLinBinary() {
View Full Code Here

    @Test(groups = "1m")
    public void testLinBinary() {
        log.info("modelBinary {}", parameters());
        Solver s = modeler(new NQueenLinearBinary(), size);
        s.findAllSolutions();
        assertIt(s);
        //s.findSolution();
    }

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

    @Test(groups = "1m")
    public void testGlobalBinary() {
        log.info("modelBinaryGlobal {}", parameters());
        Solver s = modeler(new NQueenBinaryGlobal(), size);
        s.findAllSolutions();
        assertIt(s);
    }

    @Test(groups = "1m")
    public void testGlobal() throws ContradictionException {
View Full Code Here

    @Test(groups = "1m")
    public void testGlobal() throws ContradictionException {
        log.info("modelGlobal {}", parameters());
        Solver s = modeler(new NQueenGlobal(), size);
        s.findAllSolutions();
        assertIt(s);
    }

    @Test(groups = "1m")
    public void testDualBinary() {
View Full Code Here

    @Test(groups = "1m")
    public void testDualBinary() {
        log.info("modelDualBinary {}", parameters());
        Solver s = modeler(new NQueenDualBinary(), size);
        s.findAllSolutions();
        assertIt(s);
    }


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

    @Test(groups = "1m")
    public void testDualGlobal() {
        log.info("modelDualGlobal {}", parameters());
        Solver s = modeler(new NQueenDualGlobal(), size);
        s.findAllSolutions();
        assertIt(s);
    }

    @Test(groups = "verylong")
    public void testAll1() {
View Full Code Here

    @Test(groups = "verylong")
    public void testAll1() {
        Solver sol;
        for (int j = 4; j < 23; j++) {
            sol = modeler(new NQueenBinary(), j);
            sol.findAllSolutions();
            long nbsol = sol.getMeasures().getSolutionCount();
            long node = sol.getMeasures().getNodeCount();
            for (int t = 0; t < PropagationEngineFactory.values().length; t++) {
                sol = modeler(new NQueenBinary(), j);
                PropagationEngineFactory.values()[t].make(sol);
View Full Code Here

            long nbsol = sol.getMeasures().getSolutionCount();
            long node = sol.getMeasures().getNodeCount();
            for (int t = 0; t < PropagationEngineFactory.values().length; t++) {
                sol = modeler(new NQueenBinary(), j);
                PropagationEngineFactory.values()[t].make(sol);
                sol.findAllSolutions();
                Assert.assertEquals(sol.getMeasures().getSolutionCount(), nbsol);
                Assert.assertEquals(sol.getMeasures().getNodeCount(), node);
            }

        }
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.