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.
Changing the seed of the distribution
Moderators: cyao, michael_borland
-
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Changing the seed of the distribution
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
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
-
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Re: Changing the seed of the distribution
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?
By the way, does Elegant have an internal check if two or more particle end up having same coordinates in the space?
-
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Changing the seed of the distribution
No, it doesn't have a check of this sort. It's very unlikely unless it is done deliberately.By the way, does Elegant have an internal check if two or more particle end up having same coordinates in the space?
--Michael
-
- Posts: 36
- Joined: 18 Jul 2014, 12:44
Re: Changing the seed of the distribution
I think I have encountered this situation with the number of particles >10M.
-
- Posts: 2008
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Changing the seed of the distribution
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
--Michale