Uncommons Maths is a java library with nice math utilities and random number generators. This requires the library uncommons-maths-1.2.2.jar to be in classpath. The following example shows using PoissonGenerator class.
package com.bethecoder.tutorials.uncommons; import java.util.Random; import org.uncommons.maths.random.PoissonGenerator; public class PoissonGeneratorTest { /** * @param args */ public static void main(String[] args) { PoissonGenerator rand = new PoissonGenerator(1729.12468d, new Random()); for (int i = 0 ; i < 10 ; i ++) { System.out.println(rand.nextValue()); } } }
1752 1734 1739 1757 1732 1720 1669 1708 1760 1690