Examples of findAllSolutions()


Examples of solver.Solver.findAllSolutions()

            s = (Solver) read(file);
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        Assert.assertNotNull(s);
        s.findAllSolutions();
        Assert.assertEquals(s.getMeasures().getSolutionCount(), 92, "nb sol incorrect");
    }


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

Examples of solver.Solver.findAllSolutions()

            vars[i] = VariableFactory.enumerated("v_" + i, 0, n, s);
        }
        s.post(IntConstraintFactory.arithm(vars[0], "!=", vars[1]));

        s.set(IntStrategyFactory.lexico_LB(vars));
        s.findAllSolutions();
        long sol = s.getMeasures().getSolutionCount();
        Assert.assertEquals(sol, 6, "nb sol incorrect");

    }
View Full Code Here

Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1m")
    public void test1() throws InterruptedException {
        int n = 12;

        Solver sref = modeler(n);
        sref.findAllSolutions();
        float tref = sref.getMeasures().getTimeCount();

        int n1 = n / 2;

        Solver sm1 = modeler(n);
View Full Code Here

Examples of solver.Solver.findAllSolutions()

            vars[i] = VariableFactory.bounded("v_" + i, 0, n, s);
        }
        s.post(IntConstraintFactory.arithm(vars[0], "!=", vars[1]));
        s.set(IntStrategyFactory.lexico_LB(vars));
//        ChocoLogging.toSolution();
        s.findAllSolutions();
        long sol = s.getMeasures().getSolutionCount();
        Assert.assertEquals(sol, 6, "nb sol incorrect");
    }

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

Examples of solver.Solver.findAllSolutions()

        };

        s.post(cstrs);
        s.set(IntStrategyFactory.lexico_LB(vars));

        s.findAllSolutions();
    }

    @Test(groups = "1s")
    public void testEq() {
        testOp(2, 0, 5, 5, 29091982, Operator.EQ);
View Full Code Here

Examples of solver.Solver.findAllSolutions()

            Solver sum = sum(domains, coeffs, lb, op);
            Solver intlincomb = intlincomb(domains, coeffs, lb, op);

            sum.findAllSolutions();
            intlincomb.findAllSolutions();
            Assert.assertEquals(sum.getMeasures().getSolutionCount(), intlincomb.getMeasures().getSolutionCount());
            Assert.assertEquals(sum.getMeasures().getNodeCount(), intlincomb.getMeasures().getNodeCount());
            LoggerFactory.getLogger("test").info("({}) {}ms vs {}ms",
                    op, sum.getMeasures().getTimeCount(), intlincomb.getMeasures().getTimeCount());
        }
View Full Code Here

Examples of solver.Solver.findAllSolutions()

    }

    @Test(groups = "1s")
    public void testUSum1() {
        Solver sumleq = sum(new int[][]{{-2, 3}}, new int[]{-2}, -6, -1);
        sumleq.findAllSolutions();
    }

    /**
     * Default propagation test:
     * When an opposite var is declared, the lower (resp. upper) bound modification
View Full Code Here

Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1s")
    public void testTime() {
        Solver s = modelit();
        long tl = 500;
        SearchMonitorFactory.limitTime(s, tl);
        s.findAllSolutions();
    int tc = (int)(s.getMeasures().getTimeCount()*1000);
        Assert.assertTrue(tl - (tl * 5 / 100) <= tc && tc <= tl + (tl * 5 / 100), tl + " vs. " + tc);
    }

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

Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1s")
    public void testThreadTime() {
        Solver s = modelit();
        long tl = 500;
        SearchMonitorFactory.limitThreadTime(s, tl);
        s.findAllSolutions();
        int tc = (int)(s.getMeasures().getTimeCount()*1000);
        Assert.assertTrue(tl - (tl * 10 / 100) <= tc && tc <= tl + (tl * 10 / 100), tl + " vs. " + tc);
    }

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

Examples of solver.Solver.findAllSolutions()

    @Test(groups = "1s")
    public void testNode() {
        Solver s = modelit();
        long nl = 50;
        SearchMonitorFactory.limitNode(s, nl);
        s.findAllSolutions();
        long nc = s.getMeasures().getNodeCount();
        Assert.assertEquals(nc, nl);
    }

    @Test(groups = "1s")
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.