
rngine.2.0.0.source-code.module-info Maven / Gradle / Ivy
/*
* PRNGine - Java PRNG Library (prngine-2.0.0).
* Copyright (c) 2017-2021 Franz Wilhelmstötter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author:
* Franz Wilhelmstötter ([email protected])
*/
import java.util.random.RandomGenerator;
import io.jenetics.prngine.KISS32Random;
import io.jenetics.prngine.KISS64Random;
import io.jenetics.prngine.LCG64ShiftRandom;
import io.jenetics.prngine.MT19937_32Random;
import io.jenetics.prngine.MT19937_64Random;
import io.jenetics.prngine.XOR32ShiftRandom;
import io.jenetics.prngine.XOR64ShiftRandom;
/**
* PRNGine is a pseudo-random number generator library for sequential and
* parallel
* Monte Carlo simulations. All PRNG implementations of this library
* extends the Java {@link RandomGenerator}, which makes it easily usable in
* other projects. The PRNGs are not cryptographically strong RNGs.
*
* The following PRNGs are implemented
*
*
* - {@link KISS32Random}: Implementation of a simple PRNG as proposed in
*
* Good Practice in (Pseudo) Random Number Generation for Bioinformatics
* Applications (JKISS32, page 3), David Jones, UCL
* Bioinformatics Group.
*
* - {@link KISS64Random}: Implementation of a simple PRNG as proposed in
*
* Good Practice in (Pseudo) Random Number Generation for Bioinformatics
* Applications (JKISS32, page 10), David Jones, UCL
* Bioinformatics Group.
*
* - {@link LCG64ShiftRandom}: This class implements a linear congruential
* PRNG with additional bit-shift transition. It is a port of the
*
* trng::lcg64_shift PRNG class of the
* TRNG library created by Heiko Bauke.
* - {@link MT19937_32Random}: This is a 32-bit version of Mersenne Twister
* pseudorandom number generator.
* - {@link MT19937_64Random}: This is a 64-bit version of Mersenne Twister
* pseudorandom number generator.
* - {@link XOR32ShiftRandom}: This generator was discovered and
* characterized by George Marsaglia [Xorshift RNGs]
* In just three XORs and three shifts (generally fast operations) it
* produces a full period of 232 - 1 on 32 bits. (The missing
* value is zero, which perpetuates itself and must be avoided.) High and
* low bits pass Diehard.
*
* - {@link XOR64ShiftRandom}: This generator was discovered and
* characterized by George Marsaglia [Xorshift RNGs]
* In just three XORs and three shifts (generally fast operations) it
* produces a full period of 24 - 1 on 64 bits. (The missing
* value is zero, which perpetuates itself and must be avoided.) High and
* low bits pass Diehard.
*
*
*
* PRNG creation
* {@code
* final var random1 = new LCG64ShiftRandom();
* final RandomGenerator random2 = RandomGenerator.of("LCG64ShiftRandom");
* final RandomGenerator random3 = RandomGeneratorFactory.of("LCG64ShiftRandom").create();
* }
*
* PRNG seeding
* {@code
* // This random creation is equivalent to...
* final RandomGenerator random1 = new LCG64ShiftRandom();
*
* // ...creating it with the seed bytes of the PRNG.
* final byte[] seed = LCG64ShiftRandom.seedBytes();
* final RandomGenerator random2 = new LCG53ShiftRandom(seed);
* }
*
* NOTE: All implemented random generators are not thread-safe. If
* they are used in a multi-threaded environment, they must be synchronized
* externally.
*
* @author Franz Wilhelmstötter
* @since 2.0.0
*/
module io.jenetics.prngine {
exports io.jenetics.prngine;
provides RandomGenerator with
KISS32Random,
KISS64Random,
LCG64ShiftRandom,
MT19937_32Random,
MT19937_64Random,
XOR32ShiftRandom,
XOR64ShiftRandom;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy