浏览代码

constant for editor port (#3396)

* constant for editor port

* undo stupid pycharm

* cleanup
/asymm-envs
GitHub 4 年前
当前提交
2ac92182
共有 4 个文件被更改,包括 5 次插入4 次删除
  1. 4
      docs/Python-API.md
  2. 1
      ml-agents-envs/mlagents_envs/environment.py
  3. 2
      ml-agents/mlagents/trainers/learn.py
  4. 2
      notebooks/getting-started.ipynb

4
docs/Python-API.md


channel = EngineConfigurationChannel()
env = UnityEnvironment(base_port = 5004, side_channels = [channel])
env = UnityEnvironment(base_port = UnityEnvironment.DEFAULT_EDITOR_PORT, side_channels = [channel])
channel.set_configuration_parameters(time_scale = 2.0)

channel = FloatPropertiesChannel()
env = UnityEnvironment(base_port = 5004, side_channels = [channel])
env = UnityEnvironment(base_port = UnityEnvironment.DEFAULT_EDITOR_PORT, side_channels = [channel])
channel.set_property("parameter_1", 2.0)

1
ml-agents-envs/mlagents_envs/environment.py


SCALAR_ACTION_TYPES = (int, np.int32, np.int64, float, np.float32, np.float64)
SINGLE_BRAIN_ACTION_TYPES = SCALAR_ACTION_TYPES + (list, np.ndarray)
API_VERSION = "API-15-dev0"
DEFAULT_EDITOR_PORT = 5004
def __init__(
self,

2
ml-agents/mlagents/trainers/learn.py


StatsReporter.add_writer(csv_writer)
if options.env_path is None:
port = 5004 # This is the in Editor Training Port
port = UnityEnvironment.DEFAULT_EDITOR_PORT
env_factory = create_environment_factory(
options.env_path,
options.docker_target_name,

2
notebooks/getting-started.ipynb


"outputs": [],
"source": [
"engine_configuration_channel = EngineConfigurationChannel()\n",
"env = UnityEnvironment(base_port = 5004, file_name=env_name, side_channels = [engine_configuration_channel])\n",
"env = UnityEnvironment(base_port = UnityEnvironment.DEFAULT_EDITOR_PORT, file_name=env_name, side_channels = [engine_configuration_channel])\n",
"\n",
"#Reset the environment\n",
"env.reset()\n",

正在加载...
取消
保存