捷徑

check_marl_grouping

torchrl.envs.check_marl_grouping(group_map: Dict[str, List[str]], agent_names: List[str])[來源]

檢查 MARL 群組映射。

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

參數:
  • group_map (Dict[str, List[str]]) – 群組映射,將群組名稱映射到群組中代理程式名稱的清單

  • agent_names (List[str]) – 環境中所有代理程式名稱的清單4

範例

>>> 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 的綜合開發人員文件

檢視文件

教學

取得初學者和進階開發人員的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源