Examples of nextFloat()


Examples of java.util.Random.nextFloat()

      MutableSparseFloatArray fromPartial = new MutableSparseFloatArray(copy);

      // do 128 modifications
      int mods = 128;
      for (int i = 0; i < mods; i++) {
        float val = rand.nextFloat();
        idx = rand.nextInt(orig.length);
        orig[idx] = val;
        fromEmpty.set(idx, val);
        fromPartial.set(idx, val);
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

        int idx = r.nextInt(orig.length);
        if (r.nextBoolean()) {
          assertTrue("orig " + orig[idx] + " not the same as arr " + arr.get(idx) + " at idx="
              + idx, orig[idx] == arr.get(idx));
        } else {
          float val = r.nextFloat();
          orig[idx] = val;
          arr.set(idx, val);
        }
      }
View Full Code Here

Examples of java.util.Random.nextFloat()

      arr = new MutableSparseFloatArray(new float[orig.length]);
      int[] idxs = new int[1024 * 1024];
      float[] vals = new float[idxs.length];
      for (int i = 0; i < idxs.length; i++) {
        idxs[i] = r.nextInt(orig.length);
        vals[i] = r.nextFloat();
      }

      long markTime = System.currentTimeMillis();
      for (int i = 0; i < idxs.length; i++) {
        orig[i] = vals[i];
View Full Code Here

Examples of java.util.Random.nextFloat()

    try {
      float[] orig = new float[32 * 1024 * 1024];
      float density = 0.4f;
      Random rand = new Random(SEED);
      int idx = 0;
      while (rand.nextFloat() > density) {
        idx++;
      }
      int count = 0;
      while (idx < orig.length) {
        orig[idx] = rand.nextFloat();
View Full Code Here

Examples of java.util.Random.nextFloat()

      while (rand.nextFloat() > density) {
        idx++;
      }
      int count = 0;
      while (idx < orig.length) {
        orig[idx] = rand.nextFloat();
        count++;
        idx += 1;
        while (rand.nextDouble() > density) {
          idx++;
        }
View Full Code Here

Examples of java.util.Random.nextFloat()

        while (iter.hasNext()) {
            Entity target = (Entity) iter.next();
            if (target.isEntityAlive()) {
                if (target.worldObj.getTotalWorldTime() % 5 == 0) {
                    Random rand = new Random();
                    target.setVelocity(rand.nextFloat() - .5, rand.nextFloat(), rand.nextFloat() - .5);
                    ThaumicTinkerer.tcProxy.burst(target.worldObj, target.posX, target.posY, target.posZ, .5F);
                }
            }
            if (target.worldObj.getTotalWorldTime() > airPotionHit.get(target) + 20) {
                iter.remove();
View Full Code Here

Examples of java.util.Random.nextFloat()

        while (iter.hasNext()) {
            Entity target = (Entity) iter.next();
            if (target.isEntityAlive()) {
                if (target.worldObj.getTotalWorldTime() % 5 == 0) {
                    Random rand = new Random();
                    target.setVelocity(rand.nextFloat() - .5, rand.nextFloat(), rand.nextFloat() - .5);
                    ThaumicTinkerer.tcProxy.burst(target.worldObj, target.posX, target.posY, target.posZ, .5F);
                }
            }
            if (target.worldObj.getTotalWorldTime() > airPotionHit.get(target) + 20) {
                iter.remove();
View Full Code Here

Examples of java.util.Random.nextFloat()

        while (iter.hasNext()) {
            Entity target = (Entity) iter.next();
            if (target.isEntityAlive()) {
                if (target.worldObj.getTotalWorldTime() % 5 == 0) {
                    Random rand = new Random();
                    target.setVelocity(rand.nextFloat() - .5, rand.nextFloat(), rand.nextFloat() - .5);
                    ThaumicTinkerer.tcProxy.burst(target.worldObj, target.posX, target.posY, target.posZ, .5F);
                }
            }
            if (target.worldObj.getTotalWorldTime() > airPotionHit.get(target) + 20) {
                iter.remove();
View Full Code Here

Examples of java.util.Scanner.nextFloat()

      this.myHarness.fail ("#" + i + " : not double... (" + s.next () +
         ")");
    }
  if (s.hasNextFloat ())
    {
      aktFloat = s.nextFloat ();
      this.myHarness.check (aktFloat, floatZ[i],
          "#" + i + " : bad nextFloat() (" +
          aktFloat + " != " + floatZ[i]);
    }
  else
View Full Code Here

Examples of org.apache.commons.math3.random.RandomGenerator.nextFloat()

        final RandomGenerator random = GeneticAlgorithm.getRandomGenerator();
       
        Polygon p = new Polygon();
        p.data = new float[polygonSize];

        p.data[0] = random.nextFloat(); // r
        p.data[1] = random.nextFloat(); // g
        p.data[2] = random.nextFloat(); // b
        p.data[3] = FastMath.max(0.2f, random.nextFloat() * random.nextFloat()); // a
       
        float px = random.nextFloat();
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.