浏览代码

Merge branch 'master' into develop-agentprocessor

/develop-newnormalization
Ervin Teng 5 年前
当前提交
3d25f9d2
共有 142 个文件被更改,包括 605 次插入462 次删除
  1. 2
      .circleci/config.yml
  2. 6
      .pre-commit-config.yaml
  3. 6
      .pylintrc
  4. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentAction.cs
  5. 10
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentInfo.cs
  6. 12
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentInfoActionPair.cs
  7. 10
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/BrainParameters.cs
  8. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Command.cs
  9. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/CustomResetParameters.cs
  10. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/DemonstrationMeta.cs
  11. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/EngineConfiguration.cs
  12. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Header.cs
  13. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Observation.cs
  14. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/SpaceType.cs
  15. 12
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityInput.cs
  16. 14
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityMessage.cs
  17. 12
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityOutput.cs
  18. 8
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlInitializationInput.cs
  19. 10
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlInitializationOutput.cs
  20. 12
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlInput.cs
  21. 10
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlOutput.cs
  22. 10
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityToExternal.cs
  23. 2
      UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityToExternalGrpc.cs
  24. 6
      docs/Basic-Guide.md
  25. 8
      docs/Learning-Environment-Executable.md
  26. 10
      docs/Migrating.md
  27. 22
      docs/Python-API.md
  28. 2
      docs/Training-Generalized-Reinforcement-Learning-Agents.md
  29. 10
      docs/Training-on-Amazon-Web-Service.md
  30. 2
      docs/Training-on-Microsoft-Azure.md
  31. 2
      gym-unity/gym_unity/__init__.py
  32. 2
      gym-unity/gym_unity/envs/__init__.py
  33. 2
      gym-unity/gym_unity/tests/test_gym.py
  34. 2
      ml-agents-envs/README.md
  35. 8
      ml-agents-envs/setup.py
  36. 2
      ml-agents/README.md
  37. 2
      ml-agents/mlagents/trainers/__init__.py
  38. 10
      ml-agents/mlagents/trainers/brain.py
  39. 4
      ml-agents/mlagents/trainers/brain_conversion_utils.py
  40. 2
      ml-agents/mlagents/trainers/buffer.py
  41. 8
      ml-agents/mlagents/trainers/demo_loader.py
  42. 5
      ml-agents/mlagents/trainers/env_manager.py
  43. 8
      ml-agents/mlagents/trainers/exception.py
  44. 14
      ml-agents/mlagents/trainers/learn.py
  45. 11
      ml-agents/mlagents/trainers/meta_curriculum.py
  46. 2
      ml-agents/mlagents/trainers/ppo/multi_gpu_policy.py
  47. 2
      ml-agents/mlagents/trainers/ppo/policy.py
  48. 2
      ml-agents/mlagents/trainers/sac/policy.py
  49. 2
      ml-agents/mlagents/trainers/sac/trainer.py
  50. 6
      ml-agents/mlagents/trainers/simple_env_manager.py
  51. 16
      ml-agents/mlagents/trainers/subprocess_env_manager.py
  52. 12
      ml-agents/mlagents/trainers/tests/test_bcmodule.py
  53. 1
      ml-agents/mlagents/trainers/tests/test_curriculum.py
  54. 53
      ml-agents/mlagents/trainers/tests/test_meta_curriculum.py
  55. 14
      ml-agents/mlagents/trainers/tests/test_ppo.py
  56. 16
      ml-agents/mlagents/trainers/tests/test_reward_signals.py
  57. 10
      ml-agents/mlagents/trainers/tests/test_sac.py
  58. 22
      ml-agents/mlagents/trainers/tests/test_simple_rl.py
  59. 4
      ml-agents/mlagents/trainers/tests/test_subprocess_env_manager.py
  60. 73
      ml-agents/mlagents/trainers/tests/test_trainer_util.py
  61. 2
      ml-agents/mlagents/trainers/tf_policy.py
  62. 6
      ml-agents/mlagents/trainers/trainer.py
  63. 9
      ml-agents/mlagents/trainers/trainer_controller.py
  64. 59
      ml-agents/mlagents/trainers/trainer_util.py
  65. 6
      ml-agents/setup.py
  66. 6
      notebooks/getting-started.ipynb
  67. 12
      protobuf-definitions/make.sh
  68. 8
      protobuf-definitions/make_for_win.bat
  69. 2
      utils/validate_versions.py
  70. 4
      ml-agents-envs/mlagents_envs/tests/test_timers.py
  71. 8
      ml-agents-envs/mlagents_envs/tests/test_side_channel.py
  72. 10
      ml-agents-envs/mlagents_envs/tests/test_rpc_utils.py
  73. 4
      ml-agents-envs/mlagents_envs/tests/test_rpc_communicator.py
  74. 26
      ml-agents-envs/mlagents_envs/tests/test_envs.py
  75. 2
      ml-agents-envs/mlagents_envs/side_channel/raw_bytes_channel.py
  76. 2
      ml-agents-envs/mlagents_envs/side_channel/float_properties_channel.py
  77. 4
      ml-agents-envs/mlagents_envs/side_channel/engine_configuration_channel.py
  78. 10
      ml-agents-envs/mlagents_envs/rpc_utils.py
  79. 10
      ml-agents-envs/mlagents_envs/rpc_communicator.py
  80. 16
      ml-agents-envs/mlagents_envs/mock_communicator.py
  81. 2
      ml-agents-envs/mlagents_envs/exception.py
  82. 26
      ml-agents-envs/mlagents_envs/environment.py
  83. 10
      ml-agents-envs/mlagents_envs/communicator_objects/unity_to_external_pb2_grpc.py
  84. 14
      ml-agents-envs/mlagents_envs/communicator_objects/unity_to_external_pb2.py
  85. 8
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_output_pb2.pyi
  86. 18
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_output_pb2.py
  87. 16
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_input_pb2.pyi
  88. 22
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_input_pb2.py
  89. 8
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_initialization_output_pb2.pyi
  90. 14
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_initialization_output_pb2.py
  91. 8
      ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_initialization_input_pb2.py
  92. 16
      ml-agents-envs/mlagents_envs/communicator_objects/unity_output_pb2.pyi
  93. 18
      ml-agents-envs/mlagents_envs/communicator_objects/unity_output_pb2.py
  94. 24
      ml-agents-envs/mlagents_envs/communicator_objects/unity_message_pb2.pyi
  95. 22
      ml-agents-envs/mlagents_envs/communicator_objects/unity_message_pb2.py
  96. 16
      ml-agents-envs/mlagents_envs/communicator_objects/unity_input_pb2.pyi
  97. 18
      ml-agents-envs/mlagents_envs/communicator_objects/unity_input_pb2.py
  98. 6
      ml-agents-envs/mlagents_envs/communicator_objects/space_type_pb2.py
  99. 10
      ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.py
  100. 8
      ml-agents-envs/mlagents_envs/communicator_objects/header_pb2.py

2
.circleci/config.yml


