From 7de41d2db0e5eca31107312d405e20ff3a7da39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Du=C3=A9=C3=B1ez-Guzm=C3=A1n?= Date: Mon, 6 Mar 2023 05:18:10 -0800 Subject: [PATCH] Use named policies, rather than the default "av" in `view_models`. Fixes https://github.com/deepmind/meltingpot/issues/110 PiperOrigin-RevId: 514378189 Change-Id: I33c69386262299355164ec5671414cc501762e9b --- examples/rllib/view_models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/rllib/view_models.py b/examples/rllib/view_models.py index a131a526..08e7b62c 100644 --- a/examples/rllib/view_models.py +++ b/examples/rllib/view_models.py @@ -60,8 +60,10 @@ def main(): # Create a new environment to visualise env = utils.env_creator(config["env_config"]).get_dmlab2d_env() - num_bots = config["env_config"]["num_players"] - bots = [utils.RayModelPolicy(trainer, "av")] * num_bots + bots = [ + utils.RayModelPolicy(trainer, f"agent_{i}") + for i in range(len(config["env_config"]["default_player_roles"])) + ] timestep = env.reset() states = [bot.initial_state() for bot in bots]