Page 1 of 1
Changing the seed of the distribution
Posted: 13 Oct 2014, 11:13
by headdoggy64
Hello all,
I have searched the forum for this question, but haven't found an answer.
I would like to know, if Elegant uses the same seed for the distribution generator all the time, or it's possible to start with a random seed every run.
Thank you.
Re: Changing the seed of the distribution
Posted: 15 Oct 2014, 08:29
by michael_borland
You can control the seeding of the random number generators using the random_number_seed parameter of the &run_setup command.
Setting this to some positive integer value will change the default random number seed to that value. A large, odd number is recommended. Setting this to 0 will result in the system clock being used to seed the random number generator.
Within the context of a single run, if using the &bunched_beam command with the n_steps parameter of &run_control set to a value greater than 1, you can either reuse a single distribution or generate a new distribution for each step. This is controlled using the one_random_bunch parameter of &bunched_beam (set to 0 to generate a new bunch for each step).
--Michael
Re: Changing the seed of the distribution
Posted: 22 Oct 2014, 09:49
by headdoggy64
Thank you for your answer!
By the way, does Elegant have an internal check if two or more particle end up having same coordinates in the space?
Re: Changing the seed of the distribution
Posted: 22 Oct 2014, 11:25
by michael_borland
By the way, does Elegant have an internal check if two or more particle end up having same coordinates in the space?
No, it doesn't have a check of this sort. It's very unlikely unless it is done deliberately.
--Michael
Re: Changing the seed of the distribution
Posted: 22 Oct 2014, 13:20
by headdoggy64
I think I have encountered this situation with the number of particles >10M.
Re: Changing the seed of the distribution
Posted: 24 Oct 2014, 09:25
by michael_borland
That's very unlikely since the pseudo-random number generator has a very long period. However, please post an input file that demonstrates the problem, and I'll check it out.
--Michale