快捷方式

check_marl_grouping

torchrl.envs.check_marl_grouping(group_map: dict[str, list[str]], agent_names: list[str])[source]

檢查 MARL 組對映。

對 marl 環境的組對映執行檢查,以評估其有效性。如果 group_map 無效,則引發錯誤。

引數:
  • group_map (Dict[str, List[str]]) – 組對映,將組名對映到組內的代理名稱列表

  • agent_names (List[str]) – 環境中所有代理名稱的列表

示例

>>> from torchrl.envs.utils import MarlGroupMapType, check_marl_grouping
>>> agent_names = ["agent_0", "agent_1", "agent_2"]
>>> check_marl_grouping(MarlGroupMapType.ALL_IN_ONE_GROUP.get_group_map(agent_names), agent_names)

文件

訪問全面的 PyTorch 開發者文件

檢視文件

教程

為初學者和高階開發者提供深入的教程

檢視教程

資源

查詢開發資源並讓您的問題得到解答

檢視資源