浏览代码

fix passing manager id to trainer

/develop/superpush/int
Ruo-Ping Dong 4 年前
当前提交
34a67a8e
共有 2 个文件被更改,包括 7 次插入10 次删除
  1. 5
      com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
  2. 12
      ml-agents/mlagents/trainers/agent_processor.py

5
com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs


agentInfoProto.ActionMask.AddRange(ai.discreteActionMasks);
}
if (ai.teamManagerId != null)
{
agentInfoProto.TeamManagerId = ai.teamManagerId;
}
return agentInfoProto;
}

12
ml-agents/mlagents/trainers/agent_processor.py


) -> None:
stored_decision_step, idx = self.last_step_result.get(global_id, (None, None))
if stored_decision_step is not None:
if step.team_manager_id is not None:
if step.team_manager_id > 0:
self.last_group_obs[step.team_manager_id][
global_id
] = stored_decision_step.obs

for _manager_id, _team_group in self.current_group_obs.items():
for _manager_id in list(self.current_group_obs.keys()):
_team_group = self.current_group_obs[_manager_id]
self._safe_delete(_team_group, _manager_id)
for _manager_id, _team_group in self.last_group_obs.items():
self._safe_delete(self.current_group_obs, _manager_id)
for _manager_id in list(self.last_group_obs.keys()):
_team_group = self.last_group_obs[_manager_id]
self._safe_delete(_team_group, _manager_id)
self._safe_delete(self.last_group_obs, _manager_id)
def _process_step(
self, step: Union[TerminalStep, DecisionStep], global_id: str, index: int

正在加载...
取消
保存