Message: Re: Basic Question about Random Seeds | Not Logged In (login) |
Hi Martin, you should probably post this query directly to the CLHEP forum... anyhow, here is what I recall of it... SetSeed() and SetSeeds() in the RanecuEngine are meant to initialise the internal status of the engine in order to generate independent sequences of pseudo-random numbers. The value provided in input to SetSeed() will simply indicate the index in a table of pre-calculated uncorrelated couples of seeds (static table limited to 215 entries), modulo the table's size, and chances of accidental collisions is minimized by further randomization. With SetSeeds() instead you provide directly the couple of seeds to be used for initialization of the engine, optionally specifying the location in its internal table. Other engines don't make use of such tables of seeds and follow a different logic. The total period for RanecuEngine, starting from a given couple of seeds is roughly 10E18 numbers, after which the sequence repeats, but for more detailed information you should look at the relevant paper... "F.James, Comp. Phys. Comm. 60 (1990) 329-344". Hope it helps, Gabriele ------------------ On Wed, 28 Aug 2013 18:12:20 GMT, Martin Koslowsky wrote: > This may seem like an incredibly stupid question, but it is also one > that I have had difficulty finding an answer to, so please indulge me. > > What exactly is a Seed? I believe I know what a Seed is in general, what > I am unsure of is how it plays out in the context of the CLHEP classes. > > Take, for example, the RanecuEngine class. It contains two methods that > appear to be for setting seeds (SetSeed and SetSeeds). The description > on the CERN website of the class is generally unhelpful - for example, I > have no idea what the difference is between a "local" and "static" table > of seeds. I therefore have little idea what the practical difference is > between these two methods. > > I also don't know what the two numbers that one inputs into SetSeeds are > doing. My suspicion from looking at someone else's code is as follows: > The first number (i.e. const long* seeds) is a way of selecting a > parameter in the algorithm for generating pseudo-random numbers, which > would allow me to generate separate lists of numbers that are > independent of each other. Hence I would be able to add Monte Carlo > results from a run which set seeds=1 with a run which set seeds=2 > without committing a grave error. The second number (HepInt index) is, > according to this hypothesis, basically for selecting where in the > sequence of generated pseudo-random numbers one would like to start. > However, I don't know for sure and that bothers me. > > I am also interested in knowing how many numbers you can generate from a > seed before you run into trouble. |
to: |