.. _physics-mergerTreeSeeds: Merger Tree Random Number Seeds =============================== Class providing the random number seed to be used for stochastic processes during the evolution of a given merger tree. Each tree is assigned a unique seed so that its evolution is reproducible and independent of other trees. The seed assignment strategy (e.g.\ incremental, hash-based) determines how seeds vary across trees and can affect the statistical properties of the ensemble of simulated galaxies. **Default implementation:** ``mergerTreeSeedsIncremental`` Methods ------- ``set`` → ``void`` Set the random number seed in the given ``tree``. * ``type(mergerTree), intent(inout) :: tree`` .. _physics-mergerTreeSeedsIncremental: ``mergerTreeSeedsIncremental`` ------------------------------ A merger tree random number seed in which the seed increases incrementally with tree index. Specifically, the seed will be set to the tree index offset by whatever seed was originally specified for the :galacticus-class:`randomNumberGeneratorClass` object in the parameter file. Note that this means that, if tree indices are consecutive, then changing the seed of the :galacticus-class:`randomNumberGeneratorClass` object in the parameter file by incrementing by a small number (e.g. 1, or any number less than the total number of trees simulated) will result in significant overlap in seed values for trees between the two models. To avoid this, either increment the random seed by a number larger than the total number of trees run, or consider using the :galacticus-class:`mergerTreeSeedsRandom` merger tree seed class to generate seeds instead. **(Default implementation)** .. _physics-mergerTreeSeedsRandom: ``mergerTreeSeedsRandom`` ------------------------- A merger tree random number seed in which the seed is chosen at random (without repetition) from the available range. Specifically, a list of random numbers are selected in the range :math:`1` to :math:`2^{31}` without repetition. For a tree with index ``i``, the ``i``\ :math:`^\mathrm{th}` entry from that list is used as its seed. The list is extended as needed given the tree index. Changing the seed of the :galacticus-class:`randomNumberGeneratorClass` object specified in the parameter file will ensure a completely different random set of seeds being chosen, such that there will be no correlation between sets of trees produced by different random seeds\footnoteOf course, it is possible that two different seeds for the :galacticus-class:`randomNumberGeneratorClass` object in the parameter file will happen to generate the same seed for one or more merger trees. However, this is unlikely unless the number of trees is a significant fraction of :math:`2^{31}` and, in any case, these identical seeds would likely be assigned to trees of very different masses, making any correlation minor.. Note that this is intended for cases where tree indices increment from 1. If used, for example, for trees from N-body simulations where the index may be a very large number, this approach will likely be extremely inefficient in both memory and time. **Parameters** * ``[countPoints]`` — The number of random points to generate. * ``[xRange]`` — The range within which to generate points in the :math:`x`-direction. * ``[yRange]`` — The range within which to generate points in the :math:`y`-direction. * ``[zRange]`` — The range within which to generate points in the :math:`z`-direction.