![](https://secure.gravatar.com/avatar/d246baeefae20788d6ea519b777a99c7.jpg?s=120&d=mm&r=g)
Hi, I noticed that each time I recompile a document using randomized the result is the same, so presumably the random seed is also the same. I guess this is intentional. My questions are: * Does the random seed value depend on a checksum of the tex file or something like this? * How to change it (e.g., to make it depend on the compile time or whatever)? Regards, -- Marcin Borkowski
![](https://secure.gravatar.com/avatar/44ca9eda7aaa681c0e3b3e90125c56b0.jpg?s=120&d=mm&r=g)
Am 03.08.2011 15:19, schrieb Marcin Borkowski:
Hi,
I noticed that each time I recompile a document using randomized the result is the same, so presumably the random seed is also the same. I guess this is intentional. My questions are: * Does the random seed value depend on a checksum of the tex file or something like this? Hi,
it's derived from system time and stored in the *.tuc-file (see definition of \setuprandomize). As long as this file is not rewritten, you get the same random seed.
* How to change it (e.g., to make it depend on the compile time or whatever)?
Something like (untested) \setuprandomize[\normaltime] I guess a call after \starttext will do.
Regards,
Peter
![](https://secure.gravatar.com/avatar/d6e7462bd4209f9c4cd08271985a50df.jpg?s=120&d=mm&r=g)
Hello,
\setuprandomize[\normaltime]
I guess a call after \starttext will do.
Peter
I tried it as I was just about to solve the same problem; it seems to work in condition that *at least one minute elapses between two runs*. BTW, what exactly does \normaltime expand to? Does it contain seconds as well? Where to find some more info about \normaltime? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
![](https://secure.gravatar.com/avatar/44ca9eda7aaa681c0e3b3e90125c56b0.jpg?s=120&d=mm&r=g)
Am 03.08.2011 16:07, schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
\setuprandomize[\normaltime]
I guess a call after \starttext will do.
Peter
I tried it as I was just about to solve the same problem; it seems to work in condition that *at least one minute elapses between two runs*.
BTW, what exactly does \normaltime expand to? Does it contain seconds as well?
Where to find some more info about \normaltime?
probably just an alias for \time http://www.tug.org/utilities/plain/cseq.html#time-rp this would also explain, why the seconds do not count :-)
Best regards,
Lukas
![](https://secure.gravatar.com/avatar/d6e7462bd4209f9c4cd08271985a50df.jpg?s=120&d=mm&r=g)
http://www.tug.org/utilities/plain/cseq.html#time-rp
this would also explain, why the seconds do not count :-)
Best regards,
OK, so it could be better e.g.: ---- \starttext \directlua{context.setuprandomize{os.time()}} ... ---- Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Wed, 3 Aug 2011, Marcin Borkowski wrote:
Hi,
I noticed that each time I recompile a document using randomized the result is the same, so presumably the random seed is also the same. I guess this is intentional. My questions are: * Does the random seed value depend on a checksum of the tex file or something like this?
AFAIK, no. But the seed is stored in tuc file. Grep for randomseed.
* How to change it (e.g., to make it depend on the compile time or whatever)?
Delete the tuc file and recompile (or compile using --purge). Aditya
participants (4)
-
Aditya Mahajan
-
Marcin Borkowski
-
Peter Rolf
-
Procházka Lukáš Ing. - Pontex s. r. o.