浏览代码

Only call get_action on brains with policies (#2437)

/develop-gpu-test
GitHub 5 年前
当前提交
4abe89bc
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 7
      ml-agents-envs/mlagents/envs/subprocess_env_manager.py

7
ml-agents-envs/mlagents/envs/subprocess_env_manager.py


def _take_step(self, last_step: StepInfo) -> Dict[str, ActionInfo]:
all_action_info: Dict[str, ActionInfo] = {}
for brain_name, brain_info in last_step.current_all_brain_info.items():
all_action_info[brain_name] = self.policies[brain_name].get_action(
brain_info
)
if brain_name in self.policies:
all_action_info[brain_name] = self.policies[brain_name].get_action(
brain_info
)
return all_action_info
正在加载...
取消
保存