浏览代码

Add custom reset parameters to subprocess env manager

This mirrors functionality already found in UnityEnvironment
/develop-generalizationTraining-TrainerController
Jonathan Harper 5 年前
当前提交
c2cd5a87
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      ml-agents-envs/mlagents/envs/subprocess_env_manager.py

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


elif cmd.name == "reset_parameters":
_send_response("reset_parameters", env.reset_parameters)
elif cmd.name == "reset":
all_brain_info = env.reset(cmd.payload[0], cmd.payload[1])
all_brain_info = env.reset(cmd.payload[0], cmd.payload[1], cmd.payload[2])
_send_response("reset", all_brain_info)
elif cmd.name == "global_done":
_send_response("global_done", env.global_done)

steps.append(step_info)
return steps
def reset(self, config=None, train_mode=True) -> List[StepInfo]:
self._broadcast_message("reset", (config, train_mode))
def reset(self, config=None, train_mode=True, custom_reset_parameters=None) -> List[StepInfo]:
self._broadcast_message("reset", (config, train_mode, custom_reset_parameters))
reset_results = [
self.env_workers[i].recv().payload for i in range(len(self.env_workers))
]

正在加载...
取消
保存