holgerbrandl01/22/2021, 9:04 PM
so that running
twice would give the same result. Controlling randomess is an important feature of every language that is intended for data-science (see https://www.w3schools.com/python/ref_random_seed.asp for python or https://www.rdocumentation.org/packages/simEd/versions/1.0.3/topics/set.seed for R
Shawn01/22/2021, 9:10 PM
), and if “controlling randomness” is important in your application, you should make calls to RNG instances you control instead of relying on the
val random = Random(42)
holgerbrandl01/22/2021, 9:19 PM
Derek Peirce01/25/2021, 12:59 AM
could be modified to take a
as an argument, with a default of
. However, the library would then have to declare either that it commits to using the same sequence of random-value calls for all future updates, or that the same seed may lead to different results after an update to the stdlib.
ilya.gorbunov01/25/2021, 2:40 PM
, for example being able to set its seed with some global method. In fact, having such globally mutable seed in a concurrent environment doesn't make further random calls anymore predictable.
holgerbrandl01/29/2021, 4:40 PM