浏览代码

API for sending custom protobuf messages to and from Unity. (#1595)

* API for sending custom protobuf messages to and from Unity.

* Rename custom_output to custom_outputs.

* Move custom protos to their own files.

* Add SetCustomOutput method.

* Add docstrings.

* Various adjustments.

* Rename CustomParameters -> CustomResetParameters
* Rename CustomOutput -> CUstomObservation
* Add CustomAction
* Add CustomActionResult

* Remove custom action result.

* Remove custom action result from Python API

* Start new documentation.

* Add some docstrings

* Expand documentation.

* Typos

* Tweak doc.

Also eliminate GetCustomObservation.

* Fix typo.

* Clarify docs.

* Remove trailing whitspace
/develop-generalizationTraining-TrainerController
Vincent-Pierre BERGES 6 年前
当前提交
bc636075
共有 45 个文件被更改,包括 1230 次插入205 次删除
  1. 4
      UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
  2. 54
      UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
  3. 1
      UnitySDK/Assets/ML-Agents/Scripts/Batcher.cs
  4. 49
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/AgentActionProto.cs
  5. 57
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/AgentInfoProto.cs
  6. 53
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/EnvironmentParametersProto.cs
  7. 4
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityInput.cs
  8. 6
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityMessage.cs
  9. 4
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityOutput.cs
  10. 2
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityRlInitializationOutput.cs
  11. 2
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityRlInput.cs
  12. 6
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityToExternalGrpc.cs
  13. 1
      docs/Readme.md
  14. 5
      ml-agents/mlagents/envs/brain.py
  15. 3
      ml-agents/mlagents/envs/communicator_objects/__init__.py
  16. 33
      ml-agents/mlagents/envs/communicator_objects/agent_action_proto_pb2.py
  17. 47
      ml-agents/mlagents/envs/communicator_objects/agent_info_proto_pb2.py
  18. 23
      ml-agents/mlagents/envs/communicator_objects/brain_parameters_proto_pb2.py
  19. 13
      ml-agents/mlagents/envs/communicator_objects/command_proto_pb2.py
  20. 19
      ml-agents/mlagents/envs/communicator_objects/engine_configuration_proto_pb2.py
  21. 40
      ml-agents/mlagents/envs/communicator_objects/environment_parameters_proto_pb2.py
  22. 11
      ml-agents/mlagents/envs/communicator_objects/header_pb2.py
  23. 13
      ml-agents/mlagents/envs/communicator_objects/resolution_proto_pb2.py
  24. 11
      ml-agents/mlagents/envs/communicator_objects/space_type_proto_pb2.py
  25. 11
      ml-agents/mlagents/envs/communicator_objects/unity_input_pb2.py
  26. 13
      ml-agents/mlagents/envs/communicator_objects/unity_message_pb2.py
  27. 11
      ml-agents/mlagents/envs/communicator_objects/unity_output_pb2.py
  28. 9
      ml-agents/mlagents/envs/communicator_objects/unity_rl_initialization_input_pb2.py
  29. 17
      ml-agents/mlagents/envs/communicator_objects/unity_rl_initialization_output_pb2.py
  30. 28
      ml-agents/mlagents/envs/communicator_objects/unity_rl_input_pb2.py
  31. 24
      ml-agents/mlagents/envs/communicator_objects/unity_rl_output_pb2.py
  32. 38
      ml-agents/mlagents/envs/environment.py
  33. 3
      protobuf-definitions/proto/mlagents/envs/communicator_objects/agent_action_proto.proto
  34. 3
      protobuf-definitions/proto/mlagents/envs/communicator_objects/agent_info_proto.proto
  35. 3
      protobuf-definitions/proto/mlagents/envs/communicator_objects/environment_parameters_proto.proto
  36. 145
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/CustomAction.cs
  37. 146
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/CustomObservation.cs
  38. 146
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/CustomResetParameters.cs
  39. 167
      docs/Custom-Protos.md
  40. 63
      ml-agents/mlagents/envs/communicator_objects/custom_action_pb2.py
  41. 63
      ml-agents/mlagents/envs/communicator_objects/custom_observation_pb2.py
  42. 63
      ml-agents/mlagents/envs/communicator_objects/custom_reset_parameters_pb2.py
  43. 7
      protobuf-definitions/proto/mlagents/envs/communicator_objects/custom_action.proto
  44. 7
      protobuf-definitions/proto/mlagents/envs/communicator_objects/custom_observation.proto
  45. 7
      protobuf-definitions/proto/mlagents/envs/communicator_objects/custom_reset_parameters.proto

4
UnitySDK/Assets/ML-Agents/Scripts/Academy.cs


[Tooltip("List of custom parameters that can be changed in the " +
"environment when it resets.")]
public ResetParameters resetParameters;
public CommunicatorObjects.CustomResetParameters customResetParameters;
// Fields not provided in the Inspector.

{
resetParameters[kv.Key] = kv.Value;
}
customResetParameters = newResetParameters.CustomResetParameters;
}
}

DestroyAction();
}
}
}
}

54
UnitySDK/Assets/ML-Agents/Scripts/Agent.cs


public int id;
/// <summary>
/// User-customizable object for sending structured output from Unity to Python in response
/// to an action in addition to a scalar reward.
/// </summary>
public CustomObservation customObservation;
/// <summary>
/// Converts a AgentInfo to a protobuffer generated AgentInfoProto
/// </summary>
/// <returns>The protobuf verison of the AgentInfo.</returns>

