Examples of nextValue()


Examples of solver.variables.IntVar.nextValue()

        int ub;
        int idx = n;
        for (int i = 0; i < n; i++) {
            v = vars[i];
            ub = v.getUB();
            for (int j = v.getLB(); j <= ub; j = v.nextValue(j)) {
                if (!map.containsKey(j)) {
                    map.put(j, idx);
                    idx++;
                }
            }
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

            digraph.removeNode(i);
        }
        for (int i = 0; i < n; i++) {
            v = vars[i];
            ub = v.getUB();
            for (k = v.getLB(); k <= ub; k = v.nextValue(k)) {
                j = map.get(k);
                digraph.addArc(i, j);
            }
        }
    }
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

        int j, ub;
        IntVar v;
        for (int i = 0; i < n; i++) {
            v = vars[i];
            ub = v.getUB();
            for (int k = v.getLB(); k <= ub; k = v.nextValue(k)) {
                j = map.get(k);
                if (nodeSCC[i] != nodeSCC[j]) {
                    if (digraph.getPredOf(i).getFirstElement() == j) {
                        v.instantiateTo(k, aCause);
                    } else {
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

                    }
                }
            }
            if (!v.hasEnumeratedDomain()) {
                ub = v.getUB();
                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);
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

                        if (map.containsKey(v.getValue())) {
                            int j = map.get(v.getValue());
                            mandatories[j].add(i);
                        }
                    } else {
                        for (int k = v.getLB(); k <= ub; k = v.nextValue(k)) {
                            if (map.containsKey(k)) {
                                int j = map.get(k);
                                possibles[j].add(i);
                            }
                        }
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

                }
                poss.remove(i);
            } else {
                int newLB = v.getLB();
                int newUB = v.getUB();
                for (int val = v.getLB(); val <= newUB; val = v.nextValue(val)) {
                    if (setValues.contains(val)) {
                        newLB = val + 1;
                    } else {
                        break;
                    }
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

                    j = map.get(v.getValue());
                    min[j]++;
                    max[j]++;
                }
            } else {
                for (k = v.getLB(); k <= ub; k = v.nextValue(k)) {
                    if (map.containsKey(k)) {
                        j = map.get(k);
                        max[j]++;
                    }
                }
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

    protected void backPropForcePoss() throws ContradictionException {
        for (int i = poss.getFirstElement(); i >= 0; i = poss.getNextElement()) {
            IntVar v = vars[i];
            if (v.hasEnumeratedDomain()) {
                for (int val = v.getLB(); val <= v.getUB(); val = v.nextValue(val)) {
                    if (!setValues.contains(val)) {
                        v.removeValue(val, this);
                    }
                }
                poss.remove(i);
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

    }

    private void intersectionDomains() {
        final List<Integer> inter = new LinkedList<Integer>();
        IntVar v = vars[dVar.get(0)];
        for (int val = v.getLB(); val <= v.getUB(); val = v.nextValue(val)) {
            inter.add(val);
        }

        for (int i = 0; i < dVar.size(); i++) {
            final int next = dVar.get(i);
View Full Code Here

Examples of solver.variables.IntVar.nextValue()

            } else {
                v.updateLowerBound(values[0], this);
                v.updateUpperBound(values[values.length - 1], this);
                int newLB = v.getLB();
                int newUB = v.getUB();
                for (int val = v.getLB(); val <= newUB; val = v.nextValue(val)) {
                    if (!setValues.contains(val)) {
                        newLB = val + 1;
                    } else {
                        break;
                    }
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.