Files
java-core-examples/random/output/05-randomgenerator.txt
T

40 lines
1.9 KiB
Plaintext

== The old classes already implement RandomGenerator ==
Random -> rollDie in 1..6: true
SecureRandom -> rollDie in 1..6: true
SplittableRandom -> rollDie in 1..6: true
ThreadLocalRandom -> rollDie in 1..6: true
== The default generator ==
RandomGenerator.getDefault() : jdk.internal.random.L32X64MixRandom
RandomGeneratorFactory.getDefault() : L32X64MixRandom
== Every algorithm this JDK ships (name, group, state bits, jumpable, splittable) ==
L128X1024MixRandom LXM 1152 bits jumpable=false splittable=true
L128X128MixRandom LXM 256 bits jumpable=false splittable=true
L128X256MixRandom LXM 384 bits jumpable=false splittable=true
L32X64MixRandom LXM 96 bits jumpable=false splittable=true
L64X1024MixRandom LXM 1088 bits jumpable=false splittable=true
L64X128MixRandom LXM 192 bits jumpable=false splittable=true
L64X128StarStarRandom LXM 192 bits jumpable=false splittable=true
L64X256MixRandom LXM 320 bits jumpable=false splittable=true
Random Legacy 48 bits jumpable=false splittable=false
SecureRandom Legacy 2147483647 bits jumpable=false splittable=false
SplittableRandom Legacy 64 bits jumpable=false splittable=true
Xoroshiro128PlusPlus Xoroshiro 128 bits jumpable=true splittable=false
Xoshiro256PlusPlus Xoshiro 256 bits jumpable=true splittable=false
== Pick an algorithm by name, and seed it ==
Xoshiro256PlusPlus seed 42 #1: 600 767 404
Xoshiro256PlusPlus seed 42 #2: 600 767 404
RandomGenerator.of("L64X128MixRandom") -> L64X128MixRandom
== Splittable: independent generators for parallel work ==
first draw of 4 split children: 952 921 97 912
== Jumpable: provably non-overlapping streams ==
jump distance : 3.402823669209385E38
leap distance : 6.277101735386681E57
original next: 600
after jump next: 545