MaxStepReached = maxStepReached,
Done = done,
Id = id,
CustomObservation = customObservation
};
if (memories != null)
{

public string textActions;
public List<float> memories;
public float value;
public CommunicatorObjects.CustomAction customAction;
}
/// <summary>

* param.numStackedVectorObservations]);
info.visualObservations = new List<Texture2D>();
info.customObservation = null;
}
/// <summary>

/// <param name="actionIndex">The index of the masked action on branch 0</param>
protected void SetActionMask(int actionIndex)
{
actionMasker.SetActionMask(0, new int[1] {actionIndex});
actionMasker.SetActionMask(0, new int[1] { actionIndex });
}
/// <summary>

/// <param name="actionIndex">The index of the masked action</param>
protected void SetActionMask(int branch, int actionIndex)
{
actionMasker.SetActionMask(branch, new int[1] {actionIndex});
actionMasker.SetActionMask(branch, new int[1] { actionIndex });
}
/// <summary>

}
/// <summary>
/// Specifies the agent behavior at every step based on the provided
/// action.
/// </summary>
/// <param name="vectorAction">
/// Vector action. Note that for discrete actions, the provided array
/// will be of length 1.
/// </param>
/// <param name="textAction">Text action.</param>
/// <param name="customAction">
/// A custom action, defined by the user as custom protobuffer message. Useful if the action is hard to encode
/// as either a flat vector or a single string.
/// </param>
public virtual void AgentAction(float[] vectorAction, string textAction, CommunicatorObjects.CustomAction customAction)
{
// We fall back to not using the custom action if the subclassed Agent doesn't override this method.
AgentAction(vectorAction, textAction);
}
/// <summary>
/// Specifies the agent behavior when done and
/// <see cref="AgentParameters.resetOnDone"/> is false. This method can be
/// used to remove the agent from the scene.

public void UpdateTextAction(string textActions)
{
action.textActions = textActions;
}
/// <summary>
/// Updates the custom action.
/// </summary>
/// <param name="customAction">Custom action.</param>
public void UpdateCustomAction(CommunicatorObjects.CustomAction customAction)
{
action.customAction = customAction;
}
/// <summary>

if ((requestAction) && (brain != null))
{
requestAction = false;
AgentAction(action.vectorActions, action.textActions);
AgentAction(action.vectorActions, action.textActions, action.customAction);
}
if ((stepCount >= agentParameters.maxStep)

RenderTexture.active = prevActiveRT;
RenderTexture.ReleaseTemporary(tempRT);
}
}
/// <summary>
/// Sets the custom observation for the agent for this episode.
/// </summary>
/// <param name="customObservation">New value of the agent's custom observation.</param>
public void SetCustomObservation(CustomObservation customObservation)
{
info.customObservation = customObservation;
}
}
}

1
UnitySDK/Assets/ML-Agents/Scripts/Batcher.cs


agent.UpdateMemoriesAction(action.Memories.ToList());
agent.UpdateTextAction(action.TextActions);
agent.UpdateValueAction(action.Value);
agent.UpdateCustomAction(action.CustomAction);
}
}
}

49
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/AgentActionProto.cs


byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjttbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2Fj",
"dGlvbl9wcm90by5wcm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMiYQoQQWdl",
"bnRBY3Rpb25Qcm90bxIWCg52ZWN0b3JfYWN0aW9ucxgBIAMoAhIUCgx0ZXh0",
"X2FjdGlvbnMYAiABKAkSEAoIbWVtb3JpZXMYAyADKAISDQoFdmFsdWUYBCAB",
"KAJCH6oCHE1MQWdlbnRzLkNvbW11bmljYXRvck9iamVjdHNiBnByb3RvMw=="));
"dGlvbl9wcm90by5wcm90bxIUY29tbXVuaWNhdG9yX29iamVjdHMaNm1sYWdl",
"bnRzL2VudnMvY29tbXVuaWNhdG9yX29iamVjdHMvY3VzdG9tX2FjdGlvbi5w",
"cm90byKcAQoQQWdlbnRBY3Rpb25Qcm90bxIWCg52ZWN0b3JfYWN0aW9ucxgB",
"IAMoAhIUCgx0ZXh0X2FjdGlvbnMYAiABKAkSEAoIbWVtb3JpZXMYAyADKAIS",
"DQoFdmFsdWUYBCABKAISOQoNY3VzdG9tX2FjdGlvbhgFIAEoCzIiLmNvbW11",
"bmljYXRvcl9vYmplY3RzLkN1c3RvbUFjdGlvbkIfqgIcTUxBZ2VudHMuQ29t",
"bXVuaWNhdG9yT2JqZWN0c2IGcHJvdG8z"));
new pbr::FileDescriptor[] { },
new pbr::FileDescriptor[] { global::MLAgents.CommunicatorObjects.CustomActionReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(typeof(global::MLAgents.CommunicatorObjects.AgentActionProto), global::MLAgents.CommunicatorObjects.AgentActionProto.Parser, new[]{ "VectorActions", "TextActions", "Memories", "Value" }, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::MLAgents.CommunicatorObjects.AgentActionProto), global::MLAgents.CommunicatorObjects.AgentActionProto.Parser, new[]{ "VectorActions", "TextActions", "Memories", "Value", "CustomAction" }, null, null, null)
}));
}
#endregion

textActions_ = other.textActions_;
memories_ = other.memories_.Clone();
value_ = other.value_;
customAction_ = other.customAction_ != null ? other.customAction_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

}
}
/// <summary>Field number for the "custom_action" field.</summary>
public const int CustomActionFieldNumber = 5;
private global::MLAgents.CommunicatorObjects.CustomAction customAction_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::MLAgents.CommunicatorObjects.CustomAction CustomAction {
get { return customAction_; }
set {
customAction_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AgentActionProto);

if (TextActions != other.TextActions) return false;
if(!memories_.Equals(other.memories_)) return false;
if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Value, other.Value)) return false;
if (!object.Equals(CustomAction, other.CustomAction)) return false;
return Equals(_unknownFields, other._unknownFields);
}

