Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questionable random number generator management #47

Open
benjaminy opened this issue Jun 6, 2024 · 0 comments
Open

Questionable random number generator management #47

benjaminy opened this issue Jun 6, 2024 · 0 comments

Comments

@benjaminy
Copy link

A few things about the management of RNGs seem wrong to me.

I would have assumed that CybORG.set_seed() could be used to re-seed the simulation. But references to the RNG (np_random) get copied into lots of objects. So when set_seed is called, some objects retain references to the 'older' RNG, and now the simulation uses a weird mishmash of multiple RNGs.

This can be fixed by re-seeding the RNG in place, instead of replacing it.

There are a couple of places where seeding is invoked to create RNGs. The one that seems especially suspicious to me is in the BaseAgent constructor. The constructor is not provided with a RNG object, it allocates one. But the code provides no access to re-seed those RNGs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant