Examples of nextInt()


Examples of cc.mallet.util.Randoms.nextInt()

        Randoms r = new Randoms();
        FeatureSequence fs = (FeatureSequence) instance.getData();
        int[] topics = topicSequence.getFeatures();
        for (int i = 0; i < topics.length; i++) {
          int type = fs.getIndexAtPosition(i);
          topics[i] = r.nextInt(numTopics);
          typeTopicCounts[type].adjustOrPutValue(topics[i], 1, 1);
            tokensPerTopic[topics[i]]++;
        }
      }
      topicSequences.add (topicSequence);
View Full Code Here

Examples of ch.akuhn.hapax.util.ResourceStream.nextInt()

    private Resource file;
   
    public OfflineMatrix(Resource file) {
        this.file = file;
        ResourceStream in = file.open();
        rows = in.nextInt();
        columns = in.nextInt();
        in.close();
    }
   
    @Override
View Full Code Here

Examples of com.carrotsearch.hppc.XorShiftRandom.nextInt()

    {
        final Random rnd = new XorShiftRandom(0xdeadbeef);
        final int [] data = new int [10000];

        for (int i = 0; i < data.length; i++)
            data[i] = rnd.nextInt(0x100);

        int [] order = IndirectSort.mergesort(0, data.length, new IndirectComparator()
        {
            public int compare(int indexA, int indexB)
            {
View Full Code Here

Examples of com.fasterxml.storemate.store.util.BytesToStuff.nextInt()

       
        int statusFlags = reader.nextByte();
        final Compression compression = _decodeCompression(reader.nextByte());
        final int externalPathLength = reader.nextByte() & 0xFF;
       
        final int contentHash = reader.nextInt();
        final long originalLength;
        final int compressedHash;
       
        // and now get to variable parts
        if (compression != Compression.NONE) {
View Full Code Here

Examples of com.firefly.utils.ThreadLocalRandom.nextInt()

                if ((spins = spinsFor(pred, s.isData)) > 0)
                    randomYields = ThreadLocalRandom.current();
            }
            else if (spins > 0) {             // spin
                --spins;
                if (randomYields.nextInt(CHAINED_SPINS) == 0)
                    Thread.yield();           // occasionally yield
            }
            else if (s.waiter == null) {
                s.waiter = w;                 // request unpark then recheck
            }
View Full Code Here

Examples of com.google.gson.stream.JsonReader.nextInt()

        String user = null;
        if("user".equals(key)) {
          user = reader.nextString();
          reader.nextName();
        }
        int oridinal = reader.nextInt();

        Channel chan = new Channel(name, user, ChannelType.values()[oridinal]);
        instance.addChannel(chan);

        reader.endObject();
View Full Code Here

Examples of com.oltpbenchmark.distributions.ScrambledZipfianGenerator.nextInt()

       
        TweetHistogram tweet_h = new TweetHistogram();
        FlatHistogram<Integer> tweet_len_rng = new FlatHistogram<Integer>(this.rng(), tweet_h);
       
        for (long i = 0; i < this.num_tweets; i++) {
            int uid = zy.nextInt();
            tweetInsert.setLong(1, i);
            tweetInsert.setInt(2, uid);
            tweetInsert.setString(3, TextGenerator.randomStr(rng(), tweet_len_rng.nextValue()));
            tweetInsert.setNull(4, java.sql.Types.DATE);
            tweetInsert.addBatch();
View Full Code Here

Examples of com.oltpbenchmark.distributions.ZipfianGenerator.nextInt()

        ZipfianGenerator zipfFollowee = new ZipfianGenerator(this.num_users,1.75);
        ZipfianGenerator zipfFollows = new ZipfianGenerator(this.num_follows,1.75);
        List<Integer> followees = new ArrayList<Integer>();
        for (int follower = 0; follower < this.num_users; follower++) {
            followees.clear();
            int time = zipfFollows.nextInt();
            if(time==0) time=1; // At least this follower will follow 1 user
            for (int f = 0; f < time; ) {
                int followee = zipfFollowee.nextInt();
                if (follower != followee && !followees.contains(followee)) {
                    followsInsert.setInt(1, follower);
View Full Code Here

Examples of com.oltpbenchmark.util.RandomDistribution.Flat.nextInt()

            if (rng().nextInt(100) < WikipediaConstants.ANONYMOUS_PAGE_UPDATE_PROB) {
                user_id = WikipediaConstants.ANONYMOUS_USER_ID;
            }
            // Otherwise figure out what user is updating this page
            else {
                user_id = z_users.nextInt();
            }
            assert(user_id != -1);
           
            // Figure out what page they're going to update
            int page_id = z_pages.nextInt();
View Full Code Here

Examples of com.oltpbenchmark.util.RandomDistribution.Zipf.nextInt()

            Zipf randomNumItems = new Zipf(profile.rng,
                       AuctionMarkConstants.ITEM_ITEMS_PER_SELLER_MIN,
                       max_items,
                       AuctionMarkConstants.ITEM_ITEMS_PER_SELLER_SIGMA);
            for (long i = 0; i < this.tableSize; i++) {
                long num_items = randomNumItems.nextInt();
                profile.users_per_itemCount.put(num_items);
            } // FOR
             if (LOG.isDebugEnabled())
                LOG.debug("Users Per Item Count:\n" + profile.users_per_itemCount);
            this.idGenerator = new UserIdGenerator(profile.users_per_itemCount, benchmark.getWorkloadConfiguration().getTerminals());
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.