rstorjoh at sfu.ca
Thu Nov 12 18:10:09 EST 1998
> (Alternatives, such as seeding the generator from the integer value of the
> computer clock, are well-known, but probably beyond the scope of the
> user to implement in X-PLOR).
It can be done, this is how: Write a program in C (or some other
language) which gets the current time in integer format, and then prints
it to a file (let's call it time.inp) like this:
set seed = # end
where # is the time in integer format.
Program listing in C:
printf("\nset seed = %ld end\n",t);
Then simply have your X-plor script read the file with the command
and the X-plor random number generator will be initiated with a different
random number each time.
__ Rasmus Storjohann
/ /\ Institute of Molecular Biology
/ / \ and Biochemistry
/ / /\ \ Simon Fraser University
/ / /\ \ \ Burnaby, British Columbia V5A 1S6
/ /_/__\ \ \ e-mail: rstorjoh at sfu.ca
/________\ \ \ Phone: (604) 291-5657 / 415-0575
\___________\/ FAX: (604) 291-3765
More information about the X-plor