Probably, this is not the answer you want, but I became curious after reading your question and thought: Why not just probe the generator in question? Hence, I created a little scratch file with a heuristic approach:
import java.util.List;
import java.util.random.RandomGenerator;
import java.util.random.RandomGeneratorFactory;
import static java.util.stream.Collectors.toList;
class RandomGeneratorTool_73185029 {
public static void main(String[] args) {
RandomGeneratorFactory.all()
.map(factory -> String.format("%-21s -> %sseedable", factory.name(), isSeedable(factory) ? "" : "not "))
.forEach(System.out::println);
}
public static boolean isSeedable(RandomGeneratorFactory<RandomGenerator> factory) {
final int ROUNDS = 3, NUMBERS_PER_ROUND = 100, SEED = 123;
List<Integer>[] randomNumbers = new List[ROUNDS];
for (int round = 0; round < ROUNDS; round++) {
randomNumbers[round] = factory.create(SEED).ints(NUMBERS_PER_ROUND).boxed().collect(toList());
if (round > 0 && !randomNumbers[round - 1].equals(randomNumbers[round]))
return false;
}
return true;
}
}
On JDK 21, this prints:
L32X64MixRandom -> seedable
L128X128MixRandom -> seedable
L64X128MixRandom -> seedable
SecureRandom -> not seedable
L128X1024MixRandom -> seedable
L64X128StarStarRandom -> seedable
Xoshiro256PlusPlus -> seedable
L64X256MixRandom -> seedable
Random -> seedable
Xoroshiro128PlusPlus -> seedable
L128X256MixRandom -> seedable
SplittableRandom -> seedable
L64X1024MixRandom -> seedable
ThreadLocalRandom
is now considered "legacy", but no suitable replacement has been added for the problemThreadLocalRandom
was introduced to solve. I'm really struggling to understand how this class was considered good enough for inclusion in the JDK. – MulberryisLongSeedSupported
method on the interface. – MulberryRandomGeneratorFactory.all()
. The only one that doesn't support a seed isSecureRandom
and the other 12 haveisHardware=false
,isStochastic=false
,isStatistical=true
andperiod>0
. Such a bizarre API though. – MulberrySplittableRandom
, which is designed to go hand in hand with parallel decomposition. – StrainerSplittableRandom
with along
seed (which I wasn't aware of before). Although, asSplittableRandom
is also now described as "legacy" (docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/…), it does feel a bit odd that it's still necessary. – Mulberry