PythonRNG#
- class deeptrack.sources.rng.PythonRNG(n_states, seed=None)#
Bases:
Source
,Random
Class that generates multiple random.Random number generators.
It is used for creating multiple rng’s with different seeds.
Parameters#
- n_statesint
The number of random number generators to create.
- seedint, optional
The seed used to initialize the first random generator. If not provided, a random seed will be generated automatically using random.Random.randint().
Attributes#
- rnglist of random.Random
A list of random.Random objects, each seeded with a unique value.
Methods#
- _generate_states()list
Generates and returns a list of independent random.Random objects.
- reset()None
Resets the list of random number generators with new seeds.
- __getattribute__(__name)Any
Custom attribute access to allow lazy evaluation of random number generator methods.
- _create_lazy_callback(__name)callable
Creates a lazy callback for accessing methods from the random.Random objects.
- set_index(index)self
Sets the current index and resets the random number generators.
Methods Summary
Methods Documentation
- reset()#
- set_index(index)#