whizard is hosted by Hepforge, IPPP Durham

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 kilian

Priority: P3P2

comment:2 Changed 11 years ago by kilian

Priority: P2P1
Status: newassigned

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.

comment:3 Changed 11 years ago by kilian

Resolution: fixed
Status: assignedclosed

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 (and rescan) 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.