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)