Skip to content

Commit

Permalink
[RLlib] Implementation of MultiAgentEpisodeReplayBuffer for the new…
Browse files Browse the repository at this point in the history
… API stack. (#44450)
  • Loading branch information
simonsays1980 committed Apr 25, 2024
1 parent 611e7d5 commit 97e910b
Show file tree
Hide file tree
Showing 6 changed files with 1,302 additions and 8 deletions.
7 changes: 7 additions & 0 deletions rllib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,13 @@ py_test(
srcs = ["utils/replay_buffers/tests/test_episode_replay_buffer.py"]
)

py_test(
name = "test_multi_agent_episode_replay_buffer",
tags = ["team:rllib", "utils"],
size = "small",
srcs = ["utils/replay_buffers/tests/test_multi_agent_episode_replay_buffer.py"]
)

py_test(
name = "test_multi_agent_mixin_replay_buffer",
tags = ["team:rllib", "utils"],
Expand Down
2 changes: 1 addition & 1 deletion rllib/env/multi_agent_episode.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __init__(
# via the `module_for()` API even before the agent has entered the episode
# (and has its SingleAgentEpisode created), we store all aldeary done mappings
# in this dict here.
self._agent_to_module_mapping: Dict[AgentID, ModuleID] = {}
self._agent_to_module_mapping: Dict[AgentID, ModuleID] = agent_module_ids or {}

# Lookback buffer length is not provided. Interpret all provided data as
# lookback buffer.
Expand Down
4 changes: 4 additions & 0 deletions rllib/utils/replay_buffers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from ray.rllib.utils.replay_buffers.multi_agent_mixin_replay_buffer import (
MultiAgentMixInReplayBuffer,
)
from ray.rllib.utils.replay_buffers.multi_agent_episode_replay_buffer import (
MultiAgentEpisodeReplayBuffer,
)
from ray.rllib.utils.replay_buffers.multi_agent_prioritized_replay_buffer import (
MultiAgentPrioritizedReplayBuffer,
)
Expand All @@ -23,6 +26,7 @@
__all__ = [
"EpisodeReplayBuffer",
"FifoReplayBuffer",
"MultiAgentEpisodeReplayBuffer",
"MultiAgentMixInReplayBuffer",
"MultiAgentPrioritizedReplayBuffer",
"MultiAgentReplayBuffer",
Expand Down
Loading

0 comments on commit 97e910b

Please sign in to comment.