Agreed, I already have a flag on the class to toggle fixed "state". Could just set self._rng instead of its state. Will check it out. Must say, had not in my wildest dreams expected such help on any given Sunday. Have a great day and week, sir. Best, Stig
søn. 29. aug. 2021, 18:29 skrev Robert Kern <robert.k...@gmail.com>: > On Sun, Aug 29, 2021 at 10:55 AM Stig Korsnes <stigkors...@gmail.com> > wrote: > >> I am indeed making ~200-1000 generator instances.As many as I have >> processes. Each process is an instance of a component class , which has a >> generator. Every time i ask this process for 1m numbers, i need the same 1m >> numbers. I could instead make a new generator with same seed every time I >> ask for for the 1m numbers, but presumed that this would be more >> computationally expensive than setting state on an existing generator. >> > > Nominally, but it's overwhelmed by the actual computation. You will have > less to juggle if you just compute it from the key each time. > > -- > Robert Kern > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@python.org > https://mail.python.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion