Examples of Scalar


Examples of solver.constraints.nary.sum.Scalar

            {
                IntVar x = VariableFactory.enumerated("x", 0, 2, ref);
                IntVar y = VariableFactory.enumerated("y", 0, 2, ref);
                IntVar z = VariableFactory.enumerated("z", -2, 2, ref);
                IntVar az = VariableFactory.enumerated("az", 0, 2, ref);
                ref.post(new Scalar(new IntVar[]{x, y}, new int[]{1, -1}, z, 1));
                ref.post(IntConstraintFactory.absolute(az, z));
                ref.post(IntConstraintFactory.alldifferent(new IntVar[]{x, y, az}, "BC"));
                ref.set(IntStrategyFactory.random_bound(new IntVar[]{x, y, az}, seed));
            }
            {
View Full Code Here

Examples of solver.constraints.nary.sum.Scalar

            {
                IntVar[] x = VariableFactory.enumeratedArray("x", k, 0, k - 1, ref);
                IntVar[] y = VariableFactory.enumeratedArray("y", k - 1, -(k - 1), k - 1, ref);
                IntVar[] t = VariableFactory.enumeratedArray("t", k - 1, 0, k - 1, ref);
                for (int i = 0; i < k - 1; i++) {
                    ref.post(new Scalar(new IntVar[]{x[i + 1], x[i]}, new int[]{1, -1}, y[i], 1));
                    ref.post(IntConstraintFactory.absolute(t[i], y[i]));
                }
                ref.post(IntConstraintFactory.alldifferent(x, "BC"));
                ref.post(IntConstraintFactory.alldifferent(t, "BC"));
                ref.post(IntConstraintFactory.arithm(x[1], ">", x[0]));
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.