if (TextActions.Length != 0) hash ^= TextActions.GetHashCode();
hash ^= memories_.GetHashCode();
if (Value != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Value);
if (customAction_ != null) hash ^= CustomAction.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}

output.WriteRawTag(37);
output.WriteFloat(Value);
}
if (customAction_ != null) {
output.WriteRawTag(42);
output.WriteMessage(CustomAction);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}

if (Value != 0F) {
size += 1 + 4;
}
if (customAction_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(CustomAction);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}

if (other.Value != 0F) {
Value = other.Value;
}
if (other.customAction_ != null) {
if (customAction_ == null) {
customAction_ = new global::MLAgents.CommunicatorObjects.CustomAction();
}
CustomAction.MergeFrom(other.CustomAction);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

}
case 37: {
Value = input.ReadFloat();
break;
}
case 42: {
if (customAction_ == null) {
customAction_ = new global::MLAgents.CommunicatorObjects.CustomAction();
}
input.ReadMessage(customAction_);
break;
}
}

57
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/AgentInfoProto.cs


byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CjltbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2FnZW50X2lu",
"Zm9fcHJvdG8ucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzIpICCg5BZ2Vu",
"dEluZm9Qcm90bxIiChpzdGFja2VkX3ZlY3Rvcl9vYnNlcnZhdGlvbhgBIAMo",
"AhIbChN2aXN1YWxfb2JzZXJ2YXRpb25zGAIgAygMEhgKEHRleHRfb2JzZXJ2",
"YXRpb24YAyABKAkSHQoVc3RvcmVkX3ZlY3Rvcl9hY3Rpb25zGAQgAygCEhsK",
"E3N0b3JlZF90ZXh0X2FjdGlvbnMYBSABKAkSEAoIbWVtb3JpZXMYBiADKAIS",
"DgoGcmV3YXJkGAcgASgCEgwKBGRvbmUYCCABKAgSGAoQbWF4X3N0ZXBfcmVh",
"Y2hlZBgJIAEoCBIKCgJpZBgKIAEoBRITCgthY3Rpb25fbWFzaxgLIAMoCEIf",
"qgIcTUxBZ2VudHMuQ29tbXVuaWNhdG9yT2JqZWN0c2IGcHJvdG8z"));
"Zm9fcHJvdG8ucHJvdG8SFGNvbW11bmljYXRvcl9vYmplY3RzGjttbGFnZW50",
"cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2N1c3RvbV9vYnNlcnZhdGlv",
"bi5wcm90byLXAgoOQWdlbnRJbmZvUHJvdG8SIgoac3RhY2tlZF92ZWN0b3Jf",
"b2JzZXJ2YXRpb24YASADKAISGwoTdmlzdWFsX29ic2VydmF0aW9ucxgCIAMo",
"DBIYChB0ZXh0X29ic2VydmF0aW9uGAMgASgJEh0KFXN0b3JlZF92ZWN0b3Jf",
"YWN0aW9ucxgEIAMoAhIbChNzdG9yZWRfdGV4dF9hY3Rpb25zGAUgASgJEhAK",
"CG1lbW9yaWVzGAYgAygCEg4KBnJld2FyZBgHIAEoAhIMCgRkb25lGAggASgI",
"EhgKEG1heF9zdGVwX3JlYWNoZWQYCSABKAgSCgoCaWQYCiABKAUSEwoLYWN0",
"aW9uX21hc2sYCyADKAgSQwoSY3VzdG9tX29ic2VydmF0aW9uGAwgASgLMicu",
"Y29tbXVuaWNhdG9yX29iamVjdHMuQ3VzdG9tT2JzZXJ2YXRpb25CH6oCHE1M",
"QWdlbnRzLkNvbW11bmljYXRvck9iamVjdHNiBnByb3RvMw=="));
new pbr::FileDescriptor[] { },
new pbr::FileDescriptor[] { global::MLAgents.CommunicatorObjects.CustomObservationReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(typeof(global::MLAgents.CommunicatorObjects.AgentInfoProto), global::MLAgents.CommunicatorObjects.AgentInfoProto.Parser, new[]{ "StackedVectorObservation", "VisualObservations", "TextObservation", "StoredVectorActions", "StoredTextActions", "Memories", "Reward", "Done", "MaxStepReached", "Id", "ActionMask" }, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::MLAgents.CommunicatorObjects.AgentInfoProto), global::MLAgents.CommunicatorObjects.AgentInfoProto.Parser, new[]{ "StackedVectorObservation", "VisualObservations", "TextObservation", "StoredVectorActions", "StoredTextActions", "Memories", "Reward", "Done", "MaxStepReached", "Id", "ActionMask", "CustomObservation" }, null, null, null)
}));
}
#endregion

maxStepReached_ = other.maxStepReached_;
id_ = other.id_;
actionMask_ = other.actionMask_.Clone();
customObservation_ = other.customObservation_ != null ? other.customObservation_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

