Changing the seed of the distribution

Moderators: cyao, michael_borland

Post Reply
headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Changing the seed of the distribution

Post by headdoggy64 » 13 Oct 2014, 11:13

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.

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Changing the seed of the distribution

Post by michael_borland » 15 Oct 2014, 08:29

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

headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Re: Changing the seed of the distribution

Post by headdoggy64 » 22 Oct 2014, 09:49

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?

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Changing the seed of the distribution

Post by michael_borland » 22 Oct 2014, 11:25

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

headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Re: Changing the seed of the distribution

Post by headdoggy64 » 22 Oct 2014, 13:20

I think I have encountered this situation with the number of particles >10M.

michael_borland
Posts: 2008
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Changing the seed of the distribution

Post by michael_borland » 24 Oct 2014, 09:25

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

Post Reply