| Reference | Downloads | Github

Setting random seed for DotStim



I wish to use a DotStim object. However, I would like the exact trajectories to be reproducible. One easy way to do this is to set the random seed before using the DotStim. However, I have tried setting
random.seed( a_number )
Yet, the dot motions is different every time I run the program (I made the dot motion slow enough that I can visually see that the two instances are not identical).

Thus, my question: Is it possible to set the seed used by the object DotStim to a specific value such that every time the program is started, the dots are exactly the same?

Thanks, D.


You could try doing something like, which seems to work for me. You likely need to have created a dummy DotStim first, before creating your intended DotStim, so that the imports have happened.


Great, thank you. Indeed, the dummy Dot object is required. Thus

dummy = visual.DotStim(win)

did it!