Examples of nextDouble()


Examples of java.util.Random.nextDouble()

      int count = 0;
      while (idx < orig.length) {
        orig[idx] = rand.nextFloat();
        count++;
        idx += 1;
        while (rand.nextDouble() > density) {
          idx++;
        }
      }
      assertTrue("count was bad: "+count, count > 100 && count < orig.length/2);
      System.out.println("float array with "+count+" out of "+orig.length+" non-zero values");
View Full Code Here

Examples of java.util.Random.nextDouble()

        Value map = ValueFactory.mapValue(new Value[] {
                ValueFactory.integerValue(0), ValueFactory.integerValue(Integer.MIN_VALUE),
                ValueFactory.integerValue(rand.nextInt()), ValueFactory.integerValue(Integer.MAX_VALUE),
                ValueFactory.floatValue(rand.nextFloat()), ValueFactory.booleanValue(true),
                ValueFactory.floatValue(rand.nextDouble()), ValueFactory.nilValue(),
            });

        List<Value> values = new ArrayList<Value>();

        for(int i=0; i < 2; i++) {
View Full Code Here

Examples of java.util.Random.nextDouble()

  testDouble(Double.NaN);
  testDouble(Double.NEGATIVE_INFINITY);
  testDouble(Double.POSITIVE_INFINITY);
  Random rand = new Random();
  for (int i = 0; i < 1000; i++) {
      testDouble(rand.nextDouble());
  }
    }

    public void testDouble(double v) throws Exception {
    }
View Full Code Here

Examples of java.util.Random.nextDouble()

  testDoubleArray(new double[] { Double.POSITIVE_INFINITY });
  testDoubleArray(new double[] { Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY });
  Random rand = new Random();
  double[] v = new double[100];
  for (int i = 0; i < v.length; ++i) {
      v[i] = rand.nextDouble();
  }
  testDoubleArray(v);
    }

    public void testDoubleArray(double[] v) throws Exception {
View Full Code Here

Examples of java.util.Random.nextDouble()

        dsend = new double[length];
        drecv = new double[length];

        for (int i = 0; i < length; ++i) {
            dsend[i] = r.nextDouble();
            fsend[i] = r.nextFloat();
            lsend[i] = r.nextLong();
            isend[i] = r.nextInt();
            ssend[i] = (short) r.nextInt();
            csend[i] = (char) r.nextInt();
View Full Code Here

Examples of java.util.Random.nextDouble()

    Random rand = new Random(System.currentTimeMillis()* this.hashCode()) ;

    text = txt ;

    pos = new double[2] ;
    pos[0] = rand.nextDouble() *100.0 ;
    pos[1] = rand.nextDouble() *100.0 ;

    direction = new double [2] ;
    direction[0] = rand.nextDouble() ;
    direction[1] = rand.nextDouble() ;
View Full Code Here

Examples of java.util.Random.nextDouble()

    text = txt ;

    pos = new double[2] ;
    pos[0] = rand.nextDouble() *100.0 ;
    pos[1] = rand.nextDouble() *100.0 ;

    direction = new double [2] ;
    direction[0] = rand.nextDouble() ;
    direction[1] = rand.nextDouble() ;

View Full Code Here

Examples of java.util.Random.nextDouble()

    pos = new double[2] ;
    pos[0] = rand.nextDouble() *100.0 ;
    pos[1] = rand.nextDouble() *100.0 ;

    direction = new double [2] ;
    direction[0] = rand.nextDouble() ;
    direction[1] = rand.nextDouble() ;

    accel = 0.0 ;
    speed = 1.0 ;

View Full Code Here

Examples of java.util.Random.nextDouble()

    pos[0] = rand.nextDouble() *100.0 ;
    pos[1] = rand.nextDouble() *100.0 ;

    direction = new double [2] ;
    direction[0] = rand.nextDouble() ;
    direction[1] = rand.nextDouble() ;

    accel = 0.0 ;
    speed = 1.0 ;

    tag = 0 ;
View Full Code Here

Examples of java.util.Random.nextDouble()

    for (pwnum=0; pwnum < npw; pwnum++) {

      password = new StringBuffer(pwl);

      pik = ran.nextDouble(); // random number [0,1]

      ranno = (long)(pik * data.getSigma()); // weight by sum of frequencies

      sum = 0;

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.