浏览代码

get_agent_id fixed

/test-recurrent-gail
Andrew Cohen 5 年前
当前提交
553223e0
共有 1 个文件被更改,包括 1 次插入7 次删除
  1. 8
      ml-agents-envs/mlagents_envs/base_env.py

8
ml-agents-envs/mlagents_envs/base_env.py


return agent_id in self.agent_id_to_index
def get_index(self, agent_id: AgentId) -> int:
if not self.contains_agent(agent_id):
raise IndexError(
"get_index failed. agent_id {} is not present in the BatchedStepResult".format(
agent_id
)
)
return self._agent_id_to_index[agent_id] # type: ignore
return self.agent_id_to_index.get(agent_id, -1) # type: ignore
def get_agent_step_result(self, agent_id: AgentId) -> StepResult:
"""

正在加载...
取消
保存