Package java.util

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


        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

        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

            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

            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

        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

        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

        BitSet activeLayers = new BitSet(nbC);
        activeLayers.set(1, nbC - 1, true);
        for (int i = 0; i < nbAd; i++) {
            allDiffLayers[i] = new BitSet(nbS);
            int k = rand.nextInt(activeLayers.cardinality());
            int v = activeLayers.nextSetBit(0);
            while (k > 0) {
                v = activeLayers.nextSetBit(v + 1);
                k--;
            }
            allDiffLayers[i].or(layers[v]);
View Full Code Here

        for (int i = 0; i < nbAd; i++) {
            allDiffLayers[i] = new BitSet(nbS);
            int k = rand.nextInt(activeLayers.cardinality());
            int v = activeLayers.nextSetBit(0);
            while (k > 0) {
                v = activeLayers.nextSetBit(v + 1);
                k--;
            }
            allDiffLayers[i].or(layers[v]);
            activeLayers.set(v, false);
        }
View Full Code Here

    int timeIndex = 0;
    while(timeIndex<n*2){
      Event event = events[timeIndex++];
      switch(event.type) {
        case(START):
          for(int i=tprune.nextSetBit(0);i>=0;i=tprune.nextSetBit(i+1)){
            g.addEdge(i,event.index);
          }
          tprune.set(event.index);
          break;
        case(END):
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.