RngPack 1.1a

Nov 6, 2003 -- RngPack 1.1 released

RngPack 1.1a fixes a number of serious bugs in RngPack 1.0 including an incorrect coefficient in the Ranecu implementation and an off-by-one error in the choice() method. RngPack 1.1a supports Java serialization, adds a coin() method to get true/false coin tosses, adds a synchronized wrapper and includes a new generator, the Mersenne Twister. All RngPack users should upgrade to RngPack 1.1a. RngPack 1.1a is now available under a BSD License. See the Changelog, java class documentation, or download source code in tar.gz or zip format.

What is RngPack?

RngPack is a pseudorandom number generator package for Java. Pseudorandom means that the "random" numbers are generated by a deterministic mathematical process, not by a fundamentally random physical process such as radioactive decay or Johnson noise. RngPack contains base classes that add value to random number generators, four research grade generators, as well as a wrapper for Java's built in random number generator and a demonstration application. RngPack comes with java class documentation. Because RngPack is a set of Java classes it can be used in both applications and in applets. RngPack is available under the BSD License.

What is RngPack good for?

RngPack is good for

What isn't RngPack good for?

RngPack is not reccomended for

Comparison of generators

(Time is time to generate 10,000,000 numbers on a 300 Mhz Linux computer running the Sun JDK 1.4.2_02)

Name Period Time
(no JIT / JIT)
Special properties
Ranlux 10171 14.7 s RANLUX allows the user to adjust the "luxury level" from 0 to 4 to trade speed for quality. At levels 3 and 4 RANLUX is a large advance in quality over previous generators
Ranmar 1043 4.2 s Each RANMAR seed within it's range produces a unique sequence; by splitting up the seed space, collaborating researchers can ensure that they produce sequences that do not overlap.
Ranecu 1018 5.8 s RANECU is an advanced multiplicative linear congruential generator.
RanMT 219937-1 7.1 s The Mersenne twister has an exceptionally long period and is known to be well-distributed in 632-dimensional lag space.
RandomJava ? 8.0 s RandomJava wraps up the Math.random() method that comes with Java. Not reccomended for general use.

Download

Download RngPack 1.1 asource code as a gzip-tar file or as a ZIP file. RngPack is free under a BSD Licence.

If you use RngPack in a project, please send me an E-mail so I can send you news of updates. I'd be interested in working with anyone who is interested in improving the code and incorporating the improvements into future versions.