Examples of nextSetBit()


Examples of java.util.BitSet.nextSetBit()

        // on bouche jusqu'a la limite pour creer les contraintes 2
        BitSet neqs = new BitSet();
        neqs.or(precs);
        while (nbNeq > 0 && neqs.cardinality() > 0) {
            int ij = neqs.nextSetBit(0);
            int index = rand.nextInt(neqs.cardinality());
            while (index > 0) {
                ij = neqs.nextSetBit(ij + 1);
                index--;
            }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        neqs.or(precs);
        while (nbNeq > 0 && neqs.cardinality() > 0) {
            int ij = neqs.nextSetBit(0);
            int index = rand.nextInt(neqs.cardinality());
            while (index > 0) {
                ij = neqs.nextSetBit(ij + 1);
                index--;
            }
            assert (ij > -1);
            graph[ij / n][ij % n] = 2;
            neqs.set(ij, false);
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        }

        for (int i = 0; i < alldiffLayers.length; i++) {
            BitSet disjoint = alldiffLayers[i];
            IntVar[] tvars = new IntVar[disjoint.cardinality()];
            for (int k = 0, j = disjoint.nextSetBit(0); j >= 0; j = disjoint.nextSetBit(j + 1), k++) {
                tvars[k] = vars[j];
            }
            solver.post(IntConstraintFactory.alldifferent(tvars, "BC"));
        }
    }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        }

        for (int i = 0; i < alldiffLayers.length; i++) {
            BitSet disjoint = alldiffLayers[i];
            IntVar[] tvars = new IntVar[disjoint.cardinality()];
            for (int k = 0, j = disjoint.nextSetBit(0); j >= 0; j = disjoint.nextSetBit(j + 1), k++) {
                tvars[k] = vars[j];
            }
            solver.post(IntConstraintFactory.alldifferent(tvars, "BC"));
        }
    }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        layers[nbC - 1] = new BitSet(nbS);
        layers[nbC - 1].set(nbS - 1, true);
        available.set(nbS - 1, false);


        for (int i = available.nextSetBit(0); i >= 0; i = available.nextSetBit(i + 1)) {
            int layer = 1 + rand.nextInt(nbC - 2);
            layers[layer].set(i, true);
            available.set(i, false);
        }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        layers[nbC - 1] = new BitSet(nbS);
        layers[nbC - 1].set(nbS - 1, true);
        available.set(nbS - 1, false);


        for (int i = available.nextSetBit(0); i >= 0; i = available.nextSetBit(i + 1)) {
            int layer = 1 + rand.nextInt(nbC - 2);
            layers[layer].set(i, true);
            available.set(i, false);
        }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

            succs[l] = new BitSet(nbS);
        }

        for (int l = 0; l < layers.length - 1; l++) {
            BitSet layer = layers[l];
            for (int i = layer.nextSetBit(0); i >= 0; i = layer.nextSetBit(i + 1)) {
                BitSet layer2 = layers[l + 1];
                for (int j = layer2.nextSetBit(0); j >= 0; j = layer2.nextSetBit(j + 1)) {
                    succs[i].set(j, true);
                }
            }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

            succs[l] = new BitSet(nbS);
        }

        for (int l = 0; l < layers.length - 1; l++) {
            BitSet layer = layers[l];
            for (int i = layer.nextSetBit(0); i >= 0; i = layer.nextSetBit(i + 1)) {
                BitSet layer2 = layers[l + 1];
                for (int j = layer2.nextSetBit(0); j >= 0; j = layer2.nextSetBit(j + 1)) {
                    succs[i].set(j, true);
                }
            }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        for (int l = 0; l < layers.length - 1; l++) {
            BitSet layer = layers[l];
            for (int i = layer.nextSetBit(0); i >= 0; i = layer.nextSetBit(i + 1)) {
                BitSet layer2 = layers[l + 1];
                for (int j = layer2.nextSetBit(0); j >= 0; j = layer2.nextSetBit(j + 1)) {
                    succs[i].set(j, true);
                }
            }
        }
View Full Code Here

Examples of java.util.BitSet.nextSetBit()

        for (int l = 0; l < layers.length - 1; l++) {
            BitSet layer = layers[l];
            for (int i = layer.nextSetBit(0); i >= 0; i = layer.nextSetBit(i + 1)) {
                BitSet layer2 = layers[l + 1];
                for (int j = layer2.nextSetBit(0); j >= 0; j = layer2.nextSetBit(j + 1)) {
                    succs[i].set(j, true);
                }
            }
        }
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.