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
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
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
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
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
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.