Java Random randomGaussian(int numElements)

Here you can find the source of randomGaussian(int numElements)

Description

random Gaussian

License

Open Source License

Declaration

public static List<Double> randomGaussian(int numElements) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static List<Double> randomGaussian(int numElements) {
        return randomGaussian(numElements, 1.0);
    }//from   w  w  w. j  a v  a  2  s  .c  o  m

    public static List<Double> randomGaussian(int numElements, double scaleFactor) {
        Random r = new Random(System.currentTimeMillis());
        List<Double> randomList = new ArrayList<Double>(numElements);
        for (int i = 0; i < numElements; i++) {
            randomList.add(r.nextGaussian() * scaleFactor);
        }
        return randomList;
    }
}

Related

  1. randomFailure()
  2. randomFloat(float aVal)
  3. randomFloat(float min, float max)
  4. randomFloatBetween(float begin, float end)
  5. randomFromIterator(Iterator iter)
  6. randomGreyLevels(double max, double min)
  7. randomIcon()
  8. randomID()
  9. randomId()