Package solver.variables

Examples of solver.variables.BoolVar


    }

    @Test(groups = "1s")
    public void testboolfalse() {
        Solver solver = new Solver();
        BoolVar B = VF.bool("B", solver);
        SatFactory.addFalse(B);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }
View Full Code Here


    @Test(groups = "1s")
    public void testmaxboolarraylesseqvar() {
        Solver solver = new Solver();
        BoolVar[] BVARS = VF.boolArray("BS", 3, solver);
        BoolVar T = VF.bool("T", solver);
        SatFactory.addMaxBoolArrayLessEqVar(BVARS, T);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }
View Full Code Here

    @Test(groups = "1s")
    public void testsumboolarraygreatereqvar() {
        Solver solver = new Solver();
        BoolVar[] BVARS = VF.boolArray("BS", 3, solver);
        BoolVar T = VF.bool("T", solver);
        SatFactory.addSumBoolArrayGreaterEqVar(BVARS, T);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }
View Full Code Here

    @Test(groups = "1s")
    public void testsumboolarraylesseqvar() {
        Solver solver = new Solver();
        BoolVar[] BVARS = VF.boolArray("BS", 3, solver);
        BoolVar T = VF.bool("T", solver);
        SatFactory.addSumBoolArrayLessEqVar(BVARS, T);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }
View Full Code Here

    }

    @Test(groups = "1s")
    public void testbooltrue() {
        Solver solver = new Solver();
        BoolVar B = VF.bool("B", solver);
        SatFactory.addTrue(B);
        SMF.log(solver, true, false);
        solver.findAllSolutions();
    }
View Full Code Here

        for (int seed = 0; seed < 200; seed++) {
            Random r = new Random(seed);
            double d = r.nextDouble() / 2 + 0.5;
            Solver s = new Solver();

            BoolVar b = VariableFactory.bool("b", s);
            int[][] values = DomainBuilder.buildFullDomains(2, 0, 15, r, d, false);
            IntVar x = VariableFactory.enumerated("x", values[0], s);
            IntVar y = VariableFactory.enumerated("y", values[1], s);
            IntVar[] vars = new IntVar[]{b, x, y};
View Full Code Here

    @Test(groups = "1s")
    public void testRandomMember() {
        Solver s = new Solver();

        BoolVar a = VariableFactory.bool("a", s);
        BoolVar b = VariableFactory.bool("b", s);
        BoolVar c = VariableFactory.bool("c", s);
        IntVar x = VariableFactory.enumerated("x", 1, 3, s);
        IntVar y = VariableFactory.enumerated("y", 1, 1, s);
        IntVar z = VariableFactory.enumerated("z", 1, 2, s);
        z.toString();
View Full Code Here

        for (int seed = 0; seed < 200; seed++) {
            Random r = new Random(seed);
            double d = r.nextDouble() / 2 + 0.5;
            Solver s = new Solver();

            BoolVar b = VariableFactory.bool("b", s);
            int[][] values = DomainBuilder.buildFullDomains(2, 0, 15, r, d, false);
            IntVar x = VariableFactory.enumerated("x", values[0], s);
            IntVar y = VariableFactory.enumerated("y", values[1], s);
            IntVar[] vars = new IntVar[]{b, x, y};
View Full Code Here

//                        Blist.add(b);
//                        Constraint cB = ConstraintFactory.leq(X[j], l, s2, eng2);
//                        Constraint ocB = ConstraintFactory.geq(X[j], l + 1, s2, eng2);
//                        lcstrs.add(new ReifiedConstraint(b, cB, ocB, s2, eng2));
                for (int q = p; q <= u; q++) {
                    BoolVar a = VariableFactory.bool("A" + j + "_" + p + "_" + q, s2);
                    mA[j][p - l][q - p] = a;
                    listA.add(a);

                    Constraint cA = member(X[j], p, q);
                    Constraint ocA = not_member(X[j], p, q);
View Full Code Here

    }

    @Test(groups = "1s")
    public void test_boussard1() {
        Solver solver = new Solver();
        BoolVar a = VariableFactory.bool("a", solver);
        BoolVar b = VariableFactory.bool("b", solver);
        BoolVar c = VariableFactory.bool("c", solver);

        solver.post(LogicalConstraintFactory.ifThen(
                a,
                LogicalConstraintFactory.ifThen(
                        b,
View Full Code Here

TOP

Related Classes of solver.variables.BoolVar

Copyright © 2018 www.massapicom. 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.