- checkout
- run:
name: Combine proto files for caching
command: cat protobuf-definitions/proto/mlagents/envs/communicator_objects/*.proto > /tmp/proto_deps.txt
command: cat protobuf-definitions/proto/mlagents_envs/communicator_objects/*.proto > /tmp/proto_deps.txt
- restore_cache:
keys:

6
.pre-commit-config.yaml


- id: mypy
name: mypy-ml-agents
files: "ml-agents/.*"
args: [--ignore-missing-imports, --disallow-incomplete-defs, --namespace-packages]
args: [--ignore-missing-imports, --disallow-incomplete-defs]
args: [--ignore-missing-imports, --disallow-incomplete-defs, --namespace-packages]
args: [--ignore-missing-imports, --disallow-incomplete-defs]
args: [--ignore-missing-imports, --disallow-incomplete-defs, --namespace-packages]
args: [--ignore-missing-imports, --disallow-incomplete-defs]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0

6
.pylintrc


# W0703: Catching too general exception Exception
W0703,
# E0401: Unable to import...
# E0611: No name '...' in module '...'
# need to look into these, probably namespace packages
E0401, E0611,
# E0401: Unable to import... - triggers for external dependencies like numpy
E0401,
# This was causing false positives
# Appears to be https://github.com/PyCQA/pylint/issues/2981

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentAction.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/agent_action.proto
// source: mlagents_envs/communicator_objects/agent_action.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/agent_action.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/agent_action.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/agent_action.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/agent_action.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjVtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2Fj",
"CjVtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2Fj",
"dGlvbi5wcm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMiSwoQQWdlbnRBY3Rp",
"b25Qcm90bxIWCg52ZWN0b3JfYWN0aW9ucxgBIAMoAhINCgV2YWx1ZRgEIAEo",
"AkoECAIQA0oECAMQBEoECAUQBkIfqgIcTUxBZ2VudHMuQ29tbXVuaWNhdG9y",

10
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentInfo.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/agent_info.proto
// source: mlagents_envs/communicator_objects/agent_info.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/agent_info.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/agent_info.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/agent_info.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/agent_info.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjNtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2lu",
"Zm8ucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzGjRtbGFnZW50cy9lbnZz",
"CjNtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2lu",
"Zm8ucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzGjRtbGFnZW50c19lbnZz",
"L2NvbW11bmljYXRvcl9vYmplY3RzL29ic2VydmF0aW9uLnByb3RvItEBCg5B",
"Z2VudEluZm9Qcm90bxIOCgZyZXdhcmQYByABKAISDAoEZG9uZRgIIAEoCBIY",
"ChBtYXhfc3RlcF9yZWFjaGVkGAkgASgIEgoKAmlkGAogASgFEhMKC2FjdGlv",

12
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/AgentInfoActionPair.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/agent_info_action_pair.proto
// source: mlagents_envs/communicator_objects/agent_info_action_pair.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/agent_info_action_pair.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/agent_info_action_pair.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/agent_info_action_pair.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/agent_info_action_pair.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cj9tbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2lu",
"Cj9tbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2lu",
"bGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2luZm8u",
"cHJvdG8aNW1sYWdlbnRzL2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvYWdl",
"bGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2luZm8u",
"cHJvdG8aNW1sYWdlbnRzX2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvYWdl",
"bnRfYWN0aW9uLnByb3RvIpEBChhBZ2VudEluZm9BY3Rpb25QYWlyUHJvdG8S",
"OAoKYWdlbnRfaW5mbxgBIAEoCzIkLmNvbW11bmljYXRvcl9vYmplY3RzLkFn",
"ZW50SW5mb1Byb3RvEjsKC2FjdGlvbl9pbmZvGAIgASgLMiYuY29tbXVuaWNh",

10
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/BrainParameters.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/brain_parameters.proto
// source: mlagents_envs/communicator_objects/brain_parameters.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/brain_parameters.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/brain_parameters.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/brain_parameters.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/brain_parameters.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjltbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2JyYWluX3Bh",
"CjltbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2JyYWluX3Bh",
"cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3NwYWNlX3R5cGUucHJvdG8i",
"c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3NwYWNlX3R5cGUucHJvdG8i",
"2QEKFEJyYWluUGFyYW1ldGVyc1Byb3RvEhoKEnZlY3Rvcl9hY3Rpb25fc2l6",
"ZRgDIAMoBRIiChp2ZWN0b3JfYWN0aW9uX2Rlc2NyaXB0aW9ucxgFIAMoCRJG",
"Chh2ZWN0b3JfYWN0aW9uX3NwYWNlX3R5cGUYBiABKA4yJC5jb21tdW5pY2F0",

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Command.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/command.proto
// source: mlagents_envs/communicator_objects/command.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/command.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/command.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/command.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/command.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjBtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2NvbW1hbmQu",
"CjBtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2NvbW1hbmQu",
"cHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzKi0KDENvbW1hbmRQcm90bxII",
"CgRTVEVQEAASCQoFUkVTRVQQARIICgRRVUlUEAJCH6oCHE1MQWdlbnRzLkNv",
"bW11bmljYXRvck9iamVjdHNiBnByb3RvMw=="));

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/CustomResetParameters.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/custom_reset_parameters.proto
// source: mlagents_envs/communicator_objects/custom_reset_parameters.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/custom_reset_parameters.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/custom_reset_parameters.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/custom_reset_parameters.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/custom_reset_parameters.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CkBtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2N1c3RvbV9y",
"CkBtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2N1c3RvbV9y",
"ZXNldF9wYXJhbWV0ZXJzLnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cyIc",
"ChpDdXN0b21SZXNldFBhcmFtZXRlcnNQcm90b0IfqgIcTUxBZ2VudHMuQ29t",
"bXVuaWNhdG9yT2JqZWN0c2IGcHJvdG8z"));

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/DemonstrationMeta.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/demonstration_meta.proto
// source: mlagents_envs/communicator_objects/demonstration_meta.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/demonstration_meta.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/demonstration_meta.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/demonstration_meta.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/demonstration_meta.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjttbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2RlbW9uc3Ry",
"CjttbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2RlbW9uc3Ry",
"YXRpb25fbWV0YS5wcm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMijQEKFkRl",
"bW9uc3RyYXRpb25NZXRhUHJvdG8SEwoLYXBpX3ZlcnNpb24YASABKAUSGgoS",
"ZGVtb25zdHJhdGlvbl9uYW1lGAIgASgJEhQKDG51bWJlcl9zdGVwcxgDIAEo",

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/EngineConfiguration.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/engine_configuration.proto
// source: mlagents_envs/communicator_objects/engine_configuration.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/engine_configuration.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/engine_configuration.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/engine_configuration.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/engine_configuration.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cj1tbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2VuZ2luZV9j",
"Cj1tbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2VuZ2luZV9j",
"b25maWd1cmF0aW9uLnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cyKVAQoY",
"RW5naW5lQ29uZmlndXJhdGlvblByb3RvEg0KBXdpZHRoGAEgASgFEg4KBmhl",
"aWdodBgCIAEoBRIVCg1xdWFsaXR5X2xldmVsGAMgASgFEhIKCnRpbWVfc2Nh",

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Header.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/header.proto
// source: mlagents_envs/communicator_objects/header.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/header.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/header.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/header.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/header.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ci9tbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2hlYWRlci5w",
"Ci9tbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2hlYWRlci5w",
"cm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMiLgoLSGVhZGVyUHJvdG8SDgoG",
"c3RhdHVzGAEgASgFEg8KB21lc3NhZ2UYAiABKAlCH6oCHE1MQWdlbnRzLkNv",
"bW11bmljYXRvck9iamVjdHNiBnByb3RvMw=="));

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/Observation.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/observation.proto
// source: mlagents_envs/communicator_objects/observation.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/observation.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/observation.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/observation.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/observation.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjRtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL29ic2VydmF0",
"CjRtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL29ic2VydmF0",
"aW9uLnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cyL5AQoQT2JzZXJ2YXRp",
"b25Qcm90bxINCgVzaGFwZRgBIAMoBRJEChBjb21wcmVzc2lvbl90eXBlGAIg",
"ASgOMiouY29tbXVuaWNhdG9yX29iamVjdHMuQ29tcHJlc3Npb25UeXBlUHJv",

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/SpaceType.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/space_type.proto
// source: mlagents_envs/communicator_objects/space_type.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/space_type.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/space_type.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/space_type.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/space_type.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjNtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3NwYWNlX3R5",
"CjNtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3NwYWNlX3R5",
"cGUucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzKi4KDlNwYWNlVHlwZVBy",
"b3RvEgwKCGRpc2NyZXRlEAASDgoKY29udGludW91cxABQh+qAhxNTEFnZW50",
"cy5Db21tdW5pY2F0b3JPYmplY3RzYgZwcm90bzM="));

12
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityInput.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_input.proto
// source: mlagents_envs/communicator_objects/unity_input.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_input.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_input.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_input.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_input.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjRtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X2lu",
"cHV0LnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cxo3bWxhZ2VudHMvZW52",
"CjRtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X2lu",
"cHV0LnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cxo3bWxhZ2VudHNfZW52",
"bWxhZ2VudHMvZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy91bml0eV9ybF9p",
"bWxhZ2VudHNfZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy91bml0eV9ybF9p",
"bml0aWFsaXphdGlvbl9pbnB1dC5wcm90byKkAQoPVW5pdHlJbnB1dFByb3Rv",
"EjkKCHJsX2lucHV0GAEgASgLMicuY29tbXVuaWNhdG9yX29iamVjdHMuVW5p",
"dHlSTElucHV0UHJvdG8SVgoXcmxfaW5pdGlhbGl6YXRpb25faW5wdXQYAiAB",

14
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityMessage.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_message.proto
// source: mlagents_envs/communicator_objects/unity_message.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_message.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_message.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_message.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_message.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjZtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X21l",
"c3NhZ2UucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzGjVtbGFnZW50cy9l",
"CjZtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X21l",
"c3NhZ2UucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzGjVtbGFnZW50c19l",
"bWxhZ2VudHMvZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy91bml0eV9pbnB1",
"dC5wcm90bxovbWxhZ2VudHMvZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy9o",
"bWxhZ2VudHNfZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy91bml0eV9pbnB1",
"dC5wcm90bxovbWxhZ2VudHNfZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy9o",
"ZWFkZXIucHJvdG8iwAEKEVVuaXR5TWVzc2FnZVByb3RvEjEKBmhlYWRlchgB",
"IAEoCzIhLmNvbW11bmljYXRvcl9vYmplY3RzLkhlYWRlclByb3RvEjwKDHVu",
"aXR5X291dHB1dBgCIAEoCzImLmNvbW11bmljYXRvcl9vYmplY3RzLlVuaXR5",

12
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityOutput.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_output.proto
// source: mlagents_envs/communicator_objects/unity_output.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_output.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_output.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_output.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_output.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjVtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X291",
"dHB1dC5wcm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMaOG1sYWdlbnRzL2Vu",
"CjVtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X291",
"dHB1dC5wcm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMaOG1sYWdlbnRzX2Vu",
"GkdtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"GkdtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"X2luaXRpYWxpemF0aW9uX291dHB1dC5wcm90byKpAQoQVW5pdHlPdXRwdXRQ",
"cm90bxI7CglybF9vdXRwdXQYASABKAsyKC5jb21tdW5pY2F0b3Jfb2JqZWN0",
"cy5Vbml0eVJMT3V0cHV0UHJvdG8SWAoYcmxfaW5pdGlhbGl6YXRpb25fb3V0",

8
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlInitializationInput.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_rl_initialization_input.proto
// source: mlagents_envs/communicator_objects/unity_rl_initialization_input.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_rl_initialization_input.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_rl_initialization_input.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_rl_initialization_input.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_rl_initialization_input.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CkZtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"CkZtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"X2luaXRpYWxpemF0aW9uX2lucHV0LnByb3RvEhRjb21tdW5pY2F0b3Jfb2Jq",
"ZWN0cyIvCh9Vbml0eVJMSW5pdGlhbGl6YXRpb25JbnB1dFByb3RvEgwKBHNl",
"ZWQYASABKAVCH6oCHE1MQWdlbnRzLkNvbW11bmljYXRvck9iamVjdHNiBnBy",

10
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlInitializationOutput.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_rl_initialization_output.proto
// source: mlagents_envs/communicator_objects/unity_rl_initialization_output.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_rl_initialization_output.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_rl_initialization_output.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_rl_initialization_output.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_rl_initialization_output.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CkdtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"CkdtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"amVjdHMaOW1sYWdlbnRzL2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvYnJh",
"amVjdHMaOW1sYWdlbnRzX2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvYnJh",
"aW5fcGFyYW1ldGVycy5wcm90byKfAQogVW5pdHlSTEluaXRpYWxpemF0aW9u",
"T3V0cHV0UHJvdG8SDAoEbmFtZRgBIAEoCRIPCgd2ZXJzaW9uGAIgASgJEhAK",
"CGxvZ19wYXRoGAMgASgJEkQKEGJyYWluX3BhcmFtZXRlcnMYBSADKAsyKi5j",

12
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlInput.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_rl_input.proto
// source: mlagents_envs/communicator_objects/unity_rl_input.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_rl_input.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_rl_input.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_rl_input.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_rl_input.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjdtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"X2lucHV0LnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cxo1bWxhZ2VudHMv",
"CjdtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"X2lucHV0LnByb3RvEhRjb21tdW5pY2F0b3Jfb2JqZWN0cxo1bWxhZ2VudHNf",
"MG1sYWdlbnRzL2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvY29tbWFuZC5w",
"MG1sYWdlbnRzX2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvY29tbWFuZC5w",
"cm90byL+AgoRVW5pdHlSTElucHV0UHJvdG8SUAoNYWdlbnRfYWN0aW9ucxgB",
"IAMoCzI5LmNvbW11bmljYXRvcl9vYmplY3RzLlVuaXR5UkxJbnB1dFByb3Rv",
"LkFnZW50QWN0aW9uc0VudHJ5EjMKB2NvbW1hbmQYBCABKA4yIi5jb21tdW5p",

10
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityRlOutput.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_rl_output.proto
// source: mlagents_envs/communicator_objects/unity_rl_output.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_rl_output.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_rl_output.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_rl_output.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_rl_output.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjhtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"CjhtbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Js",
"L2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvYWdlbnRfaW5mby5wcm90byK5",
"X2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvYWdlbnRfaW5mby5wcm90byK5",
"AgoSVW5pdHlSTE91dHB1dFByb3RvEkwKCmFnZW50SW5mb3MYAiADKAsyOC5j",
"b21tdW5pY2F0b3Jfb2JqZWN0cy5Vbml0eVJMT3V0cHV0UHJvdG8uQWdlbnRJ",
"bmZvc0VudHJ5EhQKDHNpZGVfY2hhbm5lbBgDIAEoDBpJChJMaXN0QWdlbnRJ",

10
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityToExternal.cs


// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_to_external.proto
// source: mlagents_envs/communicator_objects/unity_to_external.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using scg = global::System.Collections.Generic;
namespace MLAgents.CommunicatorObjects {
/// <summary>Holder for reflection information generated from mlagents/envs/communicator_objects/unity_to_external.proto</summary>
/// <summary>Holder for reflection information generated from mlagents_envs/communicator_objects/unity_to_external.proto</summary>
/// <summary>File descriptor for mlagents/envs/communicator_objects/unity_to_external.proto</summary>
/// <summary>File descriptor for mlagents_envs/communicator_objects/unity_to_external.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}

byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjptbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Rv",
"CjptbGFnZW50c19lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL3VuaXR5X3Rv",
"dHMvZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy91bml0eV9tZXNzYWdlLnBy",
"dHNfZW52cy9jb21tdW5pY2F0b3Jfb2JqZWN0cy91bml0eV9tZXNzYWdlLnBy",
"b3RvMnYKFFVuaXR5VG9FeHRlcm5hbFByb3RvEl4KCEV4Y2hhbmdlEicuY29t",
"bXVuaWNhdG9yX29iamVjdHMuVW5pdHlNZXNzYWdlUHJvdG8aJy5jb21tdW5p",
"Y2F0b3Jfb2JqZWN0cy5Vbml0eU1lc3NhZ2VQcm90byIAQh+qAhxNTEFnZW50",

2
UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects/UnityToExternalGrpc.cs


#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents/envs/communicator_objects/unity_to_external.proto
// source: mlagents_envs/communicator_objects/unity_to_external.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code

6
docs/Basic-Guide.md


like this:
```console
INFO:mlagents.envs:
INFO:mlagents_envs:
INFO:mlagents.envs:Connected new brain:
INFO:mlagents_envs:Connected new brain:
Unity brain name: 3DBallLearning
Number of Visual Observations (per agent): 0
Vector Observation space size (per agent): 8

Vector Action descriptions: ,
INFO:mlagents.envs:Hyperparameters for the PPO Trainer of brain 3DBallLearning:
INFO:mlagents_envs:Hyperparameters for the PPO Trainer of brain 3DBallLearning:
batch_size: 64
beta: 0.001
buffer_size: 12000

8
docs/Learning-Environment-Executable.md


'file_name' of the `UnityEnvironment`. For instance:
```python
from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.environment import UnityEnvironment
env = UnityEnvironment(file_name=<env_name>)
```

CrashReporter: initialized
Mono path[0] = '/Users/dericp/workspace/ml-agents/3DBall.app/Contents/Resources/Data/Managed'
Mono config path = '/Users/dericp/workspace/ml-agents/3DBall.app/Contents/MonoBleedingEdge/etc'
INFO:mlagents.envs:
INFO:mlagents_envs:
INFO:mlagents.envs:Connected new brain:
INFO:mlagents_envs:Connected new brain:
Unity brain name: Ball3DLearning
Number of Visual Observations (per agent): 0
Vector Observation space size (per agent): 8

Vector Action descriptions: ,
INFO:mlagents.envs:Hyperparameters for the PPO Trainer of brain Ball3DLearning:
INFO:mlagents_envs:Hyperparameters for the PPO Trainer of brain Ball3DLearning:
batch_size: 64
beta: 0.001
buffer_size: 12000

10
docs/Migrating.md


# Migrating
## Migrating from master to develop
## Migrating from 0.12 to latest
* `reset()` on the Low-Level Python API no longer takes a `train_mode` argument. To modify the performance/speed of the engine, you must use an `EngineConfigurationChannel`
* `reset()` on the Low-Level Python API no longer takes a `config` argument. `UnityEnvironment` no longer has a `reset_parameters` field. To modify float properties in the environment, you must use a `FloatPropertiesChannel`. For more information, refer to the [Low Level Python API documentation](Python-API.md)
* `reset()` on the Low-Level Python API no longer takes a `train_mode` argument. To modify the performance/speed of the engine, you must use an `EngineConfigurationChannel`
* `reset()` on the Low-Level Python API no longer takes a `config` argument. `UnityEnvironment` no longer has a `reset_parameters` field. To modify float properties in the environment, you must use a `FloatPropertiesChannel`. For more information, refer to the [Low Level Python API documentation](Python-API.md)
* `mlagents.envs` was renamed to `mlagents_envs`. The previous repo layout depended on [PEP420](https://www.python.org/dev/peps/pep-0420/), which caused problems with some of our tooling such as mypy and pylint.
* Any imports from `mlagents.envs` should be replaced with `mlagents_envs`.
## Migrating from ML-Agents toolkit v0.11.0 to v0.12.0

* `UnitySDK/Assets/ML-Agents/Scripts/Communicator.cs` and its class `Communicator` have been renamed to `UnitySDK/Assets/ML-Agents/Scripts/ICommunicator.cs` and `ICommunicator` respectively.
* The `SpaceType` Enums `discrete`, and `continuous` have been renamed to `Discrete` and `Continuous`.
* We have removed the `Done` call as well as the capacity to set `Max Steps` on the Academy. Therefore an AcademyReset will never be triggered from C# (only from Python). If you want to reset the simulation after a fixed number of steps, or when an event in the simulation occurs, we recommend looking at our multi-agent example environments (such as BananaCollector). In our examples, groups of Agents can be reset through an "Area" that can reset groups of Agents.
* The import for `mlagents.envs.UnityEnvironment` was removed. If you are using the Python API, change `from mlagents.envs import UnityEnvironment` to `from mlagents.envs.environment import UnityEnvironment`.
* The import for `mlagents.envs.UnityEnvironment` was removed. If you are using the Python API, change `from mlagents_envs import UnityEnvironment` to `from mlagents_envs.environment import UnityEnvironment`.
## Migrating from ML-Agents toolkit v0.8 to v0.9

22
docs/Python-API.md


# Unity ML-Agents Python Low Level API
The `mlagents` Python package contains two components: a low level API which
allows you to interact directly with a Unity Environment (`mlagents.envs`) and
allows you to interact directly with a Unity Environment (`mlagents_envs`) and
an entry point to train (`mlagents-learn`) which allows you to train agents in
Unity Environments using our implementations of reinforcement learning or
imitation learning.

## mlagents.envs
## mlagents_envs
The ML-Agents Toolkit Low Level API is a Python API for controlling the simulation
loop of an environment or game built with Unity. This API is used by the

- **AgentGroupSpec** — describes the shape of the data inside a BatchedStepResult.
For example, provides the dimensions of the observations of a group.
These classes are all defined in the [base_env](../ml-agents-envs/mlagents/envs/base_env.py)
These classes are all defined in the [base_env](../ml-agents-envs/mlagents_envs/base_env.py)
script.
An Agent Group is a group of Agents identified by a string name that share the same

## Loading a Unity Environment
Python-side communication happens through `UnityEnvironment` which is located in
`ml-agents/mlagents/envs`. To load a Unity environment from a built binary
file, put the file in the same directory as `envs`. For example, if the filename
of your Unity environment is 3DBall.app, in python, run:
[`environment.py`](../ml-agents-envs/mlagents_envs/environment.py). To load
a Unity environment from a built binary file, put the file in the same directory
as `envs`. For example, if the filename of your Unity environment is 3DBall.app, in python, run:
from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.environment import UnityEnvironment
env = UnityEnvironment(file_name="3DBall", base_port=5005, seed=1, side_channels=[])
```

For example :
```python
from mlagents.envs.environment import UnityEnvironment
from mlagents.envs.side_channel.engine_configuration_channel import EngineConfigurationChannel
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.side_channel.engine_configuration_channel import EngineConfigurationChannel
channel = EngineConfigurationChannel()

* `list_properties` Returns a list of all the string identifiers of the properties
```python
from mlagents.envs.environment import UnityEnvironment
from mlagents.envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.side_channel.float_properties_channel import FloatPropertiesChannel
channel = FloatPropertiesChannel()

2
docs/Training-Generalized-Reinforcement-Learning-Agents.md


* **sub-arguments** - `intervals`
The implementation of the samplers can be found at `ml-agents-envs/mlagents/envs/sampler_class.py`.
The implementation of the samplers can be found at `ml-agents-envs/mlagents_envs/sampler_class.py`.
### Defining a New Sampler Type

10
docs/Training-on-Amazon-Web-Service.md


9. Test the instance setup from Python using:
```python
from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.environment import UnityEnvironment
env = UnityEnvironment(<your_env>)
```

Logging to /home/ubuntu/.config/unity3d/<Some_Path>/Player.log
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/ml-agents/ml-agents/mlagents/envs/environment.py", line 63, in __init__
File "/home/ubuntu/ml-agents/ml-agents/mlagents_envs/environment.py", line 63, in __init__
File "/home/ubuntu/ml-agents/ml-agents/mlagents/envs/environment.py", line 489, in send_academy_parameters
File "/home/ubuntu/ml-agents/ml-agents/mlagents_envs/environment.py", line 489, in send_academy_parameters
File "/home/ubuntu/ml-agents/ml-agents/mlagents/envs/rpc_communicator.py", line 60, in initialize
mlagents.envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
File "/home/ubuntu/ml-agents/ml-agents/mlagents_envs/rpc_communicator.py", line 60, in initialize
mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
The environment does not need user interaction to launch
The environment and the Python interface have compatible versions.
```

2
docs/Training-on-Microsoft-Azure.md


7. Test the instance setup from Python using:
```python
from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.environment import UnityEnvironment
env = UnityEnvironment(<your_env>)
```

2
gym-unity/gym_unity/__init__.py


__version__ = "0.12.0"
__version__ = "0.12.1"

2
gym-unity/gym_unity/envs/__init__.py


import itertools
import gym
import numpy as np
from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.environment import UnityEnvironment
from gym import error, spaces

2
gym-unity/gym_unity/tests/test_gym.py


from gym import spaces
from gym_unity.envs import UnityEnv, UnityGymException
from mlagents.envs.base_env import AgentGroupSpec, ActionType, BatchedStepResult
from mlagents_envs.base_env import AgentGroupSpec, ActionType, BatchedStepResult
@mock.patch("gym_unity.envs.UnityEnvironment")

2
ml-agents-envs/README.md


The `mlagents_envs` Python package contains one sub package:
* `mlagents.envs`: A low level API which allows you to interact directly with a
* `mlagents_envs`: A low level API which allows you to interact directly with a
Unity Environment. See
[here](https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Python-API.md)
for more information on using this package.

8
ml-agents-envs/setup.py


import os
import sys
from setuptools import setup
from setuptools import setup, find_packages
import mlagents.envs
import mlagents_envs
VERSION = mlagents.envs.__version__
VERSION = mlagents_envs.__version__
here = os.path.abspath(os.path.dirname(__file__))

"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
packages=["mlagents.envs", "mlagents.envs.communicator_objects"], # Required
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
zip_safe=False,
install_requires=[
"cloudpickle",

2
ml-agents/README.md


The `mlagents` Python package contains two sub packages:
* `mlagents.envs`: A low level API which allows you to interact directly with a
* `mlagents_envs`: A low level API which allows you to interact directly with a
Unity Environment. See
[here](https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Python-API.md)
for more information on using this package.

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


__version__ = "0.12.0"
__version__ = "0.12.1"

10
ml-agents/mlagents/trainers/brain.py


import numpy as np
import io
from mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.communicator_objects.observation_pb2 import ObservationProto
from mlagents.envs.timers import hierarchical_timer, timed
from mlagents_envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents_envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents_envs.communicator_objects.observation_pb2 import ObservationProto
from mlagents_envs.timers import hierarchical_timer, timed
logger = logging.getLogger("mlagents.envs")
logger = logging.getLogger("mlagents.trainers")
class CameraResolution(NamedTuple):

4
ml-agents/mlagents/trainers/brain_conversion_utils.py


from mlagents.trainers.brain import BrainInfo, BrainParameters, CameraResolution
from mlagents.envs.base_env import BatchedStepResult, AgentGroupSpec
from mlagents.envs.exception import UnityEnvironmentException
from mlagents_envs.base_env import BatchedStepResult, AgentGroupSpec
from mlagents_envs.exception import UnityEnvironmentException
import numpy as np
from typing import List

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


import h5py
from typing import List, BinaryIO
from mlagents.envs.exception import UnityException
from mlagents_envs.exception import UnityException
class BufferException(UnityException):

8
ml-agents/mlagents/trainers/demo_loader.py


import numpy as np
from mlagents.trainers.buffer import AgentBuffer
from mlagents.trainers.brain import BrainParameters, BrainInfo
from mlagents.envs.communicator_objects.agent_info_action_pair_pb2 import (
from mlagents_envs.communicator_objects.agent_info_action_pair_pb2 import (
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.communicator_objects.demonstration_meta_pb2 import (
from mlagents_envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents_envs.communicator_objects.demonstration_meta_pb2 import (
from mlagents.envs.timers import timed, hierarchical_timer
from mlagents_envs.timers import timed, hierarchical_timer
from google.protobuf.internal.decoder import _DecodeVarint32 # type: ignore

5
ml-agents/mlagents/trainers/env_manager.py


brain_name_to_action_info: Dict[str, ActionInfo]
def has_actions_for_brain(self, brain_name: str) -> bool:
return (
brain_name in self.brain_name_to_action_info
and self.brain_name_to_action_info[brain_name].outputs is not None
return brain_name in self.brain_name_to_action_info and bool(
self.brain_name_to_action_info[brain_name].outputs
)

8
ml-agents/mlagents/trainers/exception.py


pass
class TrainerConfigError(Exception):
"""
Any error related to the configuration of trainers in the ML-Agents Toolkit.
"""
pass
class CurriculumError(TrainerError):
"""
Any error related to training with a curriculum.

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


from typing import Any, Callable, Optional, List, NamedTuple
import mlagents.trainers
import mlagents.envs
import mlagents_envs
from mlagents import tf_utils
from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.exception import TrainerError

from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.environment import UnityEnvironment
from mlagents.envs.base_env import BaseEnv
from mlagents_envs.base_env import BaseEnv
from mlagents.envs.side_channel.side_channel import SideChannel
from mlagents.envs.side_channel.engine_configuration_channel import EngineConfig
from mlagents_envs.side_channel.side_channel import SideChannel
from mlagents_envs.side_channel.engine_configuration_channel import EngineConfig
class CommandLineOptions(NamedTuple):

# pylint: disable=no-member
return f""" Version information:
ml-agents: {mlagents.trainers.__version__},
ml-agents-envs: {mlagents.envs.__version__},
ml-agents-envs: {mlagents_envs.__version__},
Communicator API: {UnityEnvironment.API_VERSION},
TensorFlow: {tf_utils.tf.__version__}"""

print(get_version_string())
options = parse_command_line()
trainer_logger = logging.getLogger("mlagents.trainers")
env_logger = logging.getLogger("mlagents.envs")
env_logger = logging.getLogger("mlagents_envs")
trainer_logger.info(options)
if options.debug:
trainer_logger.setLevel("DEBUG")

11
ml-agents/mlagents/trainers/meta_curriculum.py


try:
for curriculum_filename in os.listdir(curriculum_folder):
# This process requires JSON files
if not curriculum_filename.lower().endswith(".json"):
brain_name, extension = os.path.splitext(curriculum_filename)
if extension.lower() != ".json":
brain_name = curriculum_filename.split(".")[0]
curriculum_filepath = os.path.join(
curriculum_folder, curriculum_filename
)

for brain_name, lesson in lesson_nums.items():
self.brains_to_curriculums[brain_name].lesson_num = lesson
def _lesson_ready_to_increment(self, brain_name, reward_buff_size):
def _lesson_ready_to_increment(
self, brain_name: str, reward_buff_size: int
) -> bool:
"""Determines whether the curriculum of a specified brain is ready
to attempt an increment.

Whether the curriculum of the specified brain should attempt to
increment its lesson.
"""
if brain_name not in self.brains_to_curriculums:
return False
return reward_buff_size >= (
self.brains_to_curriculums[brain_name].min_lesson_length
)

2
ml-agents/mlagents/trainers/ppo/multi_gpu_policy.py


from tensorflow.python.client import device_lib
from mlagents.trainers.brain import BrainParameters
from mlagents.envs.timers import timed
from mlagents_envs.timers import timed
from mlagents.trainers.models import EncoderType, LearningRateSchedule
from mlagents.trainers.ppo.policy import PPOPolicy
from mlagents.trainers.ppo.models import PPOModel

2
ml-agents/mlagents/trainers/ppo/policy.py


from mlagents.tf_utils import tf
from mlagents.envs.timers import timed
from mlagents_envs.timers import timed
from mlagents.trainers.brain import BrainParameters
from mlagents.trainers.models import EncoderType, LearningRateSchedule
from mlagents.trainers.ppo.models import PPOModel

2
ml-agents/mlagents/trainers/sac/policy.py


import numpy as np
from mlagents.tf_utils import tf
from mlagents.envs.timers import timed
from mlagents_envs.timers import timed
from mlagents.trainers.brain import BrainInfo, BrainParameters
from mlagents.trainers.models import EncoderType, LearningRateSchedule
from mlagents.trainers.sac.models import SACModel

2
ml-agents/mlagents/trainers/sac/trainer.py


import numpy as np
from mlagents.envs.timers import timed
from mlagents_envs.timers import timed
from mlagents.trainers.sac.policy import SACPolicy
from mlagents.trainers.rl_trainer import RLTrainer
from mlagents.trainers.trajectory import Trajectory, SplitObservations

6
ml-agents/mlagents/trainers/simple_env_manager.py


from typing import Dict, List
from mlagents.envs.base_env import BaseEnv
from mlagents_envs.base_env import BaseEnv
from mlagents.envs.timers import timed
from mlagents_envs.timers import timed
from mlagents.envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents_envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents.trainers.brain_conversion_utils import (
step_result_to_brain_info,
group_spec_to_brain_parameters,

16
ml-agents/mlagents/trainers/subprocess_env_manager.py


from typing import Dict, NamedTuple, List, Any, Optional, Callable, Set
import cloudpickle
from mlagents.envs.environment import UnityEnvironment
from mlagents.envs.exception import UnityCommunicationException, UnityTimeOutException
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.exception import UnityCommunicationException, UnityTimeOutException
from mlagents.envs.base_env import BaseEnv
from mlagents_envs.base_env import BaseEnv
from mlagents.envs.timers import (
from mlagents_envs.timers import (
TimerNode,
timed,
hierarchical_timer,

from mlagents.trainers.brain import AllBrainInfo, BrainParameters
from mlagents.trainers.action_info import ActionInfo
from mlagents.envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents.envs.side_channel.engine_configuration_channel import (
from mlagents_envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents_envs.side_channel.engine_configuration_channel import (
from mlagents.envs.side_channel.side_channel import SideChannel
from mlagents_envs.side_channel.side_channel import SideChannel
logger = logging.getLogger("mlagents.envs")
logger = logging.getLogger("mlagents.trainers")
class EnvironmentCommand(NamedTuple):

12
ml-agents/mlagents/trainers/tests/test_bcmodule.py


# Test default values
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_bcmodule_defaults(mock_env):
# See if default values match
mock_brain = mb.create_mock_3dball_brain()

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_bcmodule_update(mock_env, trainer_config):
mock_brain = mb.create_mock_3dball_brain()
env, policy = create_policy_with_bc_mock(

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_bcmodule_constant_lr_update(mock_env, trainer_config):
mock_brain = mb.create_mock_3dball_brain()
trainer_config["behavioral_cloning"]["steps"] = 0

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_bcmodule_rnn_update(mock_env, trainer_config):
mock_brain = mb.create_mock_3dball_brain()
env, policy = create_policy_with_bc_mock(

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_bcmodule_dc_visual_update(mock_env, trainer_config):
mock_brain = mb.create_mock_banana_brain()
env, policy = create_policy_with_bc_mock(

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_bcmodule_rnn_dc_update(mock_env, trainer_config):
mock_brain = mb.create_mock_banana_brain()
env, policy = create_policy_with_bc_mock(

1
ml-agents/mlagents/trainers/tests/test_curriculum.py


from mlagents.trainers.exception import CurriculumConfigError, CurriculumLoadingError
from mlagents.trainers.curriculum import Curriculum
dummy_curriculum_json_str = """
{
"measure" : "reward",

53
ml-agents/mlagents/trainers/tests/test_meta_curriculum.py


import pytest
from unittest.mock import patch, call
from unittest.mock import patch, call, mock_open
from mlagents.trainers.curriculum import Curriculum
from mlagents.trainers.tests.test_simple_rl import (
Simple1DEnvironment,
_check_environment_trains,
BRAIN_NAME,
)
from mlagents.trainers.tests.test_curriculum import dummy_curriculum_json_str
class MetaCurriculumTest(MetaCurriculum):

@patch("mlagents.trainers.curriculum.Curriculum.get_config", return_value={})
@patch("mlagents.trainers.curriculum.Curriculum.__init__", return_value=None)
@patch("os.listdir", return_value=["Brain1.json", "Brain2.json"])
@patch("os.listdir", return_value=["Brain1.json", "Brain2.test.json"])
def test_init_meta_curriculum_happy_path(
listdir, mock_curriculum_init, mock_curriculum_get_config, default_reset_parameters
):

assert "Brain1" in meta_curriculum.brains_to_curriculums
assert "Brain2" in meta_curriculum.brains_to_curriculums
assert "Brain2.test" in meta_curriculum.brains_to_curriculums
calls = [call("test/Brain1.json"), call("test/Brain2.json")]
calls = [call("test/Brain1.json"), call("test/Brain2.test.json")]
mock_curriculum_init.assert_has_calls(calls)

new_reset_parameters.update(more_reset_parameters)
assert meta_curriculum.get_config() == new_reset_parameters
META_CURRICULUM_CONFIG = """
default:
trainer: ppo
batch_size: 16
beta: 5.0e-3
buffer_size: 64
epsilon: 0.2
hidden_units: 128
lambd: 0.95
learning_rate: 5.0e-3
max_steps: 100
memory_size: 256
normalize: false
num_epoch: 3
num_layers: 2
time_horizon: 64
sequence_length: 64
summary_freq: 50
use_recurrent: false
reward_signals:
extrinsic:
strength: 1.0
gamma: 0.99
"""
@pytest.mark.parametrize("curriculum_brain_name", [BRAIN_NAME, "WrongBrainName"])
def test_simple_metacurriculum(curriculum_brain_name):
env = Simple1DEnvironment(use_discrete=False)
with patch(
"builtins.open", new_callable=mock_open, read_data=dummy_curriculum_json_str
):
curriculum = Curriculum("TestBrain.json")
mc = MetaCurriculumTest({curriculum_brain_name: curriculum})
_check_environment_trains(env, META_CURRICULUM_CONFIG, mc, -100.0)

14
ml-agents/mlagents/trainers/tests/test_ppo.py


from mlagents.trainers.ppo.trainer import PPOTrainer, discount_rewards
from mlagents.trainers.ppo.policy import PPOPolicy
from mlagents.trainers.brain import BrainParameters
from mlagents.envs.environment import UnityEnvironment
from mlagents.envs.mock_communicator import MockCommunicator
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.mock_communicator import MockCommunicator
from mlagents.trainers.tests import mock_brain as mb
from mlagents.trainers.tests.mock_brain import make_brain_parameters
from mlagents.trainers.tests.test_trajectory import make_fake_trajectory

NUM_AGENTS = 12
@mock.patch("mlagents.envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
def test_ppo_policy_evaluate(mock_communicator, mock_launcher, dummy_config):
tf.reset_default_graph()
mock_communicator.return_value = MockCommunicator(

env.close()
@mock.patch("mlagents.envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
def test_ppo_get_value_estimates(mock_communicator, mock_launcher, dummy_config):
tf.reset_default_graph()

assert trainer.step == 10
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
@pytest.mark.parametrize("use_discrete", [True, False])
def test_trainer_update_policy(mock_env, dummy_config, use_discrete):
env, mock_brain, _ = mb.setup_mock_env_and_brains(

16
ml-agents/mlagents/trainers/tests/test_reward_signals.py


@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_gail_cc(mock_env, trainer_config, gail_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, gail_dummy_config, False, False, False

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_gail_dc_visual(mock_env, trainer_config, gail_dummy_config):
gail_dummy_config["gail"]["demo_path"] = (
os.path.dirname(os.path.abspath(__file__)) + "/testdcvis.demo"

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_gail_rnn(mock_env, trainer_config, gail_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, gail_dummy_config, True, False, False

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_curiosity_cc(mock_env, trainer_config, curiosity_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, curiosity_dummy_config, False, False, False

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_curiosity_dc(mock_env, trainer_config, curiosity_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, curiosity_dummy_config, False, True, False

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_curiosity_visual(mock_env, trainer_config, curiosity_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, curiosity_dummy_config, False, False, True

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_curiosity_rnn(mock_env, trainer_config, curiosity_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, curiosity_dummy_config, True, False, False

@pytest.mark.parametrize(
"trainer_config", [ppo_dummy_config(), sac_dummy_config()], ids=["ppo", "sac"]
)
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_extrinsic(mock_env, trainer_config, curiosity_dummy_config):
env, policy = create_policy_mock(
mock_env, trainer_config, curiosity_dummy_config, False, False, False

10
ml-agents/mlagents/trainers/tests/test_sac.py


return env, policy
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_sac_cc_policy(mock_env, dummy_config):
# Test evaluate
tf.reset_default_graph()

@pytest.mark.parametrize("discrete", [True, False], ids=["discrete", "continuous"])
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_sac_update_reward_signals(mock_env, dummy_config, discrete):
# Test evaluate
tf.reset_default_graph()

env.close()
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_sac_dc_policy(mock_env, dummy_config):
# Test evaluate
tf.reset_default_graph()

env.close()
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_sac_visual_policy(mock_env, dummy_config):
# Test evaluate
tf.reset_default_graph()

assert type(run_out) is dict
@mock.patch("mlagents.envs.environment.UnityEnvironment")
@mock.patch("mlagents_envs.environment.UnityEnvironment")
def test_sac_rnn_policy(mock_env, dummy_config):
# Test evaluate
tf.reset_default_graph()

22
ml-agents/mlagents/trainers/tests/test_simple_rl.py


from mlagents.trainers.trainer_controller import TrainerController
from mlagents.trainers.trainer_util import TrainerFactory
from mlagents.envs.base_env import (
from mlagents_envs.base_env import (
BaseEnv,
AgentGroupSpec,
BatchedStepResult,

from mlagents.trainers.simple_env_manager import SimpleEnvManager
from mlagents.trainers.sampler_class import SamplerManager
from mlagents.trainers.stats import StatsReporter
from mlagents.envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents_envs.side_channel.float_properties_channel import FloatPropertiesChannel
BRAIN_NAME = __name__
OBS_SIZE = 1

pass
PPO_CONFIG = """
default:
PPO_CONFIG = f"""
{BRAIN_NAME}:
trainer: ppo
batch_size: 16
beta: 5.0e-3

gamma: 0.99
"""
SAC_CONFIG = """
default:
SAC_CONFIG = f"""
{BRAIN_NAME}:
trainer: sac
batch_size: 8
buffer_size: 500

"""
def _check_environment_trains(env, config):
def _check_environment_trains(
env, config, meta_curriculum=None, success_threshold=0.99
):
# Create controller and begin training.
with tempfile.TemporaryDirectory() as dir:
run_id = "id"

train_model=True,
load_model=False,
seed=seed,
meta_curriculum=None,
meta_curriculum=meta_curriculum,
multi_gpu=False,
)

model_path=dir,
run_id=run_id,
meta_curriculum=None,
meta_curriculum=meta_curriculum,
train=True,
training_seed=seed,
sampler_manager=SamplerManager(None),

print(tc._get_measure_vals())
for brain_name, mean_reward in tc._get_measure_vals().items():
assert not math.isnan(mean_reward)
assert mean_reward > 0.99
assert mean_reward > success_threshold
@pytest.mark.parametrize("use_discrete", [True, False])

4
ml-agents/mlagents/trainers/tests/test_subprocess_env_manager.py


EnvironmentResponse,
StepResponse,
)
from mlagents.envs.base_env import BaseEnv
from mlagents.envs.side_channel.engine_configuration_channel import EngineConfig
from mlagents_envs.base_env import BaseEnv
from mlagents_envs.side_channel.engine_configuration_channel import EngineConfig
def mock_env_factory(worker_id):

73
ml-agents/mlagents/trainers/tests/test_trainer_util.py


from mlagents.trainers.trainer_util import load_config, _load_config
from mlagents.trainers.trainer_metrics import TrainerMetrics
from mlagents.trainers.ppo.trainer import PPOTrainer
from mlagents.envs.exception import UnityEnvironmentException
from mlagents.trainers.exception import TrainerConfigError
from mlagents.trainers.brain import BrainParameters
@pytest.fixture

use_curiosity: false
curiosity_strength: 0.0
curiosity_enc_size: 1
reward_signals:
extrinsic:
strength: 1.0
gamma: 0.99
"""
)

BrainParametersMock.return_value.brain_name = "testbrain"
external_brains = {"testbrain": BrainParametersMock()}
with pytest.raises(UnityEnvironmentException):
with pytest.raises(TrainerConfigError):
trainer_factory = trainer_util.TrainerFactory(
trainer_config=bad_config,
summaries_dir=summaries_dir,

trainers[brain_name] = trainer_factory.generate(brain_parameters)
def test_handles_no_default_section():
"""
Make sure the trainer setup handles a missing "default" in the config.
"""
brain_name = "testbrain"
config = dummy_config()
no_default_config = {brain_name: config["default"]}
brain_parameters = BrainParameters(
brain_name=brain_name,
vector_observation_space_size=1,
camera_resolutions=[],
vector_action_space_size=[2],
vector_action_descriptions=[],
vector_action_space_type=0,
)
trainer_factory = trainer_util.TrainerFactory(
trainer_config=no_default_config,
summaries_dir="test_dir",
run_id="testrun",
model_path="model_dir",
keep_checkpoints=1,
train_model=True,
load_model=False,
seed=42,
)
trainer_factory.generate(brain_parameters)
def test_raise_if_no_config_for_brain():
"""
Make sure the trainer setup raises a friendlier exception if both "default" and the brain name
are missing from the config.
"""
brain_name = "testbrain"
config = dummy_config()
bad_config = {"some_other_brain": config["default"]}
brain_parameters = BrainParameters(
brain_name=brain_name,
vector_observation_space_size=1,
camera_resolutions=[],
vector_action_space_size=[2],
vector_action_descriptions=[],
vector_action_space_type=0,
)
trainer_factory = trainer_util.TrainerFactory(
trainer_config=bad_config,
summaries_dir="test_dir",
run_id="testrun",
model_path="model_dir",
keep_checkpoints=1,
train_model=True,
load_model=False,
seed=42,
)
with pytest.raises(TrainerConfigError):
trainer_factory.generate(brain_parameters)
with pytest.raises(UnityEnvironmentException):
with pytest.raises(TrainerConfigError):
load_config("thisFileDefinitelyDoesNotExist.yaml")

- not
- parse
"""
with pytest.raises(UnityEnvironmentException):
with pytest.raises(TrainerConfigError):
fp = io.StringIO(file_contents)
_load_config(fp)

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


import numpy as np
from mlagents.tf_utils import tf
from mlagents.envs.exception import UnityException
from mlagents_envs.exception import UnityException
from mlagents.trainers.policy import Policy
from mlagents.trainers.action_info import ActionInfo
from tensorflow.python.platform import gfile

6
ml-agents/mlagents/trainers/trainer.py


from collections import deque
from mlagents.envs.exception import UnityException
from mlagents.envs.timers import set_gauge
from mlagents_envs.exception import UnityException
from mlagents_envs.timers import set_gauge
from mlagents.trainers.trainer_metrics import TrainerMetrics
from mlagents.trainers.tf_policy import TFPolicy
from mlagents.trainers.stats import StatsReporter

class Trainer(object):
"""This class is the base class for the mlagents.envs.trainers"""
"""This class is the base class for the mlagents_envs.trainers"""
def __init__(
self,

9
ml-agents/mlagents/trainers/trainer_controller.py


from time import time
from mlagents.trainers.env_manager import EnvManager, EnvironmentStep
from mlagents.envs.exception import (
from mlagents_envs.exception import (
from mlagents.envs.timers import hierarchical_timer, get_timer_tree, timed
from mlagents_envs.timers import hierarchical_timer, get_timer_tree, timed
from mlagents.trainers.trainer import Trainer, TrainerMetrics
from mlagents.trainers.meta_curriculum import MetaCurriculum
from mlagents.trainers.trainer_util import TrainerFactory

self.trainer_factory = trainer_factory
self.model_path = model_path
self.summaries_dir = summaries_dir
self.logger = logging.getLogger("mlagents.envs")
self.logger = logging.getLogger("mlagents.trainers")
self.run_id = run_id
self.save_freq = save_freq
self.train_model = train

brain_name,
curriculum,
) in self.meta_curriculum.brains_to_curriculums.items():
# Skip brains that are in the metacurriculum but no trainer yet.
if brain_name not in self.trainers:
continue
if curriculum.measure == "progress":
measure_val = (
self.trainers[brain_name].get_step

59
ml-agents/mlagents/trainers/trainer_util.py


import yaml
from typing import Any, Dict, TextIO
import logging
from mlagents.envs.exception import UnityEnvironmentException
from mlagents.trainers.exception import TrainerConfigError
logger = logging.getLogger("mlagents.trainers")
class TrainerFactory:

:param multi_gpu: Whether to use multi-GPU training
:return:
"""
trainer_parameters = trainer_config["default"].copy()
if "default" not in trainer_config and brain_name not in trainer_config:
raise TrainerConfigError(
f'Trainer config must have either a "default" section, or a section for the brain name ({brain_name}). '
"See config/trainer_config.yaml for an example."
)
trainer_parameters = trainer_config.get("default", {}).copy()
trainer_parameters["summary_path"] = str(run_id) + "_" + brain_name
trainer_parameters["model_path"] = "{basedir}/{name}".format(
basedir=model_path, name=brain_name

_brain_key = trainer_config[_brain_key]
trainer_parameters.update(trainer_config[_brain_key])
min_lesson_length = 1
if meta_curriculum:
if brain_name in meta_curriculum.brains_to_curriculums:
min_lesson_length = meta_curriculum.brains_to_curriculums[
brain_name
].min_lesson_length
else:
logger.warning(
f"Metacurriculum enabled, but no curriculum for brain {brain_name}. "
f"Brains with curricula: {meta_curriculum.brains_to_curriculums.keys()}. "
)
if trainer_parameters["trainer"] == "offline_bc":
if "trainer" not in trainer_parameters:
raise TrainerConfigError(
f'The "trainer" key must be set in your trainer config for brain {brain_name} (or the default brain).'
)
trainer_type = trainer_parameters["trainer"]
if trainer_type == "offline_bc":
elif trainer_parameters["trainer"] == "ppo":
elif trainer_type == "ppo":
meta_curriculum.brains_to_curriculums[brain_name].min_lesson_length
if meta_curriculum
else 1,
min_lesson_length,
trainer_parameters,
train_model,
load_model,

)
elif trainer_parameters["trainer"] == "sac":
elif trainer_type == "sac":
meta_curriculum.brains_to_curriculums[brain_name].min_lesson_length
if meta_curriculum
else 1,
min_lesson_length,
trainer_parameters,
train_model,
load_model,

else:
raise UnityEnvironmentException(
"The trainer config contains "
"an unknown trainer type for "
"brain {}".format(brain_name)
raise TrainerConfigError(
f'The trainer config contains an unknown trainer type "{trainer_type}" for brain {brain_name}'
)
return trainer

with open(config_path) as data_file:
return _load_config(data_file)
except IOError:
raise UnityEnvironmentException(
f"Config file could not be found at {config_path}."
)
raise TrainerConfigError(f"Config file could not be found at {config_path}.")
raise UnityEnvironmentException(
raise TrainerConfigError(
f"There was an error decoding Config file from {config_path}. "
f"Make sure your file is save using UTF-8"
)

try:
return yaml.safe_load(fp)
except yaml.parser.ParserError as e:
raise UnityEnvironmentException(
raise TrainerConfigError(
"Error parsing yaml file. Please check for formatting errors. "
"A tool such as http://www.yamllint.com/ can be helpful with this."
) from e

6
ml-agents/setup.py


import os
import sys
from setuptools import setup, find_namespace_packages
from setuptools import setup, find_packages
from setuptools.command.install import install
import mlagents.trainers

"Programming Language :: Python :: 3.7",
],
# find_namespace_packages will recurse through the directories and find all the packages
packages=find_namespace_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests"]
),
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
zip_safe=False,
install_requires=[
# Test-only dependencies should go in test_requirements.txt, not here.

6
notebooks/getting-started.ipynb


"import numpy as np\n",
"import sys\n",
"\n",
"from mlagents.envs.environment import UnityEnvironment\n",
"from mlagents.envs.side_channel.engine_configuration_channel import EngineConfig, EngineConfigurationChannel\n",
"from mlagents_envs.environment import UnityEnvironment\n",
"from mlagents_envs.side_channel.engine_configuration_channel import EngineConfig, EngineConfigurationChannel\n",
"\n",
"%matplotlib inline\n",
"\n",

"metadata": {},
"source": [
"### 5. Take random actions in the environment\n",
"Once we restart an environment, we can step the environment forward and provide actions to all of the agents within the environment. Here we simply choose random actions based on the `action_space_type` of the default brain. \n",
"Once we restart an environment, we can step the environment forward and provide actions to all of the agents within the environment. Here we simply choose random actions based on the `action_space_type` of the default brain.\n",
"\n",
"Once this cell is executed, 10 messages will be printed that detail how much reward will be accumulated for the next 10 episodes. The Unity environment will then pause, waiting for further signals telling it what to do next. Thus, not seeing any animation is expected when running this cell."
]

12
protobuf-definitions/make.sh


# variables
# GRPC-TOOLS required. Install with `nuget install Grpc.Tools`.
# GRPC-TOOLS required. Install with `nuget install Grpc.Tools`.
SRC_DIR=proto/mlagents/envs/communicator_objects
SRC_DIR=proto/mlagents_envs/communicator_objects
PYTHON_PACKAGE=mlagents/envs/communicator_objects
PYTHON_PACKAGE=mlagents_envs/communicator_objects
# clean
rm -rf $DST_DIR_C

$COMPILER/protoc --proto_path=proto --csharp_out=$DST_DIR_C $SRC_DIR/*.proto
$COMPILER/protoc --proto_path=proto --python_out=$DST_DIR_P --mypy_out=$DST_DIR_P $SRC_DIR/*.proto
# grpc
# grpc
python3 -m grpc_tools.protoc --proto_path=proto --python_out=$DST_DIR_P --grpc_python_out=$DST_DIR_P $SRC_DIR/$GRPC
python3 -m grpc_tools.protoc --proto_path=proto --python_out=$DST_DIR_P --grpc_python_out=$DST_DIR_P $SRC_DIR/$GRPC
do
do
FILE=${FILE##*/}
# echo from .$(basename $FILE) import \* >> $DST_DIR_P/$PYTHON_PACKAGE/__init__.py
echo from .${FILE%.py} import \* >> $DST_DIR_P/$PYTHON_PACKAGE/__init__.py

