java伪随机数跨系统和版本的再现性?
我需要在给定初始整数参数的情况下生成伪随机数的受控序列。为此,我使用标准 Java Random 类,由整数参数作为种子。我想确保在可预见的未来(以及更多!)跨系统(操作系统,还有 Java/JDK 版本)生成相同的序列。
总之:Java 是否确保其伪随机数生成器在实现和版本之间的可重复性/可移植性?
注意:我已经问过 Python 完全相同的问题。后来由于其他原因,我将实现语言更改为 Java。
I need to generate a controlled sequence of pseudo-random numbers, given an initial integer parameter. For that I'm using the standard Java Random class, seeded by an integer parameter. I'd like to make sure that I will generate the same sequence across systems (Operating system, but also Java/JDK version), in the foreseeable future (and more!).
In summary: Does Java ensure the reproducibility / portability of it's pseudo-random number generator across implementation and versions?
Note: I've asked the exact same question for Python. I since changed the implementation language to Java but for other reasons.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。
javadoc 解释:
Yes.
The javadoc explains: