Package solver

Examples of solver.Solver.propagate()


                    IntConstraintFactory.arithm(VariableFactory.fixed(i, solver), "<", cp),
                    IntConstraintFactory.arithm(VariableFactory.fixed(i, solver), ">=", cp)));
        }

        try {
            solver.propagate();
            cp.updateUpperBound(5, Cause.Null);
            solver.propagate();
            bv[0].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException e) {
View Full Code Here


        }

        try {
            solver.propagate();
            cp.updateUpperBound(5, Cause.Null);
            solver.propagate();
            bv[0].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException e) {
            e.printStackTrace();
        }
View Full Code Here

        try {
            solver.propagate();
            cp.updateUpperBound(5, Cause.Null);
            solver.propagate();
            bv[0].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException e) {
            e.printStackTrace();
        }

    }
View Full Code Here

                p2 = c.getPropagator(0);
            }

            try {
                s1.propagate();
                s2.propagate();
                Assert.assertEquals(vs1[0].getDomainSize(), vs2[0].getDomainSize());
                Assert.assertEquals(vs1[1].getDomainSize(), vs2[1].getDomainSize());

                for (int j = 0; j < 1000; j++) {
                    s1.getEnvironment().worldPush();
View Full Code Here

        b[1] = VariableFactory.bounded("b2", 0, 0, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();

        } catch (ContradictionException e) {
            Assert.fail();
        }
//        SearchMonitorFactory.log(solver, true, true);
View Full Code Here

        b[1] = VariableFactory.enumerated("b3", new int[]{-3, -2}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
        Assert.assertEquals(5, a[0].getUB());
//        SearchMonitorFactory.log(solver, true, true);
View Full Code Here

        b[1] = VariableFactory.enumerated("b2", new int[]{-6, -1}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
        Assert.assertEquals(-2, a[0].getUB());
        solver.findAllSolutions();
View Full Code Here

        b[1] = VariableFactory.enumerated("b2", new int[]{-6, -1}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
            Assert.fail();
        } catch (ContradictionException e) {
        }
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 0);
    }
View Full Code Here

        b[4] = VariableFactory.enumerated("b5", new int[]{0, 1, 2}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
        }
        solver.findAllSolutions();
        Assert.assertEquals(solver.getMeasures().getSolutionCount(), 216);
    }
View Full Code Here

        b[2] = VariableFactory.enumerated("b3", new int[]{-4, 2}, solver);


        solver.post(IntConstraintFactory.lex_less(a, b));
        try {
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
        Assert.assertEquals(-1, b[0].getLB());
//        SearchMonitorFactory.log(solver, true, false);
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.