Package solver.variables

Examples of solver.variables.IntVar.removeValue()


                j = map.get(k);
                if (nodeSCC[i] != nodeSCC[j]) {
                    if (matching[i] == j) {
                        v.instantiateTo(k, aCause);
                    } else {
                        v.removeValue(k, aCause);
                        digraph.removeArc(i, j);
                    }
                }
            }
        }
View Full Code Here


            if (!v.hasEnumeratedDomain()) {
                ub = v.getUB();
                for (int k = v.getLB(); k <= ub; k++) {
                    j = map.get(k);
                    if (!(digraph.arcExists(i, j) || digraph.arcExists(j, i))) {
                        v.removeValue(k, aCause);
                    }
                }
                int lb = v.getLB();
                for (int k = v.getUB(); k >= lb; k--) {
                    j = map.get(k);
View Full Code Here

                }
                int lb = v.getLB();
                for (int k = v.getUB(); k >= lb; k--) {
                    j = map.get(k);
                    if (!(digraph.arcExists(i, j) || digraph.arcExists(j, i))) {
                        v.removeValue(k, aCause);
                    }
                }
            }
        }
    }
View Full Code Here

    private void removeOnlyValues() throws ContradictionException {
        for (int i = both.nextSetBit(0); i >= 0; i = both.nextSetBit(i + 1)) {
            IntVar v = vars[i];
            if (v.hasEnumeratedDomain()) {
                for (int value : values) {
                    if (v.removeValue(value, aCause)) {
                        occs[i].add(-1);
                    }
                }
            } else {
                int lb = v.getLB();
View Full Code Here

                // so first, find the first value inside dom(v)
                while (k1 < k2 && values[k1] < lb) {
                    k1++;
                }
                // and bottom-up shaving
                while (k1 <= k2 && v.removeValue(values[k1], aCause)) {
                    occs[i].add(-1);
                    k1++;
                }
                // then find the last value inside dom(v)
                while (k2 > k1 && values[k2] > ub) {
View Full Code Here

                // then find the last value inside dom(v)
                while (k2 > k1 && values[k2] > ub) {
                    k2--;
                }
                // and top bottom shaving
                while (k2 >= k1 && v.removeValue(values[k2], aCause)) {
                    occs[i].add(-1);
                    k2--;
                }
            }
        }
View Full Code Here

                j = map.get(k);
                if (nodeSCC[i] != nodeSCC[j]) {
                    if (digraph.getPredOf(i).getFirstElement() == j) {
                        v.instantiateTo(k, aCause);
                    } else {
                        v.removeValue(k, aCause);
                        digraph.removeArc(i, j);
                    }
                }
            }
            if (!v.hasEnumeratedDomain()) {
View Full Code Here

                for (int k = v.getLB(); k <= ub; k = v.nextValue(k)) {
                    j = map.get(k);
                    if (digraph.arcExists(i, j) || digraph.arcExists(j, i)) {
                        break;
                    } else {
                        v.removeValue(k, aCause);
                    }
                }
                int lb = v.getLB();
                for (int k = ub; k >= lb; k = v.previousValue(k)) {
                    j = map.get(k);
View Full Code Here

                for (int k = ub; k >= lb; k = v.previousValue(k)) {
                    j = map.get(k);
                    if (digraph.arcExists(i, j) || digraph.arcExists(j, i)) {
                        break;
                    } else {
                        v.removeValue(k, aCause);
                    }
                }
            }
        }
    }
View Full Code Here

    protected void backPropRemPoss() throws ContradictionException {
        for (int i = poss.getFirstElement(); i >= 0; i = poss.getNextElement()) {
            IntVar v = vars[i];
            if (v.hasEnumeratedDomain()) {
                for (int value : values) {
                    v.removeValue(value, this);
                }
                poss.remove(i);
            } else {
                int newLB = v.getLB();
                int newUB = v.getUB();
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.