Is there a way of setting the random seed specifically for a module or an object derived from a particular class?
E.g. I have a module environment.py that contains multiple classes generating data in a stochastic process that is then used to update a model online:
for t in time:
    observation = world.step(dt)
    model.update(observation)
    # action = model.decide_action()
    # world.apply_action(action)

I would like to be able to generate the same data for a given random seed for different models. I tried setting the global seed, but that did not produce the same data for different models. Unfortunately, in my case it is also not possible to pre-generate the whole data set as a workaround, as in the future I need to allow acting on the world (in which case I am aware the stochastic process will differ between runs).