get { return actionMask_; }
}
/// <summary>Field number for the "custom_observation" field.</summary>
public const int CustomObservationFieldNumber = 12;
private global::MLAgents.CommunicatorObjects.CustomObservation customObservation_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::MLAgents.CommunicatorObjects.CustomObservation CustomObservation {
get { return customObservation_; }
set {
customObservation_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AgentInfoProto);

if (MaxStepReached != other.MaxStepReached) return false;
if (Id != other.Id) return false;
if(!actionMask_.Equals(other.actionMask_)) return false;
if (!object.Equals(CustomObservation, other.CustomObservation)) return false;
return Equals(_unknownFields, other._unknownFields);
}

if (MaxStepReached != false) hash ^= MaxStepReached.GetHashCode();
if (Id != 0) hash ^= Id.GetHashCode();
hash ^= actionMask_.GetHashCode();
if (customObservation_ != null) hash ^= CustomObservation.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}

output.WriteInt32(Id);
}
actionMask_.WriteTo(output, _repeated_actionMask_codec);
if (customObservation_ != null) {
output.WriteRawTag(98);
output.WriteMessage(CustomObservation);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}

size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id);
}
size += actionMask_.CalculateSize(_repeated_actionMask_codec);
if (customObservation_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(CustomObservation);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}

Id = other.Id;
}
actionMask_.Add(other.actionMask_);
if (other.customObservation_ != null) {
if (customObservation_ == null) {
customObservation_ = new global::MLAgents.CommunicatorObjects.CustomObservation();
}
CustomObservation.MergeFrom(other.CustomObservation);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

case 90:
case 88: {
actionMask_.AddEntriesFrom(input, _repeated_actionMask_codec);
break;
}
case 98: {
if (customObservation_ == null) {
customObservation_ = new global::MLAgents.CommunicatorObjects.CustomObservation();
}
input.ReadMessage(customObservation_);
break;
}
}

53
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/EnvironmentParametersProto.cs


string.Concat(
"CkVtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2Vudmlyb25t",
"ZW50X3BhcmFtZXRlcnNfcHJvdG8ucHJvdG8SFGNvbW11bmljYXRvcl9vYmpl",
"Y3RzIrUBChpFbnZpcm9ubWVudFBhcmFtZXRlcnNQcm90bxJfChBmbG9hdF9w",
"YXJhbWV0ZXJzGAEgAygLMkUuY29tbXVuaWNhdG9yX29iamVjdHMuRW52aXJv",
"bm1lbnRQYXJhbWV0ZXJzUHJvdG8uRmxvYXRQYXJhbWV0ZXJzRW50cnkaNgoU",
"RmxvYXRQYXJhbWV0ZXJzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIg",
"ASgCOgI4AUIfqgIcTUxBZ2VudHMuQ29tbXVuaWNhdG9yT2JqZWN0c2IGcHJv",
"dG8z"));
"Y3RzGkBtbGFnZW50cy9lbnZzL2NvbW11bmljYXRvcl9vYmplY3RzL2N1c3Rv",
"bV9yZXNldF9wYXJhbWV0ZXJzLnByb3RvIoMCChpFbnZpcm9ubWVudFBhcmFt",
"ZXRlcnNQcm90bxJfChBmbG9hdF9wYXJhbWV0ZXJzGAEgAygLMkUuY29tbXVu",
"aWNhdG9yX29iamVjdHMuRW52aXJvbm1lbnRQYXJhbWV0ZXJzUHJvdG8uRmxv",
"YXRQYXJhbWV0ZXJzRW50cnkSTAoXY3VzdG9tX3Jlc2V0X3BhcmFtZXRlcnMY",
"AiABKAsyKy5jb21tdW5pY2F0b3Jfb2JqZWN0cy5DdXN0b21SZXNldFBhcmFt",
"ZXRlcnMaNgoURmxvYXRQYXJhbWV0ZXJzRW50cnkSCwoDa2V5GAEgASgJEg0K",
"BXZhbHVlGAIgASgCOgI4AUIfqgIcTUxBZ2VudHMuQ29tbXVuaWNhdG9yT2Jq",
"ZWN0c2IGcHJvdG8z"));
new pbr::FileDescriptor[] { },
new pbr::FileDescriptor[] { global::MLAgents.CommunicatorObjects.CustomResetParametersReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(typeof(global::MLAgents.CommunicatorObjects.EnvironmentParametersProto), global::MLAgents.CommunicatorObjects.EnvironmentParametersProto.Parser, new[]{ "FloatParameters" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
new pbr::GeneratedClrTypeInfo(typeof(global::MLAgents.CommunicatorObjects.EnvironmentParametersProto), global::MLAgents.CommunicatorObjects.EnvironmentParametersProto.Parser, new[]{ "FloatParameters", "CustomResetParameters" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, })
}));
}
#endregion

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public EnvironmentParametersProto(EnvironmentParametersProto other) : this() {
floatParameters_ = other.floatParameters_.Clone();
customResetParameters_ = other.customResetParameters_ != null ? other.customResetParameters_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

get { return floatParameters_; }
}
/// <summary>Field number for the "custom_reset_parameters" field.</summary>
public const int CustomResetParametersFieldNumber = 2;
private global::MLAgents.CommunicatorObjects.CustomResetParameters customResetParameters_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::MLAgents.CommunicatorObjects.CustomResetParameters CustomResetParameters {
get { return customResetParameters_; }
set {
customResetParameters_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as EnvironmentParametersProto);

return true;
}
if (!FloatParameters.Equals(other.FloatParameters)) return false;
if (!object.Equals(CustomResetParameters, other.CustomResetParameters)) return false;
return Equals(_unknownFields, other._unknownFields);
}

hash ^= FloatParameters.GetHashCode();
if (customResetParameters_ != null) hash ^= CustomResetParameters.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
floatParameters_.WriteTo(output, _map_floatParameters_codec);
if (customResetParameters_ != null) {
output.WriteRawTag(18);
output.WriteMessage(CustomResetParameters);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}

public int CalculateSize() {
int size = 0;
size += floatParameters_.CalculateSize(_map_floatParameters_codec);
if (customResetParameters_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(CustomResetParameters);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}

return;
}
floatParameters_.Add(other.floatParameters_);
if (other.customResetParameters_ != null) {
if (customResetParameters_ == null) {
customResetParameters_ = new global::MLAgents.CommunicatorObjects.CustomResetParameters();
}
CustomResetParameters.MergeFrom(other.CustomResetParameters);
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}

break;
case 10: {
floatParameters_.AddEntriesFrom(input, _map_floatParameters_codec);
break;
}
case 18: {
if (customResetParameters_ == null) {
customResetParameters_ = new global::MLAgents.CommunicatorObjects.CustomResetParameters();
}
input.ReadMessage(customResetParameters_);
break;
}
}

4
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityInput.cs


[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnityInput(UnityInput other) : this() {
RlInput = other.rlInput_ != null ? other.RlInput.Clone() : null;
RlInitializationInput = other.rlInitializationInput_ != null ? other.RlInitializationInput.Clone() : null;
rlInput_ = other.rlInput_ != null ? other.rlInput_.Clone() : null;
rlInitializationInput_ = other.rlInitializationInput_ != null ? other.rlInitializationInput_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

6
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityMessage.cs


[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnityMessage(UnityMessage other) : this() {
Header = other.header_ != null ? other.Header.Clone() : null;
UnityOutput = other.unityOutput_ != null ? other.UnityOutput.Clone() : null;
UnityInput = other.unityInput_ != null ? other.UnityInput.Clone() : null;
header_ = other.header_ != null ? other.header_.Clone() : null;
unityOutput_ = other.unityOutput_ != null ? other.unityOutput_.Clone() : null;
unityInput_ = other.unityInput_ != null ? other.unityInput_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

4
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityOutput.cs


[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnityOutput(UnityOutput other) : this() {
RlOutput = other.rlOutput_ != null ? other.RlOutput.Clone() : null;
RlInitializationOutput = other.rlInitializationOutput_ != null ? other.RlInitializationOutput.Clone() : null;
rlOutput_ = other.rlOutput_ != null ? other.rlOutput_.Clone() : null;
rlInitializationOutput_ = other.rlInitializationOutput_ != null ? other.rlInitializationOutput_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

2
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityRlInitializationOutput.cs


version_ = other.version_;
logPath_ = other.logPath_;
brainParameters_ = other.brainParameters_.Clone();
EnvironmentParameters = other.environmentParameters_ != null ? other.EnvironmentParameters.Clone() : null;
environmentParameters_ = other.environmentParameters_ != null ? other.environmentParameters_.Clone() : null;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}

2
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityRlInput.cs


[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnityRLInput(UnityRLInput other) : this() {
agentActions_ = other.agentActions_.Clone();
EnvironmentParameters = other.environmentParameters_ != null ? other.EnvironmentParameters.Clone() : null;
environmentParameters_ = other.environmentParameters_ != null ? other.environmentParameters_.Clone() : null;
isTraining_ = other.isTraining_;
command_ = other.command_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);

6
UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityToExternalGrpc.cs


{
static readonly string __ServiceName = "communicator_objects.UnityToExternal";
static readonly grpc::Marshaller<global::MLAgents.CommunicatorObjects.UnityMessage> __Marshaller_UnityMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MLAgents.CommunicatorObjects.UnityMessage.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MLAgents.CommunicatorObjects.UnityMessage> __Marshaller_communicator_objects_UnityMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MLAgents.CommunicatorObjects.UnityMessage.Parser.ParseFrom);
__Marshaller_UnityMessage,
__Marshaller_UnityMessage);
__Marshaller_communicator_objects_UnityMessage,
__Marshaller_communicator_objects_UnityMessage);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor

1
docs/Readme.md


* [API Reference](API-Reference.md)
* [How to use the Python API](Python-API.md)
* [Wrapping Learning Environment as a Gym (+Baselines/Dopamine Integration)](../gym-unity/README.md)
* [Creating custom protobuf messages](Custom-Protos.md)

5
ml-agents/mlagents/envs/brain.py


class BrainInfo:
def __init__(self, visual_observation, vector_observation, text_observations, memory=None,
reward=None, agents=None, local_done=None,
vector_action=None, text_action=None, max_reached=None, action_mask=None):
vector_action=None, text_action=None, max_reached=None, action_mask=None,
custom_observations=None):
"""
Describes experience at current step of all agents linked to a brain.
"""

self.previous_vector_actions = vector_action
self.previous_text_actions = text_action
self.action_masks = action_mask
self.custom_observations = custom_observations
@staticmethod
def process_pixels(image_bytes, gray_scale):

vector_action=np.array([x.stored_vector_actions for x in agent_info_list]),
text_action=[x.stored_text_actions for x in agent_info_list],
max_reached=[x.max_step_reached for x in agent_info_list],
custom_observations=[x.custom_observation for x in agent_info_list],
action_mask=mask_actions
)
return brain_info

3
ml-agents/mlagents/envs/communicator_objects/__init__.py


from .agent_info_proto_pb2 import *
from .brain_parameters_proto_pb2 import *
from .command_proto_pb2 import *
from .custom_action_pb2 import *
from .custom_observation_pb2 import *
from .custom_reset_parameters_pb2 import *
from .demonstration_meta_proto_pb2 import *
from .engine_configuration_proto_pb2 import *
from .environment_parameters_proto_pb2 import *

33
ml-agents/mlagents/envs/communicator_objects/agent_action_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
from mlagents.envs.communicator_objects import custom_action_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_custom__action__pb2
DESCRIPTOR = _descriptor.FileDescriptor(

serialized_pb=_b('\n;mlagents/envs/communicator_objects/agent_action_proto.proto\x12\x14\x63ommunicator_objects\"a\n\x10\x41gentActionProto\x12\x16\n\x0evector_actions\x18\x01 \x03(\x02\x12\x14\n\x0ctext_actions\x18\x02 \x01(\t\x12\x10\n\x08memories\x18\x03 \x03(\x02\x12\r\n\x05value\x18\x04 \x01(\x02\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\n;mlagents/envs/communicator_objects/agent_action_proto.proto\x12\x14\x63ommunicator_objects\x1a\x36mlagents/envs/communicator_objects/custom_action.proto\"\x9c\x01\n\x10\x41gentActionProto\x12\x16\n\x0evector_actions\x18\x01 \x03(\x02\x12\x14\n\x0ctext_actions\x18\x02 \x01(\t\x12\x10\n\x08memories\x18\x03 \x03(\x02\x12\r\n\x05value\x18\x04 \x01(\x02\x12\x39\n\rcustom_action\x18\x05 \x01(\x0b\x32\".communicator_objects.CustomActionB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
,
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_custom__action__pb2.DESCRIPTOR,])

has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='text_actions', full_name='communicator_objects.AgentActionProto.text_actions', index=1,
number=2, type=9, cpp_type=9, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='memories', full_name='communicator_objects.AgentActionProto.memories', index=2,
number=3, type=2, cpp_type=6, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='communicator_objects.AgentActionProto.value', index=3,
number=4, type=2, cpp_type=6, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='custom_action', full_name='communicator_objects.AgentActionProto.custom_action', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
serialized_start=85,
serialized_end=182,
serialized_start=142,
serialized_end=298,
_AGENTACTIONPROTO.fields_by_name['custom_action'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_custom__action__pb2._CUSTOMACTION
DESCRIPTOR.message_types_by_name['AgentActionProto'] = _AGENTACTIONPROTO
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

_sym_db.RegisterMessage(AgentActionProto)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

47
ml-agents/mlagents/envs/communicator_objects/agent_info_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
from mlagents.envs.communicator_objects import custom_observation_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_custom__observation__pb2
DESCRIPTOR = _descriptor.FileDescriptor(

serialized_pb=_b('\n9mlagents/envs/communicator_objects/agent_info_proto.proto\x12\x14\x63ommunicator_objects\"\x92\x02\n\x0e\x41gentInfoProto\x12\"\n\x1astacked_vector_observation\x18\x01 \x03(\x02\x12\x1b\n\x13visual_observations\x18\x02 \x03(\x0c\x12\x18\n\x10text_observation\x18\x03 \x01(\t\x12\x1d\n\x15stored_vector_actions\x18\x04 \x03(\x02\x12\x1b\n\x13stored_text_actions\x18\x05 \x01(\t\x12\x10\n\x08memories\x18\x06 \x03(\x02\x12\x0e\n\x06reward\x18\x07 \x01(\x02\x12\x0c\n\x04\x64one\x18\x08 \x01(\x08\x12\x18\n\x10max_step_reached\x18\t \x01(\x08\x12\n\n\x02id\x18\n \x01(\x05\x12\x13\n\x0b\x61\x63tion_mask\x18\x0b \x03(\x08\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\n9mlagents/envs/communicator_objects/agent_info_proto.proto\x12\x14\x63ommunicator_objects\x1a;mlagents/envs/communicator_objects/custom_observation.proto\"\xd7\x02\n\x0e\x41gentInfoProto\x12\"\n\x1astacked_vector_observation\x18\x01 \x03(\x02\x12\x1b\n\x13visual_observations\x18\x02 \x03(\x0c\x12\x18\n\x10text_observation\x18\x03 \x01(\t\x12\x1d\n\x15stored_vector_actions\x18\x04 \x03(\x02\x12\x1b\n\x13stored_text_actions\x18\x05 \x01(\t\x12\x10\n\x08memories\x18\x06 \x03(\x02\x12\x0e\n\x06reward\x18\x07 \x01(\x02\x12\x0c\n\x04\x64one\x18\x08 \x01(\x08\x12\x18\n\x10max_step_reached\x18\t \x01(\x08\x12\n\n\x02id\x18\n \x01(\x05\x12\x13\n\x0b\x61\x63tion_mask\x18\x0b \x03(\x08\x12\x43\n\x12\x63ustom_observation\x18\x0c \x01(\x0b\x32\'.communicator_objects.CustomObservationB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
,
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_custom__observation__pb2.DESCRIPTOR,])

has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='visual_observations', full_name='communicator_objects.AgentInfoProto.visual_observations', index=1,
number=2, type=12, cpp_type=9, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='text_observation', full_name='communicator_objects.AgentInfoProto.text_observation', index=2,
number=3, type=9, cpp_type=9, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='stored_vector_actions', full_name='communicator_objects.AgentInfoProto.stored_vector_actions', index=3,
number=4, type=2, cpp_type=6, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='stored_text_actions', full_name='communicator_objects.AgentInfoProto.stored_text_actions', index=4,
number=5, type=9, cpp_type=9, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='memories', full_name='communicator_objects.AgentInfoProto.memories', index=5,
number=6, type=2, cpp_type=6, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='reward', full_name='communicator_objects.AgentInfoProto.reward', index=6,
number=7, type=2, cpp_type=6, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='done', full_name='communicator_objects.AgentInfoProto.done', index=7,
number=8, type=8, cpp_type=7, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='max_step_reached', full_name='communicator_objects.AgentInfoProto.max_step_reached', index=8,
number=9, type=8, cpp_type=7, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='id', full_name='communicator_objects.AgentInfoProto.id', index=9,
number=10, type=5, cpp_type=1, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='action_mask', full_name='communicator_objects.AgentInfoProto.action_mask', index=10,
number=11, type=8, cpp_type=7, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='custom_observation', full_name='communicator_objects.AgentInfoProto.custom_observation', index=11,
number=12, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
serialized_start=84,
serialized_end=358,
serialized_start=145,
serialized_end=488,
_AGENTINFOPROTO.fields_by_name['custom_observation'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_custom__observation__pb2._CUSTOMOBSERVATION
DESCRIPTOR.message_types_by_name['AgentInfoProto'] = _AGENTINFOPROTO
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

_sym_db.RegisterMessage(AgentInfoProto)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

23
ml-agents/mlagents/envs/communicator_objects/brain_parameters_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()

name='mlagents/envs/communicator_objects/brain_parameters_proto.proto',
package='communicator_objects',
syntax='proto3',
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\n?mlagents/envs/communicator_objects/brain_parameters_proto.proto\x12\x14\x63ommunicator_objects\x1a\x39mlagents/envs/communicator_objects/resolution_proto.proto\x1a\x39mlagents/envs/communicator_objects/space_type_proto.proto\"\xd4\x02\n\x14\x42rainParametersProto\x12\x1f\n\x17vector_observation_size\x18\x01 \x01(\x05\x12\'\n\x1fnum_stacked_vector_observations\x18\x02 \x01(\x05\x12\x1a\n\x12vector_action_size\x18\x03 \x03(\x05\x12\x41\n\x12\x63\x61mera_resolutions\x18\x04 \x03(\x0b\x32%.communicator_objects.ResolutionProto\x12\"\n\x1avector_action_descriptions\x18\x05 \x03(\t\x12\x46\n\x18vector_action_space_type\x18\x06 \x01(\x0e\x32$.communicator_objects.SpaceTypeProto\x12\x12\n\nbrain_name\x18\x07 \x01(\t\x12\x13\n\x0bis_training\x18\x08 \x01(\x08\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
,
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_resolution__proto__pb2.DESCRIPTOR,mlagents_dot_envs_dot_communicator__objects_dot_space__type__proto__pb2.DESCRIPTOR,])

has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='num_stacked_vector_observations', full_name='communicator_objects.BrainParametersProto.num_stacked_vector_observations', index=1,
number=2, type=5, cpp_type=1, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='vector_action_size', full_name='communicator_objects.BrainParametersProto.vector_action_size', index=2,
number=3, type=5, cpp_type=1, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='camera_resolutions', full_name='communicator_objects.BrainParametersProto.camera_resolutions', index=3,
number=4, type=11, cpp_type=10, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='vector_action_descriptions', full_name='communicator_objects.BrainParametersProto.vector_action_descriptions', index=4,
number=5, type=9, cpp_type=9, label=3,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='vector_action_space_type', full_name='communicator_objects.BrainParametersProto.vector_action_space_type', index=5,
number=6, type=14, cpp_type=8, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='brain_name', full_name='communicator_objects.BrainParametersProto.brain_name', index=6,
number=7, type=9, cpp_type=9, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='is_training', full_name='communicator_objects.BrainParametersProto.is_training', index=7,
number=8, type=8, cpp_type=7, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],

_sym_db.RegisterMessage(BrainParametersProto)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

13
ml-agents/mlagents/envs/communicator_objects/command_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()

name='mlagents/envs/communicator_objects/command_proto.proto',
package='communicator_objects',
syntax='proto3',
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\n6mlagents/envs/communicator_objects/command_proto.proto\x12\x14\x63ommunicator_objects*-\n\x0c\x43ommandProto\x12\x08\n\x04STEP\x10\x00\x12\t\n\x05RESET\x10\x01\x12\x08\n\x04QUIT\x10\x02\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)

