Last active
February 5, 2022 14:50
-
-
Save TGITS/d0948f4b408393c2898ed2c84e1fac2b to your computer and use it in GitHub Desktop.
Utilisation de RandomGeneratorFactory pour afficher les différents algorithmes de génération de nombres aléatoires disponibles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.random.RandomGeneratorFactory; | |
var template = "Algorithm name : %s - group : %s - characteristics : {%s%s%s%s%s%s%s%s stateBits: %d }"; | |
var algorithms = RandomGeneratorFactory.all().map( | |
factory -> template.formatted( | |
factory.name(), | |
factory.group(), | |
factory.isSplittable() ? " splittable" : "", | |
factory.isStreamable() ? " streamable" : "", | |
factory.isJumpable() ? " jumpable" : "", | |
factory.isArbitrarilyJumpable() ? " arbitrary-jumpable" : "", | |
factory.isLeapable() ? " leapable" : "", | |
factory.isHardware() ? " hardware" : "", | |
factory.isStatistical() ? " statistical" : "", | |
factory.isStochastic() ? " stochastic" : "", | |
factory.stateBits())).sorted().collect(Collectors.joining("\n")); | |
System.out.println(algorithms); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment