Random seed fn
CoCoA-4 has a
Seed fn for resetting the global random number generator.
Make it (or something equivalent) available in CoCoA-5?
#1 Updated by John Abbott about 1 year ago
An interactive CoCoA-5 session will always generate the same sequence of (pseudo-)random numbers.
In CoCoA-4 there was a fn called
Seed which would restart the random number generator from the given seed.
In CoCoALib, a seed value may be given when creating a random source; or the source may be "reseeded" after construction.
The CoCoA-4 fn can be emulated by reseeding the
GlobalRandomSource in CoCoALib. This makes me suggest that we could call the fn
reseed (and perhaps put
Seed in as an obsolescent fn?)
#5 Updated by John Abbott 9 months ago
In the manual page I have given a simplistic example of calling
reseed with an argument which varies with the time: so two CoCoA session started at least 1 second apart will be seeded differently.
Should there be an easy way of achieving this? For instance a specific function (with no args) which reseeds from a time-dependent value? Maybe
Perhaps it is not so important? The user could just copy the line from the manual...