Skip to content

Commit

Permalink
Fixed precommit issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelalonsojr committed Nov 22, 2023
1 parent 81e0baa commit 90557d8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
19 changes: 9 additions & 10 deletions docs/Python-LLAPI-Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,22 +634,21 @@ class UnityEnvironment(BaseEnv)
#### \_\_init\_\_

```python
| __init__(file_name: Optional[str] = None, worker_id: int = 0, base_port: Optional[int] = None, seed: int = 0, no_graphics: bool = False, timeout_wait: int = 60, additional_args: Optional[List[str]] = None, side_channels: Optional[List[SideChannel]] = None, log_folder: Optional[str] = None, num_areas: int = 1)
| __init__(file_name: Optional[str] = None, worker_id: int = 0, base_port: Optional[int] = None, seed: int = 0, no_graphics: bool = False, no_graphics_monitor: bool = False, timeout_wait: int = 60, additional_args: Optional[List[str]] = None, side_channels: Optional[List[SideChannel]] = None, log_folder: Optional[str] = None, num_areas: int = 1)
```

Starts a new unity environment and establishes a connection with the environment.
Notice: Currently communication between Unity and Python takes place over an open socket without authentication.
Ensure that the network where training takes place is secure.

:string file_name: Name of Unity environment binary.
:int base_port: Baseline port number to connect to Unity environment over. worker_id increments over this.
If no environment is specified (i.e. file_name is None), the DEFAULT_EDITOR_PORT will be used.
:int worker_id: Offset from base_port. Used for training multiple environments simultaneously.
: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.
:list args: Addition Unity command line arguments
:list side_channels: Additional side channel for no-rl communication with Unity
:str log_folder: Optional folder to write the Unity Player log file into. Requires absolute path.
:string file_name: Name of Unity environment binary. :int base_port: Baseline port number to connect to Unity
environment over. worker_id increments over this. If no environment is specified (i.e. file_name is None),
the DEFAULT_EDITOR_PORT will be used. :int worker_id: Offset from base_port. Used for training multiple
environments simultaneously. :bool no_graphics: Whether to run the Unity simulator in no-graphics mode :bool
no_graphics_monitor: Whether to run the main worker in graphics mode, with the remaining in no-graphics mode
:int timeout_wait: Time (in seconds) to wait for connection from environment. :list args: Addition Unity
command line arguments :list side_channels: Additional side channel for no-rl communication with Unity :str
log_folder: Optional folder to write the Unity Player log file into. Requires absolute path.

<a name="mlagents_envs.environment.UnityEnvironment.close"></a>
#### close
Expand Down
18 changes: 8 additions & 10 deletions ml-agents-envs/mlagents_envs/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,14 @@ def __init__(
Notice: Currently communication between Unity and Python takes place over an open socket without authentication.
Ensure that the network where training takes place is secure.
:string file_name: Name of Unity environment binary.
:int base_port: Baseline port number to connect to Unity environment over. worker_id increments over this.
If no environment is specified (i.e. file_name is None), the DEFAULT_EDITOR_PORT will be used.
:int worker_id: Offset from base_port. Used for training multiple environments simultaneously.
:bool no_graphics: Whether to run the Unity simulator in no-graphics mode
:bool no_graphics_monitor: Whether to run the main worker in graphics mode, with the remaining in no-graphics mode
:int timeout_wait: Time (in seconds) to wait for connection from environment.
:list args: Addition Unity command line arguments
:list side_channels: Additional side channel for no-rl communication with Unity
:str log_folder: Optional folder to write the Unity Player log file into. Requires absolute path.
:string file_name: Name of Unity environment binary. :int base_port: Baseline port number to connect to Unity
environment over. worker_id increments over this. If no environment is specified (i.e. file_name is None),
the DEFAULT_EDITOR_PORT will be used. :int worker_id: Offset from base_port. Used for training multiple
environments simultaneously. :bool no_graphics: Whether to run the Unity simulator in no-graphics mode :bool
no_graphics_monitor: Whether to run the main worker in graphics mode, with the remaining in no-graphics mode
:int timeout_wait: Time (in seconds) to wait for connection from environment. :list args: Addition Unity
command line arguments :list side_channels: Additional side channel for no-rl communication with Unity :str
log_folder: Optional folder to write the Unity Player log file into. Requires absolute path.
"""
atexit.register(self._close)
self._additional_args = additional_args or []
Expand Down
4 changes: 2 additions & 2 deletions ml-agents/mlagents/trainers/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ def _create_parser() -> argparse.ArgumentParser:
default=False,
action=DetectDefaultStoreTrue,
help="Whether to run the main Unity worker in graphics mode with the remaining workers in no graphics mode"
"(i.e. without initializing the graphics driver. Use this only if your agents don't use visual "
"observations.",
"(i.e. without initializing the graphics driver. Use this only if your agents don't use visual "
"observations.",
)

torch_conf = argparser.add_argument_group(title="Torch Configuration")
Expand Down

0 comments on commit 90557d8

Please sign in to comment.