Tabnine Logo
MersenneTwister.nextGaussian
Code IndexAdd Tabnine to your IDE (free)

How to use
nextGaussian
method
in
org.apache.commons.math3.random.MersenneTwister

Best Java code snippets using org.apache.commons.math3.random.MersenneTwister.nextGaussian (Showing top 4 results out of 315)

origin: opentripplanner/OpenTripPlanner

  public static void main (String... args) {
    System.out.println("Testing histogram store with normal distribution, mean 0");
    Histogram h = new Histogram("Normal");

    MersenneTwister mt = new MersenneTwister();

    IntStream.range(0, 1000000).map(i -> (int) Math.round(mt.nextGaussian() * 20 + 2.5)).forEach(h::add);

    h.displayHorizontal();
    System.out.println("mean: " + h.mean());
  }
}
origin: vmware/hillview

/**
 * @return the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0
 * and standard deviation 1.0 from this random number generator's sequence.
 */
public double nextGaussian() { return this.myPrg.nextGaussian(); }
origin: com.conveyal/r5

  public static void main (String... args) {
    System.out.println("Testing histogram store with normal distribution, mean 0");
    Histogram h = new Histogram("Normal");

    MersenneTwister mt = new MersenneTwister();

    IntStream.range(0, 1000000).map(i -> (int) Math.round(mt.nextGaussian() * 20 + 2.5)).forEach(h::add);

    h.displayHorizontal();
    System.out.println("mean: " + h.mean());
  }
}
origin: conveyal/r5

  public static void main (String... args) {
    System.out.println("Testing histogram store with normal distribution, mean 0");
    Histogram h = new Histogram("Normal");

    MersenneTwister mt = new MersenneTwister();

    IntStream.range(0, 1000000).map(i -> (int) Math.round(mt.nextGaussian() * 20 + 2.5)).forEach(h::add);

    h.displayHorizontal();
    System.out.println("mean: " + h.mean());
  }
}
org.apache.commons.math3.randomMersenneTwisternextGaussian

Popular methods of MersenneTwister

  • <init>
    Creates a new random number generator using an int array seed.
  • setSeed
    Reinitialize the generator as if just built with the given int array seed.The state of the generator
  • nextInt
  • nextDouble
  • nextLong
  • clear
  • nextBytes
  • nextBoolean

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now