set_seed
set_seed(seed, use_seed_seq=True, net_id=0)Sets the seed of the random number generators, both in ANNarchy.RandomDistributions and in the C++ library when it is created.
Numpy still has to be seeded explicitly when using the default RNG, for example:
ann.set_seed(seed=42)
rng = np.random.default_rng(seed=42)
A = rng.uniform(0.0, 1.0, (10, 10))Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| seed | int | integer value used to seed the C++ and Numpy RNG | required |
| use_seed_seq | bool | for openMP and parallel RNGs, we use either the STL SeedSequence (True, default) or a specialized implementation proposed by Melissa O’Neil (False, see _optimization_flags for more details). | True |