values=[
_descriptor.EnumValueDescriptor(
name='STEP', index=0, number=0,
options=None,
serialized_options=None,
options=None,
serialized_options=None,
options=None,
serialized_options=None,
options=None,
serialized_options=None,
serialized_start=80,
serialized_end=125,
)

_sym_db.RegisterFileDescriptor(DESCRIPTOR)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

19
ml-agents/mlagents/envs/communicator_objects/engine_configuration_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()

name='mlagents/envs/communicator_objects/engine_configuration_proto.proto',
package='communicator_objects',
syntax='proto3',
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\nCmlagents/envs/communicator_objects/engine_configuration_proto.proto\x12\x14\x63ommunicator_objects\"\x95\x01\n\x18\x45ngineConfigurationProto\x12\r\n\x05width\x18\x01 \x01(\x05\x12\x0e\n\x06height\x18\x02 \x01(\x05\x12\x15\n\rquality_level\x18\x03 \x01(\x05\x12\x12\n\ntime_scale\x18\x04 \x01(\x02\x12\x19\n\x11target_frame_rate\x18\x05 \x01(\x05\x12\x14\n\x0cshow_monitor\x18\x06 \x01(\x08\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)

has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='height', full_name='communicator_objects.EngineConfigurationProto.height', index=1,
number=2, type=5, cpp_type=1, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='quality_level', full_name='communicator_objects.EngineConfigurationProto.quality_level', index=2,
number=3, type=5, cpp_type=1, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='time_scale', full_name='communicator_objects.EngineConfigurationProto.time_scale', index=3,
number=4, type=2, cpp_type=6, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='target_frame_rate', full_name='communicator_objects.EngineConfigurationProto.target_frame_rate', index=4,
number=5, type=5, cpp_type=1, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='show_monitor', full_name='communicator_objects.EngineConfigurationProto.show_monitor', index=5,
number=6, type=8, cpp_type=7, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],