8
protobuf-definitions/make_for_win.bat


rem variables
rem GRPC-TOOLS required. Install with `nuget install Grpc.Tools`.
rem GRPC-TOOLS required. Install with `nuget install Grpc.Tools`.
set SRC_DIR=proto\mlagents\envs\communicator_objects
set SRC_DIR=proto\mlagents_envs\communicator_objects
set PYTHON_PACKAGE=mlagents\envs\communicator_objects
set PYTHON_PACKAGE=mlagents_envs\communicator_objects
rem clean
rd /s /q %DST_DIR_C%

rem Generate the init file for the python module
rem rm -f $DST_DIR_P/$PYTHON_PACKAGE/__init__.py
setlocal enabledelayedexpansion
for %%i in (%DST_DIR_P%\%PYTHON_PACKAGE%\*.py) do (
for %%i in (%DST_DIR_P%\%PYTHON_PACKAGE%\*.py) do (
set FILE=%%~ni
rem echo from .$(basename $FILE) import * >> $DST_DIR_P/$PYTHON_PACKAGE/__init__.py
echo from .!FILE! import * >> %DST_DIR_P%\%PYTHON_PACKAGE%\__init__.py

2
utils/validate_versions.py


DIRECTORIES = [
"ml-agents/mlagents/trainers",
"ml-agents-envs/mlagents/envs",
"ml-agents-envs/mlagents_envs",
"gym-unity/gym_unity",
]

4
ml-agents-envs/mlagents_envs/tests/test_timers.py


from unittest import mock
from mlagents.envs import timers
from mlagents_envs import timers
@timers.timed

def test_timers() -> None:
with mock.patch(
"mlagents.envs.timers._global_timer_stack", new_callable=timers.TimerStack
"mlagents_envs.timers._global_timer_stack", new_callable=timers.TimerStack
) as test_timer:
# First, run some simple code
with timers.hierarchical_timer("top_level"):

8
ml-agents-envs/mlagents_envs/tests/test_side_channel.py


import struct
from mlagents.envs.side_channel.side_channel import SideChannel
from mlagents.envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents.envs.side_channel.raw_bytes_channel import RawBytesChannel
from mlagents.envs.environment import UnityEnvironment
from mlagents_envs.side_channel.side_channel import SideChannel
from mlagents_envs.side_channel.float_properties_channel import FloatPropertiesChannel
from mlagents_envs.side_channel.raw_bytes_channel import RawBytesChannel
from mlagents_envs.environment import UnityEnvironment
class IntChannel(SideChannel):

10
ml-agents-envs/mlagents_envs/tests/test_rpc_utils.py


from typing import List, Tuple
from mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents.envs.communicator_objects.observation_pb2 import (
from mlagents_envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents_envs.communicator_objects.observation_pb2 import (
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents_envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.base_env import AgentGroupSpec, ActionType
from mlagents_envs.base_env import AgentGroupSpec, ActionType
from mlagents.envs.rpc_utils import (
from mlagents_envs.rpc_utils import (
agent_group_spec_from_proto,
process_pixels,
_process_visual_observation,

4
ml-agents-envs/mlagents_envs/tests/test_rpc_communicator.py


import pytest
from mlagents.envs.rpc_communicator import RpcCommunicator
from mlagents.envs.exception import UnityWorkerInUseException
from mlagents_envs.rpc_communicator import RpcCommunicator
from mlagents_envs.exception import UnityWorkerInUseException
def test_rpc_communicator_checks_port_on_create():

26
ml-agents-envs/mlagents_envs/tests/test_envs.py


import numpy as np
from mlagents.envs.environment import UnityEnvironment
from mlagents.envs.base_env import BatchedStepResult
from mlagents.envs.exception import UnityEnvironmentException, UnityActionException
from mlagents.envs.mock_communicator import MockCommunicator
from mlagents_envs.environment import UnityEnvironment
from mlagents_envs.base_env import BatchedStepResult
from mlagents_envs.exception import UnityEnvironmentException, UnityActionException
from mlagents_envs.mock_communicator import MockCommunicator
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents.envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
def test_initialization(mock_communicator, mock_launcher):
mock_communicator.return_value = MockCommunicator(
discrete_action=False, visual_inputs=0

env.close()
@mock.patch("mlagents.envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
def test_reset(mock_communicator, mock_launcher):
mock_communicator.return_value = MockCommunicator(
discrete_action=False, visual_inputs=0

assert (n_agents,) + shape == obs.shape
@mock.patch("mlagents.envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
def test_step(mock_communicator, mock_launcher):
mock_communicator.return_value = MockCommunicator(
discrete_action=False, visual_inputs=0

assert batched_step_result.done[2]
@mock.patch("mlagents.envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents.envs.environment.UnityEnvironment.get_communicator")
@mock.patch("mlagents_envs.environment.UnityEnvironment.executable_launcher")
@mock.patch("mlagents_envs.environment.UnityEnvironment.get_communicator")
def test_close(mock_communicator, mock_launcher):
comm = MockCommunicator(discrete_action=False, visual_inputs=0)
mock_communicator.return_value = comm

2
ml-agents-envs/mlagents_envs/side_channel/raw_bytes_channel.py


from mlagents.envs.side_channel.side_channel import SideChannel, SideChannelType
from mlagents_envs.side_channel.side_channel import SideChannel, SideChannelType
from typing import List

2
ml-agents-envs/mlagents_envs/side_channel/float_properties_channel.py


from mlagents.envs.side_channel.side_channel import SideChannel, SideChannelType
from mlagents_envs.side_channel.side_channel import SideChannel, SideChannelType
import struct
from typing import Dict, Tuple, Optional, List

4
ml-agents-envs/mlagents_envs/side_channel/engine_configuration_channel.py


from mlagents.envs.side_channel.side_channel import SideChannel, SideChannelType
from mlagents.envs.exception import UnityCommunicationException
from mlagents_envs.side_channel.side_channel import SideChannel, SideChannelType
from mlagents_envs.exception import UnityCommunicationException
import struct
from typing import NamedTuple

10
ml-agents-envs/mlagents_envs/rpc_utils.py


from mlagents.envs.base_env import AgentGroupSpec, ActionType, BatchedStepResult
from mlagents.envs.timers import hierarchical_timer, timed
from mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents_envs.base_env import AgentGroupSpec, ActionType, BatchedStepResult
from mlagents_envs.timers import hierarchical_timer, timed
from mlagents_envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents_envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
import logging
import numpy as np
import io

logger = logging.getLogger("mlagents.envs")
logger = logging.getLogger("mlagents_envs")
def agent_group_spec_from_proto(

10
ml-agents-envs/mlagents_envs/rpc_communicator.py


from concurrent.futures import ThreadPoolExecutor
from .communicator import Communicator
from mlagents.envs.communicator_objects.unity_to_external_pb2_grpc import (
from mlagents_envs.communicator_objects.unity_to_external_pb2_grpc import (
from mlagents.envs.communicator_objects.unity_message_pb2 import UnityMessageProto
from mlagents.envs.communicator_objects.unity_input_pb2 import UnityInputProto
from mlagents.envs.communicator_objects.unity_output_pb2 import UnityOutputProto
from mlagents_envs.communicator_objects.unity_message_pb2 import UnityMessageProto
from mlagents_envs.communicator_objects.unity_input_pb2 import UnityInputProto
from mlagents_envs.communicator_objects.unity_output_pb2 import UnityOutputProto
logger = logging.getLogger("mlagents.envs")
logger = logging.getLogger("mlagents_envs")
class UnityToExternalServicerImplementation(UnityToExternalProtoServicer):

16
ml-agents-envs/mlagents_envs/mock_communicator.py


from .communicator import Communicator
from .environment import UnityEnvironment
from mlagents.envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2 import (
from mlagents_envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto
from mlagents_envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents_envs.communicator_objects.unity_rl_initialization_output_pb2 import (
from mlagents.envs.communicator_objects.unity_input_pb2 import UnityInputProto
from mlagents.envs.communicator_objects.unity_output_pb2 import UnityOutputProto
from mlagents.envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents.envs.communicator_objects.observation_pb2 import (
from mlagents_envs.communicator_objects.unity_input_pb2 import UnityInputProto
from mlagents_envs.communicator_objects.unity_output_pb2 import UnityOutputProto
from mlagents_envs.communicator_objects.agent_info_pb2 import AgentInfoProto
from mlagents_envs.communicator_objects.observation_pb2 import (
from mlagents.envs.communicator_objects.space_type_pb2 import discrete, continuous
from mlagents_envs.communicator_objects.space_type_pb2 import discrete, continuous
class MockCommunicator(Communicator):

2
ml-agents-envs/mlagents_envs/exception.py


import logging
logger = logging.getLogger("mlagents.envs")
logger = logging.getLogger("mlagents_envs")
class UnityException(Exception):

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


import subprocess
from typing import Dict, List, Optional, Any
from mlagents.envs.side_channel.side_channel import SideChannel
from mlagents_envs.side_channel.side_channel import SideChannel
from mlagents.envs.base_env import (
from mlagents_envs.base_env import (
BaseEnv,
BatchedStepResult,
AgentGroupSpec,

from mlagents.envs.timers import timed, hierarchical_timer
from mlagents.envs.exception import (
from mlagents_envs.timers import timed, hierarchical_timer
from mlagents_envs.exception import (
UnityEnvironmentException,
UnityCommunicationException,
UnityActionException,

from mlagents.envs.communicator_objects.command_pb2 import STEP, RESET
from mlagents.envs.rpc_utils import (
from mlagents_envs.communicator_objects.command_pb2 import STEP, RESET
from mlagents_envs.rpc_utils import (
from mlagents.envs.communicator_objects.unity_rl_input_pb2 import UnityRLInputProto
from mlagents.envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto
from mlagents.envs.communicator_objects.agent_action_pb2 import AgentActionProto
from mlagents.envs.communicator_objects.unity_output_pb2 import UnityOutputProto
from mlagents.envs.communicator_objects.unity_rl_initialization_input_pb2 import (
from mlagents_envs.communicator_objects.unity_rl_input_pb2 import UnityRLInputProto
from mlagents_envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto
from mlagents_envs.communicator_objects.agent_action_pb2 import AgentActionProto
from mlagents_envs.communicator_objects.unity_output_pb2 import UnityOutputProto
from mlagents_envs.communicator_objects.unity_rl_initialization_input_pb2 import (
from mlagents.envs.communicator_objects.unity_input_pb2 import UnityInputProto
from mlagents_envs.communicator_objects.unity_input_pb2 import UnityInputProto
from .rpc_communicator import RpcCommunicator
from sys import platform

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("mlagents.envs")
logger = logging.getLogger("mlagents_envs")
class UnityEnvironment(BaseEnv):

10
ml-agents-envs/mlagents_envs/communicator_objects/unity_to_external_pb2_grpc.py


# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from mlagents.envs.communicator_objects import unity_message_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2
from mlagents_envs.communicator_objects import unity_message_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__message__pb2
class UnityToExternalProtoStub(object):

"""
self.Exchange = channel.unary_unary(
'/communicator_objects.UnityToExternalProto/Exchange',
request_serializer=mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.SerializeToString,
response_deserializer=mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.FromString,
request_serializer=mlagents__envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.SerializeToString,
response_deserializer=mlagents__envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.FromString,
)

rpc_method_handlers = {
'Exchange': grpc.unary_unary_rpc_method_handler(
servicer.Exchange,
request_deserializer=mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.FromString,
response_serializer=mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.SerializeToString,
request_deserializer=mlagents__envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.FromString,
response_serializer=mlagents__envs_dot_communicator__objects_dot_unity__message__pb2.UnityMessageProto.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(

14
ml-agents-envs/mlagents_envs/communicator_objects/unity_to_external_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_to_external.proto
# source: mlagents_envs/communicator_objects/unity_to_external.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import unity_message_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2
from mlagents_envs.communicator_objects import unity_message_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__message__pb2
name='mlagents/envs/communicator_objects/unity_to_external.proto',
name='mlagents_envs/communicator_objects/unity_to_external.proto',
serialized_pb=_b('\n:mlagents/envs/communicator_objects/unity_to_external.proto\x12\x14\x63ommunicator_objects\x1a\x36mlagents/envs/communicator_objects/unity_message.proto2v\n\x14UnityToExternalProto\x12^\n\x08\x45xchange\x12\'.communicator_objects.UnityMessageProto\x1a\'.communicator_objects.UnityMessageProto\"\x00\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n:mlagents_envs/communicator_objects/unity_to_external.proto\x12\x14\x63ommunicator_objects\x1a\x36mlagents_envs/communicator_objects/unity_message.proto2v\n\x14UnityToExternalProto\x12^\n\x08\x45xchange\x12\'.communicator_objects.UnityMessageProto\x1a\'.communicator_objects.UnityMessageProto\"\x00\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_unity__message__pb2.DESCRIPTOR,])

full_name='communicator_objects.UnityToExternalProto.Exchange',
index=0,
containing_service=None,
input_type=mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2._UNITYMESSAGEPROTO,
output_type=mlagents_dot_envs_dot_communicator__objects_dot_unity__message__pb2._UNITYMESSAGEPROTO,
input_type=mlagents__envs_dot_communicator__objects_dot_unity__message__pb2._UNITYMESSAGEPROTO,
output_type=mlagents__envs_dot_communicator__objects_dot_unity__message__pb2._UNITYMESSAGEPROTO,
options=None,
),
])

8
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_output_pb2.pyi


Message as google___protobuf___message___Message,
)
from mlagents.envs.communicator_objects.agent_info_pb2 import (
AgentInfoProto as mlagents___envs___communicator_objects___agent_info_pb2___AgentInfoProto,
from mlagents_envs.communicator_objects.agent_info_pb2 import (
AgentInfoProto as mlagents_envs___communicator_objects___agent_info_pb2___AgentInfoProto,
)
from typing import (

DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@property
def value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents___envs___communicator_objects___agent_info_pb2___AgentInfoProto]: ...
def value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents_envs___communicator_objects___agent_info_pb2___AgentInfoProto]: ...
value : typing___Optional[typing___Iterable[mlagents___envs___communicator_objects___agent_info_pb2___AgentInfoProto]] = None,
value : typing___Optional[typing___Iterable[mlagents_envs___communicator_objects___agent_info_pb2___AgentInfoProto]] = None,
) -> None: ...
@classmethod
def FromString(cls, s: builtin___bytes) -> UnityRLOutputProto.ListAgentInfoProto: ...

18
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_output_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_rl_output.proto
# source: mlagents_envs/communicator_objects/unity_rl_output.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import agent_info_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_agent__info__pb2
from mlagents_envs.communicator_objects import agent_info_pb2 as mlagents__envs_dot_communicator__objects_dot_agent__info__pb2
name='mlagents/envs/communicator_objects/unity_rl_output.proto',
name='mlagents_envs/communicator_objects/unity_rl_output.proto',
serialized_pb=_b('\n8mlagents/envs/communicator_objects/unity_rl_output.proto\x12\x14\x63ommunicator_objects\x1a\x33mlagents/envs/communicator_objects/agent_info.proto\"\xb9\x02\n\x12UnityRLOutputProto\x12L\n\nagentInfos\x18\x02 \x03(\x0b\x32\x38.communicator_objects.UnityRLOutputProto.AgentInfosEntry\x12\x14\n\x0cside_channel\x18\x03 \x01(\x0c\x1aI\n\x12ListAgentInfoProto\x12\x33\n\x05value\x18\x01 \x03(\x0b\x32$.communicator_objects.AgentInfoProto\x1an\n\x0f\x41gentInfosEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.communicator_objects.UnityRLOutputProto.ListAgentInfoProto:\x02\x38\x01J\x04\x08\x01\x10\x02\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n8mlagents_envs/communicator_objects/unity_rl_output.proto\x12\x14\x63ommunicator_objects\x1a\x33mlagents_envs/communicator_objects/agent_info.proto\"\xb9\x02\n\x12UnityRLOutputProto\x12L\n\nagentInfos\x18\x02 \x03(\x0b\x32\x38.communicator_objects.UnityRLOutputProto.AgentInfosEntry\x12\x14\n\x0cside_channel\x18\x03 \x01(\x0c\x1aI\n\x12ListAgentInfoProto\x12\x33\n\x05value\x18\x01 \x03(\x0b\x32$.communicator_objects.AgentInfoProto\x1an\n\x0f\x41gentInfosEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12J\n\x05value\x18\x02 \x01(\x0b\x32;.communicator_objects.UnityRLOutputProto.ListAgentInfoProto:\x02\x38\x01J\x04\x08\x01\x10\x02\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_agent__info__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_agent__info__pb2.DESCRIPTOR,])

serialized_end=449,
)
_UNITYRLOUTPUTPROTO_LISTAGENTINFOPROTO.fields_by_name['value'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_agent__info__pb2._AGENTINFOPROTO
_UNITYRLOUTPUTPROTO_LISTAGENTINFOPROTO.fields_by_name['value'].message_type = mlagents__envs_dot_communicator__objects_dot_agent__info__pb2._AGENTINFOPROTO
_UNITYRLOUTPUTPROTO_LISTAGENTINFOPROTO.containing_type = _UNITYRLOUTPUTPROTO
_UNITYRLOUTPUTPROTO_AGENTINFOSENTRY.fields_by_name['value'].message_type = _UNITYRLOUTPUTPROTO_LISTAGENTINFOPROTO
_UNITYRLOUTPUTPROTO_AGENTINFOSENTRY.containing_type = _UNITYRLOUTPUTPROTO

ListAgentInfoProto = _reflection.GeneratedProtocolMessageType('ListAgentInfoProto', (_message.Message,), dict(
DESCRIPTOR = _UNITYRLOUTPUTPROTO_LISTAGENTINFOPROTO,
__module__ = 'mlagents.envs.communicator_objects.unity_rl_output_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_output_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityRLOutputProto.ListAgentInfoProto)
))
,

__module__ = 'mlagents.envs.communicator_objects.unity_rl_output_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_output_pb2'
__module__ = 'mlagents.envs.communicator_objects.unity_rl_output_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_output_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityRLOutputProto)
))
_sym_db.RegisterMessage(UnityRLOutputProto)

16
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_input_pb2.pyi


Message as google___protobuf___message___Message,
)
from mlagents.envs.communicator_objects.agent_action_pb2 import (
AgentActionProto as mlagents___envs___communicator_objects___agent_action_pb2___AgentActionProto,
from mlagents_envs.communicator_objects.agent_action_pb2 import (
AgentActionProto as mlagents_envs___communicator_objects___agent_action_pb2___AgentActionProto,
from mlagents.envs.communicator_objects.command_pb2 import (
CommandProto as mlagents___envs___communicator_objects___command_pb2___CommandProto,
from mlagents_envs.communicator_objects.command_pb2 import (
CommandProto as mlagents_envs___communicator_objects___command_pb2___CommandProto,
)
from typing import (

DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@property
def value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents___envs___communicator_objects___agent_action_pb2___AgentActionProto]: ...
def value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents_envs___communicator_objects___agent_action_pb2___AgentActionProto]: ...
value : typing___Optional[typing___Iterable[mlagents___envs___communicator_objects___agent_action_pb2___AgentActionProto]] = None,
value : typing___Optional[typing___Iterable[mlagents_envs___communicator_objects___agent_action_pb2___AgentActionProto]] = None,
) -> None: ...
@classmethod
def FromString(cls, s: builtin___bytes) -> UnityRLInputProto.ListAgentActionProto: ...

def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ...
command = ... # type: mlagents___envs___communicator_objects___command_pb2___CommandProto
command = ... # type: mlagents_envs___communicator_objects___command_pb2___CommandProto
side_channel = ... # type: builtin___bytes
@property

*,
agent_actions : typing___Optional[typing___Mapping[typing___Text, UnityRLInputProto.ListAgentActionProto]] = None,
command : typing___Optional[mlagents___envs___communicator_objects___command_pb2___CommandProto] = None,
command : typing___Optional[mlagents_envs___communicator_objects___command_pb2___CommandProto] = None,
side_channel : typing___Optional[builtin___bytes] = None,
) -> None: ...
@classmethod

22
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_input_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_rl_input.proto
# source: mlagents_envs/communicator_objects/unity_rl_input.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import agent_action_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_agent__action__pb2
from mlagents.envs.communicator_objects import command_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_command__pb2
from mlagents_envs.communicator_objects import agent_action_pb2 as mlagents__envs_dot_communicator__objects_dot_agent__action__pb2
from mlagents_envs.communicator_objects import command_pb2 as mlagents__envs_dot_communicator__objects_dot_command__pb2
name='mlagents/envs/communicator_objects/unity_rl_input.proto',
name='mlagents_envs/communicator_objects/unity_rl_input.proto',
serialized_pb=_b('\n7mlagents/envs/communicator_objects/unity_rl_input.proto\x12\x14\x63ommunicator_objects\x1a\x35mlagents/envs/communicator_objects/agent_action.proto\x1a\x30mlagents/envs/communicator_objects/command.proto\"\xfe\x02\n\x11UnityRLInputProto\x12P\n\ragent_actions\x18\x01 \x03(\x0b\x32\x39.communicator_objects.UnityRLInputProto.AgentActionsEntry\x12\x33\n\x07\x63ommand\x18\x04 \x01(\x0e\x32\".communicator_objects.CommandProto\x12\x14\n\x0cside_channel\x18\x05 \x01(\x0c\x1aM\n\x14ListAgentActionProto\x12\x35\n\x05value\x18\x01 \x03(\x0b\x32&.communicator_objects.AgentActionProto\x1aq\n\x11\x41gentActionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0b\x32<.communicator_objects.UnityRLInputProto.ListAgentActionProto:\x02\x38\x01J\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n7mlagents_envs/communicator_objects/unity_rl_input.proto\x12\x14\x63ommunicator_objects\x1a\x35mlagents_envs/communicator_objects/agent_action.proto\x1a\x30mlagents_envs/communicator_objects/command.proto\"\xfe\x02\n\x11UnityRLInputProto\x12P\n\ragent_actions\x18\x01 \x03(\x0b\x32\x39.communicator_objects.UnityRLInputProto.AgentActionsEntry\x12\x33\n\x07\x63ommand\x18\x04 \x01(\x0e\x32\".communicator_objects.CommandProto\x12\x14\n\x0cside_channel\x18\x05 \x01(\x0c\x1aM\n\x14ListAgentActionProto\x12\x35\n\x05value\x18\x01 \x03(\x0b\x32&.communicator_objects.AgentActionProto\x1aq\n\x11\x41gentActionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12K\n\x05value\x18\x02 \x01(\x0b\x32<.communicator_objects.UnityRLInputProto.ListAgentActionProto:\x02\x38\x01J\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_agent__action__pb2.DESCRIPTOR,mlagents_dot_envs_dot_communicator__objects_dot_command__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_agent__action__pb2.DESCRIPTOR,mlagents__envs_dot_communicator__objects_dot_command__pb2.DESCRIPTOR,])

serialized_end=569,
)
_UNITYRLINPUTPROTO_LISTAGENTACTIONPROTO.fields_by_name['value'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_agent__action__pb2._AGENTACTIONPROTO
_UNITYRLINPUTPROTO_LISTAGENTACTIONPROTO.fields_by_name['value'].message_type = mlagents__envs_dot_communicator__objects_dot_agent__action__pb2._AGENTACTIONPROTO
_UNITYRLINPUTPROTO.fields_by_name['command'].enum_type = mlagents_dot_envs_dot_communicator__objects_dot_command__pb2._COMMANDPROTO
_UNITYRLINPUTPROTO.fields_by_name['command'].enum_type = mlagents__envs_dot_communicator__objects_dot_command__pb2._COMMANDPROTO
DESCRIPTOR.message_types_by_name['UnityRLInputProto'] = _UNITYRLINPUTPROTO
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

DESCRIPTOR = _UNITYRLINPUTPROTO_LISTAGENTACTIONPROTO,
__module__ = 'mlagents.envs.communicator_objects.unity_rl_input_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_input_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityRLInputProto.ListAgentActionProto)
))
,

__module__ = 'mlagents.envs.communicator_objects.unity_rl_input_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_input_pb2'
__module__ = 'mlagents.envs.communicator_objects.unity_rl_input_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_input_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityRLInputProto)
))
_sym_db.RegisterMessage(UnityRLInputProto)

8
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_initialization_output_pb2.pyi


Message as google___protobuf___message___Message,
)
from mlagents.envs.communicator_objects.brain_parameters_pb2 import (
BrainParametersProto as mlagents___envs___communicator_objects___brain_parameters_pb2___BrainParametersProto,
from mlagents_envs.communicator_objects.brain_parameters_pb2 import (
BrainParametersProto as mlagents_envs___communicator_objects___brain_parameters_pb2___BrainParametersProto,
)
from typing import (

log_path = ... # type: typing___Text
@property
def brain_parameters(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents___envs___communicator_objects___brain_parameters_pb2___BrainParametersProto]: ...
def brain_parameters(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents_envs___communicator_objects___brain_parameters_pb2___BrainParametersProto]: ...
def __init__(self,
*,

brain_parameters : typing___Optional[typing___Iterable[mlagents___envs___communicator_objects___brain_parameters_pb2___BrainParametersProto]] = None,
brain_parameters : typing___Optional[typing___Iterable[mlagents_envs___communicator_objects___brain_parameters_pb2___BrainParametersProto]] = None,
) -> None: ...
@classmethod
def FromString(cls, s: builtin___bytes) -> UnityRLInitializationOutputProto: ...

14
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_initialization_output_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_rl_initialization_output.proto
# source: mlagents_envs/communicator_objects/unity_rl_initialization_output.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import brain_parameters_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_brain__parameters__pb2
from mlagents_envs.communicator_objects import brain_parameters_pb2 as mlagents__envs_dot_communicator__objects_dot_brain__parameters__pb2
name='mlagents/envs/communicator_objects/unity_rl_initialization_output.proto',
name='mlagents_envs/communicator_objects/unity_rl_initialization_output.proto',
serialized_pb=_b('\nGmlagents/envs/communicator_objects/unity_rl_initialization_output.proto\x12\x14\x63ommunicator_objects\x1a\x39mlagents/envs/communicator_objects/brain_parameters.proto\"\x9f\x01\n UnityRLInitializationOutputProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08log_path\x18\x03 \x01(\t\x12\x44\n\x10\x62rain_parameters\x18\x05 \x03(\x0b\x32*.communicator_objects.BrainParametersProtoJ\x04\x08\x06\x10\x07\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\nGmlagents_envs/communicator_objects/unity_rl_initialization_output.proto\x12\x14\x63ommunicator_objects\x1a\x39mlagents_envs/communicator_objects/brain_parameters.proto\"\x9f\x01\n UnityRLInitializationOutputProto\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08log_path\x18\x03 \x01(\t\x12\x44\n\x10\x62rain_parameters\x18\x05 \x03(\x0b\x32*.communicator_objects.BrainParametersProtoJ\x04\x08\x06\x10\x07\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_brain__parameters__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_brain__parameters__pb2.DESCRIPTOR,])

serialized_end=316,
)
_UNITYRLINITIALIZATIONOUTPUTPROTO.fields_by_name['brain_parameters'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_brain__parameters__pb2._BRAINPARAMETERSPROTO
_UNITYRLINITIALIZATIONOUTPUTPROTO.fields_by_name['brain_parameters'].message_type = mlagents__envs_dot_communicator__objects_dot_brain__parameters__pb2._BRAINPARAMETERSPROTO
__module__ = 'mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_initialization_output_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityRLInitializationOutputProto)
))
_sym_db.RegisterMessage(UnityRLInitializationOutputProto)

8
ml-agents-envs/mlagents_envs/communicator_objects/unity_rl_initialization_input_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_rl_initialization_input.proto
# source: mlagents_envs/communicator_objects/unity_rl_initialization_input.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

DESCRIPTOR = _descriptor.FileDescriptor(
name='mlagents/envs/communicator_objects/unity_rl_initialization_input.proto',
name='mlagents_envs/communicator_objects/unity_rl_initialization_input.proto',
serialized_pb=_b('\nFmlagents/envs/communicator_objects/unity_rl_initialization_input.proto\x12\x14\x63ommunicator_objects\"/\n\x1fUnityRLInitializationInputProto\x12\x0c\n\x04seed\x18\x01 \x01(\x05\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\nFmlagents_envs/communicator_objects/unity_rl_initialization_input.proto\x12\x14\x63ommunicator_objects\"/\n\x1fUnityRLInitializationInputProto\x12\x0c\n\x04seed\x18\x01 \x01(\x05\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)

UnityRLInitializationInputProto = _reflection.GeneratedProtocolMessageType('UnityRLInitializationInputProto', (_message.Message,), dict(
DESCRIPTOR = _UNITYRLINITIALIZATIONINPUTPROTO,
__module__ = 'mlagents.envs.communicator_objects.unity_rl_initialization_input_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_rl_initialization_input_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityRLInitializationInputProto)
))
_sym_db.RegisterMessage(UnityRLInitializationInputProto)

16
ml-agents-envs/mlagents_envs/communicator_objects/unity_output_pb2.pyi


Message as google___protobuf___message___Message,
)
from mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2 import (
UnityRLInitializationOutputProto as mlagents___envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutputProto,
from mlagents_envs.communicator_objects.unity_rl_initialization_output_pb2 import (
UnityRLInitializationOutputProto as mlagents_envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutputProto,
from mlagents.envs.communicator_objects.unity_rl_output_pb2 import (
UnityRLOutputProto as mlagents___envs___communicator_objects___unity_rl_output_pb2___UnityRLOutputProto,
from mlagents_envs.communicator_objects.unity_rl_output_pb2 import (
UnityRLOutputProto as mlagents_envs___communicator_objects___unity_rl_output_pb2___UnityRLOutputProto,
)
from typing import (

DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@property
def rl_output(self) -> mlagents___envs___communicator_objects___unity_rl_output_pb2___UnityRLOutputProto: ...
def rl_output(self) -> mlagents_envs___communicator_objects___unity_rl_output_pb2___UnityRLOutputProto: ...
def rl_initialization_output(self) -> mlagents___envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutputProto: ...
def rl_initialization_output(self) -> mlagents_envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutputProto: ...
rl_output : typing___Optional[mlagents___envs___communicator_objects___unity_rl_output_pb2___UnityRLOutputProto] = None,
rl_initialization_output : typing___Optional[mlagents___envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutputProto] = None,
rl_output : typing___Optional[mlagents_envs___communicator_objects___unity_rl_output_pb2___UnityRLOutputProto] = None,
rl_initialization_output : typing___Optional[mlagents_envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutputProto] = None,
) -> None: ...
@classmethod
def FromString(cls, s: builtin___bytes) -> UnityOutputProto: ...

18
ml-agents-envs/mlagents_envs/communicator_objects/unity_output_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_output.proto
# source: mlagents_envs/communicator_objects/unity_output.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import unity_rl_output_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__output__pb2
from mlagents.envs.communicator_objects import unity_rl_initialization_output_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__initialization__output__pb2
from mlagents_envs.communicator_objects import unity_rl_output_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__rl__output__pb2
from mlagents_envs.communicator_objects import unity_rl_initialization_output_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__rl__initialization__output__pb2
name='mlagents/envs/communicator_objects/unity_output.proto',
name='mlagents_envs/communicator_objects/unity_output.proto',
serialized_pb=_b('\n5mlagents/envs/communicator_objects/unity_output.proto\x12\x14\x63ommunicator_objects\x1a\x38mlagents/envs/communicator_objects/unity_rl_output.proto\x1aGmlagents/envs/communicator_objects/unity_rl_initialization_output.proto\"\xa9\x01\n\x10UnityOutputProto\x12;\n\trl_output\x18\x01 \x01(\x0b\x32(.communicator_objects.UnityRLOutputProto\x12X\n\x18rl_initialization_output\x18\x02 \x01(\x0b\x32\x36.communicator_objects.UnityRLInitializationOutputProtoB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n5mlagents_envs/communicator_objects/unity_output.proto\x12\x14\x63ommunicator_objects\x1a\x38mlagents_envs/communicator_objects/unity_rl_output.proto\x1aGmlagents_envs/communicator_objects/unity_rl_initialization_output.proto\"\xa9\x01\n\x10UnityOutputProto\x12;\n\trl_output\x18\x01 \x01(\x0b\x32(.communicator_objects.UnityRLOutputProto\x12X\n\x18rl_initialization_output\x18\x02 \x01(\x0b\x32\x36.communicator_objects.UnityRLInitializationOutputProtoB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__output__pb2.DESCRIPTOR,mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__initialization__output__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_unity__rl__output__pb2.DESCRIPTOR,mlagents__envs_dot_communicator__objects_dot_unity__rl__initialization__output__pb2.DESCRIPTOR,])

serialized_end=380,
)
_UNITYOUTPUTPROTO.fields_by_name['rl_output'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__output__pb2._UNITYRLOUTPUTPROTO
_UNITYOUTPUTPROTO.fields_by_name['rl_initialization_output'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__initialization__output__pb2._UNITYRLINITIALIZATIONOUTPUTPROTO
_UNITYOUTPUTPROTO.fields_by_name['rl_output'].message_type = mlagents__envs_dot_communicator__objects_dot_unity__rl__output__pb2._UNITYRLOUTPUTPROTO
_UNITYOUTPUTPROTO.fields_by_name['rl_initialization_output'].message_type = mlagents__envs_dot_communicator__objects_dot_unity__rl__initialization__output__pb2._UNITYRLINITIALIZATIONOUTPUTPROTO
__module__ = 'mlagents.envs.communicator_objects.unity_output_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_output_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityOutputProto)
))
_sym_db.RegisterMessage(UnityOutputProto)

24
ml-agents-envs/mlagents_envs/communicator_objects/unity_message_pb2.pyi


Message as google___protobuf___message___Message,
)
from mlagents.envs.communicator_objects.header_pb2 import (
HeaderProto as mlagents___envs___communicator_objects___header_pb2___HeaderProto,
from mlagents_envs.communicator_objects.header_pb2 import (
HeaderProto as mlagents_envs___communicator_objects___header_pb2___HeaderProto,
from mlagents.envs.communicator_objects.unity_input_pb2 import (
UnityInputProto as mlagents___envs___communicator_objects___unity_input_pb2___UnityInputProto,
from mlagents_envs.communicator_objects.unity_input_pb2 import (
UnityInputProto as mlagents_envs___communicator_objects___unity_input_pb2___UnityInputProto,
from mlagents.envs.communicator_objects.unity_output_pb2 import (
UnityOutputProto as mlagents___envs___communicator_objects___unity_output_pb2___UnityOutputProto,
from mlagents_envs.communicator_objects.unity_output_pb2 import (
UnityOutputProto as mlagents_envs___communicator_objects___unity_output_pb2___UnityOutputProto,
)
from typing import (

DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@property
def header(self) -> mlagents___envs___communicator_objects___header_pb2___HeaderProto: ...
def header(self) -> mlagents_envs___communicator_objects___header_pb2___HeaderProto: ...
def unity_output(self) -> mlagents___envs___communicator_objects___unity_output_pb2___UnityOutputProto: ...
def unity_output(self) -> mlagents_envs___communicator_objects___unity_output_pb2___UnityOutputProto: ...
def unity_input(self) -> mlagents___envs___communicator_objects___unity_input_pb2___UnityInputProto: ...
def unity_input(self) -> mlagents_envs___communicator_objects___unity_input_pb2___UnityInputProto: ...
header : typing___Optional[mlagents___envs___communicator_objects___header_pb2___HeaderProto] = None,
unity_output : typing___Optional[mlagents___envs___communicator_objects___unity_output_pb2___UnityOutputProto] = None,
unity_input : typing___Optional[mlagents___envs___communicator_objects___unity_input_pb2___UnityInputProto] = None,
header : typing___Optional[mlagents_envs___communicator_objects___header_pb2___HeaderProto] = None,
unity_output : typing___Optional[mlagents_envs___communicator_objects___unity_output_pb2___UnityOutputProto] = None,
unity_input : typing___Optional[mlagents_envs___communicator_objects___unity_input_pb2___UnityInputProto] = None,
) -> None: ...
@classmethod
def FromString(cls, s: builtin___bytes) -> UnityMessageProto: ...

22
ml-agents-envs/mlagents_envs/communicator_objects/unity_message_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_message.proto
# source: mlagents_envs/communicator_objects/unity_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import unity_output_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__output__pb2
from mlagents.envs.communicator_objects import unity_input_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__input__pb2
from mlagents.envs.communicator_objects import header_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_header__pb2
from mlagents_envs.communicator_objects import unity_output_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__output__pb2
from mlagents_envs.communicator_objects import unity_input_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__input__pb2
from mlagents_envs.communicator_objects import header_pb2 as mlagents__envs_dot_communicator__objects_dot_header__pb2
name='mlagents/envs/communicator_objects/unity_message.proto',
name='mlagents_envs/communicator_objects/unity_message.proto',
serialized_pb=_b('\n6mlagents/envs/communicator_objects/unity_message.proto\x12\x14\x63ommunicator_objects\x1a\x35mlagents/envs/communicator_objects/unity_output.proto\x1a\x34mlagents/envs/communicator_objects/unity_input.proto\x1a/mlagents/envs/communicator_objects/header.proto\"\xc0\x01\n\x11UnityMessageProto\x12\x31\n\x06header\x18\x01 \x01(\x0b\x32!.communicator_objects.HeaderProto\x12<\n\x0cunity_output\x18\x02 \x01(\x0b\x32&.communicator_objects.UnityOutputProto\x12:\n\x0bunity_input\x18\x03 \x01(\x0b\x32%.communicator_objects.UnityInputProtoB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n6mlagents_envs/communicator_objects/unity_message.proto\x12\x14\x63ommunicator_objects\x1a\x35mlagents_envs/communicator_objects/unity_output.proto\x1a\x34mlagents_envs/communicator_objects/unity_input.proto\x1a/mlagents_envs/communicator_objects/header.proto\"\xc0\x01\n\x11UnityMessageProto\x12\x31\n\x06header\x18\x01 \x01(\x0b\x32!.communicator_objects.HeaderProto\x12<\n\x0cunity_output\x18\x02 \x01(\x0b\x32&.communicator_objects.UnityOutputProto\x12:\n\x0bunity_input\x18\x03 \x01(\x0b\x32%.communicator_objects.UnityInputProtoB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_unity__output__pb2.DESCRIPTOR,mlagents_dot_envs_dot_communicator__objects_dot_unity__input__pb2.DESCRIPTOR,mlagents_dot_envs_dot_communicator__objects_dot_header__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_unity__output__pb2.DESCRIPTOR,mlagents__envs_dot_communicator__objects_dot_unity__input__pb2.DESCRIPTOR,mlagents__envs_dot_communicator__objects_dot_header__pb2.DESCRIPTOR,])

serialized_end=431,
)
_UNITYMESSAGEPROTO.fields_by_name['header'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_header__pb2._HEADERPROTO
_UNITYMESSAGEPROTO.fields_by_name['unity_output'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_unity__output__pb2._UNITYOUTPUTPROTO
_UNITYMESSAGEPROTO.fields_by_name['unity_input'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_unity__input__pb2._UNITYINPUTPROTO
_UNITYMESSAGEPROTO.fields_by_name['header'].message_type = mlagents__envs_dot_communicator__objects_dot_header__pb2._HEADERPROTO
_UNITYMESSAGEPROTO.fields_by_name['unity_output'].message_type = mlagents__envs_dot_communicator__objects_dot_unity__output__pb2._UNITYOUTPUTPROTO
_UNITYMESSAGEPROTO.fields_by_name['unity_input'].message_type = mlagents__envs_dot_communicator__objects_dot_unity__input__pb2._UNITYINPUTPROTO
__module__ = 'mlagents.envs.communicator_objects.unity_message_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_message_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityMessageProto)
))
_sym_db.RegisterMessage(UnityMessageProto)

16
ml-agents-envs/mlagents_envs/communicator_objects/unity_input_pb2.pyi


Message as google___protobuf___message___Message,
)
from mlagents.envs.communicator_objects.unity_rl_initialization_input_pb2 import (
UnityRLInitializationInputProto as mlagents___envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInputProto,
from mlagents_envs.communicator_objects.unity_rl_initialization_input_pb2 import (
UnityRLInitializationInputProto as mlagents_envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInputProto,
from mlagents.envs.communicator_objects.unity_rl_input_pb2 import (
UnityRLInputProto as mlagents___envs___communicator_objects___unity_rl_input_pb2___UnityRLInputProto,
from mlagents_envs.communicator_objects.unity_rl_input_pb2 import (
UnityRLInputProto as mlagents_envs___communicator_objects___unity_rl_input_pb2___UnityRLInputProto,
)
from typing import (

DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@property
def rl_input(self) -> mlagents___envs___communicator_objects___unity_rl_input_pb2___UnityRLInputProto: ...
def rl_input(self) -> mlagents_envs___communicator_objects___unity_rl_input_pb2___UnityRLInputProto: ...
def rl_initialization_input(self) -> mlagents___envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInputProto: ...
def rl_initialization_input(self) -> mlagents_envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInputProto: ...
rl_input : typing___Optional[mlagents___envs___communicator_objects___unity_rl_input_pb2___UnityRLInputProto] = None,
rl_initialization_input : typing___Optional[mlagents___envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInputProto] = None,
rl_input : typing___Optional[mlagents_envs___communicator_objects___unity_rl_input_pb2___UnityRLInputProto] = None,
rl_initialization_input : typing___Optional[mlagents_envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInputProto] = None,
) -> None: ...
@classmethod
def FromString(cls, s: builtin___bytes) -> UnityInputProto: ...

18
ml-agents-envs/mlagents_envs/communicator_objects/unity_input_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/unity_input.proto
# source: mlagents_envs/communicator_objects/unity_input.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

_sym_db = _symbol_database.Default()
from mlagents.envs.communicator_objects import unity_rl_input_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__input__pb2
from mlagents.envs.communicator_objects import unity_rl_initialization_input_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__initialization__input__pb2
from mlagents_envs.communicator_objects import unity_rl_input_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__rl__input__pb2
from mlagents_envs.communicator_objects import unity_rl_initialization_input_pb2 as mlagents__envs_dot_communicator__objects_dot_unity__rl__initialization__input__pb2
name='mlagents/envs/communicator_objects/unity_input.proto',
name='mlagents_envs/communicator_objects/unity_input.proto',
serialized_pb=_b('\n4mlagents/envs/communicator_objects/unity_input.proto\x12\x14\x63ommunicator_objects\x1a\x37mlagents/envs/communicator_objects/unity_rl_input.proto\x1a\x46mlagents/envs/communicator_objects/unity_rl_initialization_input.proto\"\xa4\x01\n\x0fUnityInputProto\x12\x39\n\x08rl_input\x18\x01 \x01(\x0b\x32\'.communicator_objects.UnityRLInputProto\x12V\n\x17rl_initialization_input\x18\x02 \x01(\x0b\x32\x35.communicator_objects.UnityRLInitializationInputProtoB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n4mlagents_envs/communicator_objects/unity_input.proto\x12\x14\x63ommunicator_objects\x1a\x37mlagents_envs/communicator_objects/unity_rl_input.proto\x1a\x46mlagents_envs/communicator_objects/unity_rl_initialization_input.proto\"\xa4\x01\n\x0fUnityInputProto\x12\x39\n\x08rl_input\x18\x01 \x01(\x0b\x32\'.communicator_objects.UnityRLInputProto\x12V\n\x17rl_initialization_input\x18\x02 \x01(\x0b\x32\x35.communicator_objects.UnityRLInitializationInputProtoB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__input__pb2.DESCRIPTOR,mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__initialization__input__pb2.DESCRIPTOR,])
dependencies=[mlagents__envs_dot_communicator__objects_dot_unity__rl__input__pb2.DESCRIPTOR,mlagents__envs_dot_communicator__objects_dot_unity__rl__initialization__input__pb2.DESCRIPTOR,])

serialized_end=372,
)
_UNITYINPUTPROTO.fields_by_name['rl_input'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__input__pb2._UNITYRLINPUTPROTO
_UNITYINPUTPROTO.fields_by_name['rl_initialization_input'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_unity__rl__initialization__input__pb2._UNITYRLINITIALIZATIONINPUTPROTO
_UNITYINPUTPROTO.fields_by_name['rl_input'].message_type = mlagents__envs_dot_communicator__objects_dot_unity__rl__input__pb2._UNITYRLINPUTPROTO
_UNITYINPUTPROTO.fields_by_name['rl_initialization_input'].message_type = mlagents__envs_dot_communicator__objects_dot_unity__rl__initialization__input__pb2._UNITYRLINITIALIZATIONINPUTPROTO
__module__ = 'mlagents.envs.communicator_objects.unity_input_pb2'
__module__ = 'mlagents_envs.communicator_objects.unity_input_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.UnityInputProto)
))
_sym_db.RegisterMessage(UnityInputProto)

6
ml-agents-envs/mlagents_envs/communicator_objects/space_type_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/space_type.proto
# source: mlagents_envs/communicator_objects/space_type.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

DESCRIPTOR = _descriptor.FileDescriptor(
name='mlagents/envs/communicator_objects/space_type.proto',
name='mlagents_envs/communicator_objects/space_type.proto',
serialized_pb=_b('\n3mlagents/envs/communicator_objects/space_type.proto\x12\x14\x63ommunicator_objects*.\n\x0eSpaceTypeProto\x12\x0c\n\x08\x64iscrete\x10\x00\x12\x0e\n\ncontinuous\x10\x01\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n3mlagents_envs/communicator_objects/space_type.proto\x12\x14\x63ommunicator_objects*.\n\x0eSpaceTypeProto\x12\x0c\n\x08\x64iscrete\x10\x00\x12\x0e\n\ncontinuous\x10\x01\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)
_SPACETYPEPROTO = _descriptor.EnumDescriptor(

10
ml-agents-envs/mlagents_envs/communicator_objects/observation_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/observation.proto
# source: mlagents_envs/communicator_objects/observation.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

DESCRIPTOR = _descriptor.FileDescriptor(
name='mlagents/envs/communicator_objects/observation.proto',
name='mlagents_envs/communicator_objects/observation.proto',
serialized_pb=_b('\n4mlagents/envs/communicator_objects/observation.proto\x12\x14\x63ommunicator_objects\"\xf9\x01\n\x10ObservationProto\x12\r\n\x05shape\x18\x01 \x03(\x05\x12\x44\n\x10\x63ompression_type\x18\x02 \x01(\x0e\x32*.communicator_objects.CompressionTypeProto\x12\x19\n\x0f\x63ompressed_data\x18\x03 \x01(\x0cH\x00\x12\x46\n\nfloat_data\x18\x04 \x01(\x0b\x32\x30.communicator_objects.ObservationProto.FloatDataH\x00\x1a\x19\n\tFloatData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x02\x42\x12\n\x10observation_data*)\n\x14\x43ompressionTypeProto\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03PNG\x10\x01\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n4mlagents_envs/communicator_objects/observation.proto\x12\x14\x63ommunicator_objects\"\xf9\x01\n\x10ObservationProto\x12\r\n\x05shape\x18\x01 \x03(\x05\x12\x44\n\x10\x63ompression_type\x18\x02 \x01(\x0e\x32*.communicator_objects.CompressionTypeProto\x12\x19\n\x0f\x63ompressed_data\x18\x03 \x01(\x0cH\x00\x12\x46\n\nfloat_data\x18\x04 \x01(\x0b\x32\x30.communicator_objects.ObservationProto.FloatDataH\x00\x1a\x19\n\tFloatData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x02\x42\x12\n\x10observation_data*)\n\x14\x43ompressionTypeProto\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03PNG\x10\x01\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)
_COMPRESSIONTYPEPROTO = _descriptor.EnumDescriptor(

FloatData = _reflection.GeneratedProtocolMessageType('FloatData', (_message.Message,), dict(
DESCRIPTOR = _OBSERVATIONPROTO_FLOATDATA,
__module__ = 'mlagents.envs.communicator_objects.observation_pb2'
__module__ = 'mlagents_envs.communicator_objects.observation_pb2'
__module__ = 'mlagents.envs.communicator_objects.observation_pb2'
__module__ = 'mlagents_envs.communicator_objects.observation_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.ObservationProto)
))
_sym_db.RegisterMessage(ObservationProto)

8
ml-agents-envs/mlagents_envs/communicator_objects/header_pb2.py


# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents/envs/communicator_objects/header.proto
# source: mlagents_envs/communicator_objects/header.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))

DESCRIPTOR = _descriptor.FileDescriptor(
name='mlagents/envs/communicator_objects/header.proto',
name='mlagents_envs/communicator_objects/header.proto',
serialized_pb=_b('\n/mlagents/envs/communicator_objects/header.proto\x12\x14\x63ommunicator_objects\".\n\x0bHeaderProto\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\tB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
serialized_pb=_b('\n/mlagents_envs/communicator_objects/header.proto\x12\x14\x63ommunicator_objects\".\n\x0bHeaderProto\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\tB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)

HeaderProto = _reflection.GeneratedProtocolMessageType('HeaderProto', (_message.Message,), dict(
DESCRIPTOR = _HEADERPROTO,
__module__ = 'mlagents.envs.communicator_objects.header_pb2'
__module__ = 'mlagents_envs.communicator_objects.header_pb2'
# @@protoc_insertion_point(class_scope:communicator_objects.HeaderProto)
))
_sym_db.RegisterMessage(HeaderProto)

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存