Hi, in one of my documents I use a specific random seed to create a fixed random based graphic (size, color, position). This works fine under Windows (where I 'found' the seed value), but I get a complete different result on my Debian system. Is there a way to get identical results on different OS? Or is the random number generator OS specific? Just wondering... Peter
On 11/14/2012 7:55 PM, Peter Rolf wrote:
Hi,
in one of my documents I use a specific random seed to create a fixed random based graphic (size, color, position). This works fine under Windows (where I 'found' the seed value), but I get a complete different result on my Debian system.
Is there a way to get identical results on different OS? Or is the random number generator OS specific? Just wondering...
yes and it cannot be trusted either (some underlying os code is used); i also found out that you need to call a couple of random's in a row first to get at least not the same ones in the beginning in contetx I've now settled on: math.initialseed = tonumber(string.sub(string.reverse(tostring(ceil(socket and socket.gettime()*10000 or time()))),1,6)) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Am 14.11.2012 20:20, schrieb Hans Hagen:
On 11/14/2012 7:55 PM, Peter Rolf wrote:
Hi,
in one of my documents I use a specific random seed to create a fixed random based graphic (size, color, position). This works fine under Windows (where I 'found' the seed value), but I get a complete different result on my Debian system.
Is there a way to get identical results on different OS? Or is the random number generator OS specific? Just wondering...
yes and it cannot be trusted either (some underlying os code is used); i also found out that you need to call a couple of random's in a row first to get at least not the same ones in the beginning
in contetx I've now settled on:
math.initialseed = tonumber(string.sub(string.reverse(tostring(ceil(socket and socket.gettime()*10000 or time()))),1,6))
Thanks for the info. The formula looks like an incantation for the god of random numbers ;-) I already migrated the tex code to lua, so that I can do some post processing on the collected random based data. To get identical results, I only have to save the final data set then.
participants (2)
-
Hans Hagen
-
Peter Rolf