_sym_db.RegisterMessage(EngineConfigurationProto)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

40
ml-agents/mlagents/envs/communicator_objects/environment_parameters_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
from mlagents.envs.communicator_objects import custom_reset_parameters_pb2 as mlagents_dot_envs_dot_communicator__objects_dot_custom__reset__parameters__pb2
DESCRIPTOR = _descriptor.FileDescriptor(

serialized_pb=_b('\nEmlagents/envs/communicator_objects/environment_parameters_proto.proto\x12\x14\x63ommunicator_objects\"\xb5\x01\n\x1a\x45nvironmentParametersProto\x12_\n\x10\x66loat_parameters\x18\x01 \x03(\x0b\x32\x45.communicator_objects.EnvironmentParametersProto.FloatParametersEntry\x1a\x36\n\x14\x46loatParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\nEmlagents/envs/communicator_objects/environment_parameters_proto.proto\x12\x14\x63ommunicator_objects\x1a@mlagents/envs/communicator_objects/custom_reset_parameters.proto\"\x83\x02\n\x1a\x45nvironmentParametersProto\x12_\n\x10\x66loat_parameters\x18\x01 \x03(\x0b\x32\x45.communicator_objects.EnvironmentParametersProto.FloatParametersEntry\x12L\n\x17\x63ustom_reset_parameters\x18\x02 \x01(\x0b\x32+.communicator_objects.CustomResetParameters\x1a\x36\n\x14\x46loatParametersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x02:\x02\x38\x01\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
,
dependencies=[mlagents_dot_envs_dot_communicator__objects_dot_custom__reset__parameters__pb2.DESCRIPTOR,])

has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='value', full_name='communicator_objects.EnvironmentParametersProto.FloatParametersEntry.value', index=1,
number=2, type=2, cpp_type=6, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=_descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001')),
serialized_options=_b('8\001'),
serialized_start=223,
serialized_end=277,
serialized_start=367,
serialized_end=421,
)
_ENVIRONMENTPARAMETERSPROTO = _descriptor.Descriptor(

has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='custom_reset_parameters', full_name='communicator_objects.EnvironmentParametersProto.custom_reset_parameters', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
serialized_start=96,
serialized_end=277,
serialized_start=162,
serialized_end=421,
_ENVIRONMENTPARAMETERSPROTO.fields_by_name['custom_reset_parameters'].message_type = mlagents_dot_envs_dot_communicator__objects_dot_custom__reset__parameters__pb2._CUSTOMRESETPARAMETERS
DESCRIPTOR.message_types_by_name['EnvironmentParametersProto'] = _ENVIRONMENTPARAMETERSPROTO
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

_sym_db.RegisterMessage(EnvironmentParametersProto.FloatParametersEntry)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
_ENVIRONMENTPARAMETERSPROTO_FLOATPARAMETERSENTRY.has_options = True
_ENVIRONMENTPARAMETERSPROTO_FLOATPARAMETERSENTRY._options = _descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001'))
DESCRIPTOR._options = None
_ENVIRONMENTPARAMETERSPROTO_FLOATPARAMETERSENTRY._options = None
# @@protoc_insertion_point(module_scope)

11
ml-agents/mlagents/envs/communicator_objects/header_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()

name='mlagents/envs/communicator_objects/header.proto',
package='communicator_objects',
syntax='proto3',
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\n/mlagents/envs/communicator_objects/header.proto\x12\x14\x63ommunicator_objects\")\n\x06Header\x12\x0e\n\x06status\x18\x01 \x01(\x05\x12\x0f\n\x07message\x18\x02 \x01(\tB\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)

has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='message', full_name='communicator_objects.Header.message', index=1,
number=2, type=9, cpp_type=9, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],

