Opened 11 years ago
Closed 11 years ago
#546 closed feature_request (fixed)
Procedure for setting random-generator seed
Reported by: | kilian | Owned by: | kilian |
---|---|---|---|
Priority: | P1 | Milestone: | v2.2.0 |
Component: | core | Version: | 2.1.1 |
Severity: | normal | Keywords: | |
Cc: |
Description
Whizard up to 2.1 had a global random-number generator. The new version uses several generators simultaneously. The proposed algorithm for initializing them is:
- The user sets seed=... as before, but this determines only the 15 upper bits of the actual rng seeds. (Check this.)
- Upon rng initialization, the actual seeds are determined by assigning the 16 lower bits one by one, in a well defined order.
Change History (3)
comment:1 Changed 11 years ago by
Priority: | P3 → P2 |
---|
comment:2 Changed 11 years ago by
Priority: | P2 → P1 |
---|---|
Status: | new → assigned |
comment:3 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
With r4895, this feature is complete. In detail:
- The
integrate
command creates a random-number generator factory for each process. This takes the user seed and multiplies it by 216. The factory becomes part of the process object. The user seed is then incremented by one (but may be reset manually). - Each random-number generator spawned by a factory takes the currently stored seed and adds 1.
- The same happens for the
simulate
(andrescan
) commands, where the r.n.g. is currently used only for selecting among processes. For each process, the complete event generation is controlled by its own r.n.g. factory.
In effect, all generators become statistically independent, unless the user resets the seed manually.
The seed
object on the user side is now an ordinary variable, no longer a command.
The current initial value for the seed is zero.
Note: See
TracTickets for help on using
tickets.
The algorithm is now implemented in form of a RNG factory, r4880. It will be incorporated in the process object, and can then be used for decays etc.