Package solver

Examples of solver.Solver.propagate()


            X[0][1].updateLowerBound(1, Cause.Null);
            X[1][0].updateLowerBound(1, Cause.Null);
            X[2][1].updateLowerBound(1, Cause.Null);
            solver.propagate();
            X[2][1].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException e) {
            Assert.fail();
        }
    }
View Full Code Here


        BoolVar[] bvars = VariableFactory.boolArray("b", 2, solver);
        LogOp tree = LogOp.or(bvars[0], bvars[1]);
        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[1].instantiateTo(0, Cause.Null);
            bvars[0].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
View Full Code Here

        try {
            solver.propagate();
            bvars[1].instantiateTo(0, Cause.Null);
            bvars[0].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
        }
    }
View Full Code Here

        BoolVar[] bvars = VariableFactory.boolArray("b", 2, solver);
        LogOp tree = LogOp.or(bvars[0], bvars[1]);
        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[1].instantiateTo(1, Cause.Null);
            bvars[0].instantiateTo(0, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
View Full Code Here

        try {
            solver.propagate();
            bvars[1].instantiateTo(1, Cause.Null);
            bvars[0].instantiateTo(0, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
        }
    }
View Full Code Here

        BoolVar[] bvars = VariableFactory.boolArray("b", 2, solver);
        LogOp tree = LogOp.or(bvars[0], bvars[1].not());
        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[0].instantiateTo(0, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
        }
View Full Code Here

        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[0].instantiateTo(0, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
        }
        Assert.assertTrue(bvars[1].isInstantiatedTo(0));
    }
View Full Code Here

        BoolVar[] bvars = VariableFactory.boolArray("b", 2, solver);
        LogOp tree = LogOp.or(bvars[0], bvars[1].not());
        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[1].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
        }
View Full Code Here

        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[1].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
            Assert.fail();
        }
        Assert.assertTrue(bvars[0].isInstantiatedTo(1));
    }
View Full Code Here

        BoolVar[] bvars = VariableFactory.boolArray("b", 3, solver);
        LogOp tree = LogOp.or(bvars[0], bvars[1].not(), bvars[2].not());
        SatFactory.addClauses(tree, solver);

        try {
            solver.propagate();
            bvars[0].instantiateTo(0, Cause.Null);
            bvars[2].instantiateTo(0, Cause.Null);
            bvars[1].instantiateTo(1, Cause.Null);
            solver.propagate();
        } catch (ContradictionException ex) {
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.