_sym_db.RegisterMessage(Header)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

13
ml-agents/mlagents/envs/communicator_objects/resolution_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()

name='mlagents/envs/communicator_objects/resolution_proto.proto',
package='communicator_objects',
syntax='proto3',
serialized_options=_b('\252\002\034MLAgents.CommunicatorObjects'),
serialized_pb=_b('\n9mlagents/envs/communicator_objects/resolution_proto.proto\x12\x14\x63ommunicator_objects\"D\n\x0fResolutionProto\x12\r\n\x05width\x18\x01 \x01(\x05\x12\x0e\n\x06height\x18\x02 \x01(\x05\x12\x12\n\ngray_scale\x18\x03 \x01(\x08\x42\x1f\xaa\x02\x1cMLAgents.CommunicatorObjectsb\x06proto3')
)

has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='height', full_name='communicator_objects.ResolutionProto.height', index=1,
number=2, type=5, cpp_type=1, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='gray_scale', full_name='communicator_objects.ResolutionProto.gray_scale', index=2,
number=3, type=8, cpp_type=7, label=1,

options=None, file=DESCRIPTOR),
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],

options=None,
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],

_sym_db.RegisterMessage(ResolutionProto)
DESCRIPTOR.has_options = True
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\252\002\034MLAgents.CommunicatorObjects'))
DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)

11
ml-agents/mlagents/envs/communicator_objects/space_type_proto_pb2.py


from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)