Package examples.utilities.random
Class PMMLCG
- java.lang.Object
-
- examples.utilities.random.PMMLCG
-
- All Implemented Interfaces:
java.util.function.DoubleSupplier
,GetAntitheticValueIfc
,RandU01Ifc
public class PMMLCG extends java.lang.Object implements RandU01Ifc
Random is a PMMLCG generator that returns a pseudo-random real number uniformly distributed between 0.0 and 1.0. The period is (m - 1) where m = 2,147,483,647 and the smallest and largest possible values are (1 / m) and 1 - (1 / m) respectively.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAntitheticValue()
Returns the antithetic value of the previous valuelong
getDefaultSeed()
double
getPrevU01()
The previous U(0,1) generated (returned) by randU01()long
getSeed()
static void
main(java.lang.String[] args)
double
randU01()
Returns a pseudo-random uniformly distributed numbervoid
setSeed(long seed)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsl.utilities.random.rng.RandU01Ifc
asDoubleStream, getAsDouble
-
-
-
-
Method Detail
-
getDefaultSeed
public final long getDefaultSeed()
-
randU01
public double randU01()
Description copied from interface:RandU01Ifc
Returns a pseudo-random uniformly distributed number- Specified by:
randU01
in interfaceRandU01Ifc
- Returns:
- the random number
-
getPrevU01
public double getPrevU01()
Description copied from interface:RandU01Ifc
The previous U(0,1) generated (returned) by randU01()- Specified by:
getPrevU01
in interfaceRandU01Ifc
- Returns:
- previous U(0,1) generated (returned) by randU01()
-
getAntitheticValue
public double getAntitheticValue()
Description copied from interface:GetAntitheticValueIfc
Returns the antithetic value of the previous value- Specified by:
getAntitheticValue
in interfaceGetAntitheticValueIfc
- Returns:
- the antithetic value of the previous value
-
setSeed
public final void setSeed(long seed)
-
getSeed
public final long getSeed()
-
main
public static void main(java.lang.String[] args)
-
-