google-deepmind / meltingpot

A suite of test scenarios for multi-agent reinforcement learning.
Apache License 2.0
582 stars 118 forks source link

Setting a random seed #129

Closed ninell-oldenburg closed 1 year ago

ninell-oldenburg commented 1 year ago

Hi!

I'm trying to find a place to set a random seed for the initial substrate setting. However, all places I've tried so far seem to do it, and I was wondering if an interface exists anywhere in the code.

Things I've tried:

Thanks in advance!

jagapiou commented 1 year ago

There are multiple random seeds:

  1. dmlab2d.Lab2d (pybind C++) takes a seed in the lab2d_settings_dict that is passed to Lua (see here).
  2. dmlab2d.Environment takes a seed for it's Python/C++
  3. Stuff in the scenarios and the bots that I don't think a relevant here.

1 & 2 should be controllable by the env_seed argument. However, this isn't wired in.

I've discussed this at https://github.com/deepmind/meltingpot/issues/113#issuecomment-1462212082 there may be more relevant info there on what solution to take (e.g. seed in a config, as an override to build, as an argument to reset()).

ninell-oldenburg commented 1 year ago

Amazing, thank you! Wired it in.