Examples of findAllSolutions()


Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1s")
    public void testBacktrack() {
        Solver s = modelit();
        long bl = 50;
        SearchMonitorFactory.limitBacktrack(s, bl);
        s.findAllSolutions();
        long bc = s.getMeasures().getBackTrackCount();
        Assert.assertEquals(bc, bl);
    }

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

Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1s")
    public void testFail() {
        Solver s = modelit();
        long fl = 50;
        SearchMonitorFactory.limitFail(s, fl);
        s.findAllSolutions();
        long fc = s.getMeasures().getFailCount();
        Assert.assertEquals(fc, fl);
    }

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

Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1s")
    public void testSolution() {
        Solver s = modelit();
        long sl = 50;
        SearchMonitorFactory.limitSolution(s, sl);
        s.findAllSolutions();
        long sc = s.getMeasures().getSolutionCount();
        Assert.assertEquals(sc, sl);
    }

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

Examples of solver.Solver.findAllSolutions()

        solver.post(ICF.arithm(bvars[2], "=", bvars[3]));
        solver.post(ICF.arithm(bvars[2], "!=", bvars[3]));
        solver.set(ISF.lexico_LB(bvars));
        ExplanationFactory.CBJ.plugin(solver, true);
        SMF.log(solver, true, true);
        solver.findAllSolutions();
    }

    @Test
    public void pigeon() {
        Solver solver = new Solver();
View Full Code Here

Examples of solver.Solver.findAllSolutions()

            }
        }
        solver.set(ISF.lexico_LB(pigeon));
        ExplanationFactory.CBJ.plugin(solver, true);
        SMF.log(solver, true, true);
        solver.findAllSolutions();
    }
}
View Full Code Here

Examples of solver.Solver.findAllSolutions()

                st.setLength(0);
                st.append("-- " + j + " ------------------------------------------------------------------------------------\n");
                for (int i = 0; i < nbIt; i++) {
                    Solver rand = modeler(n);
                    PropagationEngineFactory.values()[j].make(rand);
                    rand.findAllSolutions();
                    st.append(StringUtils.pad(String.format("%.3f ", rand.getMeasures().getInitialPropagationTimeCount()), -7, " "));
                    times[i] = rand.getMeasures().getInitialPropagationTimeCount();
                    st.append(StringUtils.pad(String.format("%d ", rand.getMeasures().getNodeCount()), -7, " "));
                    st.append(StringUtils.pad(String.format("%d ", rand.getMeasures().getBackTrackCount()), -7, " "));
                    log.info(st.toString());
View Full Code Here

Examples of solver.Solver.findAllSolutions()

    public void testattmostnminusone() {
        Solver solver = new Solver();
        BoolVar[] BVARS = VF.boolArray("BS", 4, solver);
        SatFactory.addAtMostNMinusOne(BVARS);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }

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

Examples of solver.Solver.findAllSolutions()

    public void testattmostone() {
        Solver solver = new Solver();
        BoolVar[] BVARS = VF.boolArray("BS", 4, solver);
        SatFactory.addAtMostOne(BVARS);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }

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

Examples of solver.Solver.findAllSolutions()

        int[] sols = {1, 1, 7, 24, 296, 1443};
        int[] nodes = {3, 22, 189, 1739, 17889, 189944};

        for (int i = 0; i < size.length; i++) {
            Solver sol = modeler(size[i]);
            sol.findAllSolutions();
            Assert.assertEquals(sol.getMeasures().getSolutionCount(), sols[i]);
//            Assert.assertEquals(sol.getMeasures().getNodeCount(), nodes[i]);
        }
    }
View Full Code Here

Examples of solver.Solver.findAllSolutions()

    public void testboolandarrayequalfalse() {
        Solver solver = new Solver();
        BoolVar[] BVARS = VF.boolArray("BS", 4, solver);
        SatFactory.addBoolAndArrayEqualFalse(BVARS);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }

    @Test(groups = "1s")
    public void testboolorarrayequaltrue() {
        Solver solver = new Solver();
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.