Skip to content

Commit

Permalink
Use named policies, rather than the default "av" in view_models.
Browse files Browse the repository at this point in the history
Fixes #110

PiperOrigin-RevId: 514378189
Change-Id: I33c69386262299355164ec5671414cc501762e9b
  • Loading branch information
duenez authored and copybara-github committed Mar 6, 2023
1 parent 42a2ba4 commit 7de41d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/rllib/view_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 7de41d2

Please sign in to comment.