Skip to content

Commit

Permalink
[RLlib] Fix metrics bug (wrt individual agent returns) in `MultiAgent…
Browse files Browse the repository at this point in the history
…EnvRunner`. (#45543)
  • Loading branch information
sven1977 authored May 27, 2024
1 parent 15c294e commit bbbf51e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rllib/env/multi_agent_env_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,9 @@ def get_metrics(self) -> ResultDict:
episode_return += return_eps2
episode_duration_s += eps2.get_duration_s()
for sa_eps in eps2.agent_episodes.values():
agent_episode_returns[str(sa_eps.agent_id)] += return_eps2
module_episode_returns[sa_eps.module_id] += return_eps2
return_sa = sa_eps.get_return()
agent_episode_returns[str(sa_eps.agent_id)] += return_sa
module_episode_returns[sa_eps.module_id] += return_sa
del self._ongoing_episodes_for_metrics[eps.id_]

self._log_episode_metrics(
Expand Down

0 comments on commit bbbf51e

Please sign in to comment.