浏览代码

Add Unity command line arguments

/develop-generalizationTraining-TrainerController
Jonathan Harper 5 年前
当前提交
9a170db5
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 10
      ml-agents-envs/mlagents/envs/environment.py

10
ml-agents-envs/mlagents/envs/environment.py


docker_training: bool = False,
no_graphics: bool = False,
timeout_wait: int = 30,
args: list = [],
):
"""
Starts a new unity environment and establishes a connection with the environment.

:bool no_graphics: Whether to run the Unity simulator in no-graphics mode
:int timeout_wait: Time (in seconds) to wait for connection from environment.
:bool train_mode: Whether to run in training mode, speeding up the simulation, by default.
:list args: Addition Unity command line arguments
"""
atexit.register(self._close)

"the worker-id must be 0 in order to connect with the Editor."
)
if file_name is not None:
self.executable_launcher(file_name, docker_training, no_graphics)
self.executable_launcher(file_name, docker_training, no_graphics, args)
else:
logger.info(
"Start training by pressing the Play button in the Unity Editor."

def reset_parameters(self):
return self._resetParameters
def executable_launcher(self, file_name, docker_training, no_graphics):
def executable_launcher(self, file_name, docker_training, no_graphics, args):
cwd = os.getcwd()
file_name = (
file_name.strip()

"-batchmode",
"--port",
str(self.port),
]
] + args
[launch_string, "--port", str(self.port)]
[launch_string, "--port", str(self.port)] + args
)
else:
"""

正在加载...
取消
保存