浏览代码

Merge pull request #1494 from Unity-Technologies/release-v0.6

v0.6 Release
/hotfix-v0.9.2a
GitHub 6 年前
当前提交
a196dde2
共有 488 个文件被更改,包括 2612 次插入13040 次删除
  1. 4
      .gitignore
  2. 19
      README.md
  3. 176
      UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs
  4. 15
      UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs.meta
  5. 175
      UnitySDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs
  6. 61
      UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs
  7. 5
      UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab
  8. 5
      UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab
  9. 280
      UnitySDK/Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity
  10. 226
      UnitySDK/Assets/ML-Agents/Examples/3DBall/Scenes/3DBallHard.unity
  11. 9
      UnitySDK/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs
  12. 70
      UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Prefabs/RLArea.prefab
  13. 68
      UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Prefabs/TeachingArea.prefab
  14. 57
      UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Prefabs/VisualRLArea.prefab
  15. 417
      UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Scenes/Banana.unity
  16. 384
      UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Scenes/BananaIL.unity
  17. 257
      UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Scenes/VisualBanana.unity
  18. 444
      UnitySDK/Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
  19. 6
      UnitySDK/Assets/ML-Agents/Examples/Basic/Scripts/BasicDecision.cs
  20. 12
      UnitySDK/Assets/ML-Agents/Examples/Bouncer/Prefabs/Environment.prefab
  21. 216
      UnitySDK/Assets/ML-Agents/Examples/Bouncer/Scenes/Bouncer.unity
  22. 318
      UnitySDK/Assets/ML-Agents/Examples/Bouncer/Scenes/BouncerIL.unity
  23. 35
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/Crawler.prefab
  24. 25
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/DynamicPlatform.prefab
  25. 21
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/FixedPlatform.prefab
  26. 192
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerDynamicTarget.unity
  27. 753
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Scenes/CrawlerStaticTarget.unity
  28. 168
      UnitySDK/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity
  29. 15
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Prefabs/HallwayArea.prefab
  30. 17
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Prefabs/VisualHallwayArea.prefab
  31. 322
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Scenes/Hallway.unity
  32. 980
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Scenes/HallwayIL.unity
  33. 234
      UnitySDK/Assets/ML-Agents/Examples/Hallway/Scenes/VisualHallway.unity
  34. 11
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockArea.prefab
  35. 13
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Prefabs/VisualArea.prefab
  36. 567
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlock.unity
  37. 980
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlockIL.unity
  38. 240
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scenes/VisualPushBlock.unity
  39. 42
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Prefabs/AreaPB.prefab
  40. 42
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Prefabs/VisualAreaPB.prefab
  41. 624
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Scenes/Pyramids.unity
  42. 366
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Scenes/PyramidsIL.unity
  43. 202
      UnitySDK/Assets/ML-Agents/Examples/Pyramids/Scenes/VisualPyramids.unity
  44. 10
      UnitySDK/Assets/ML-Agents/Examples/Reacher/Prefabs/Agent.prefab
  45. 207
      UnitySDK/Assets/ML-Agents/Examples/Reacher/Scenes/Reacher.unity
  46. 6
      UnitySDK/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherDecision.cs
  47. 17
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RandomDecision.cs
  48. 899
      UnitySDK/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
  49. 2
      UnitySDK/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab.meta
  50. 941
      UnitySDK/Assets/ML-Agents/Examples/Soccer/Scenes/SoccerTwos.unity
  51. 6
      UnitySDK/Assets/ML-Agents/Examples/Template/Scripts/TemplateDecision.cs
  52. 17
      UnitySDK/Assets/ML-Agents/Examples/Tennis/Prefabs/TennisArea.prefab
  53. 707
      UnitySDK/Assets/ML-Agents/Examples/Tennis/Scenes/Tennis.unity
  54. 317
      UnitySDK/Assets/ML-Agents/Examples/Tennis/Scenes/TennisIL.unity
  55. 20
      UnitySDK/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
  56. 27
      UnitySDK/Assets/ML-Agents/Examples/Walker/Prefabs/WalkerPair.prefab
  57. 628
      UnitySDK/Assets/ML-Agents/Examples/Walker/Scenes/Walker.unity
  58. 13
      UnitySDK/Assets/ML-Agents/Examples/WallJump/Prefabs/WallJumpArea.prefab
  59. 747
      UnitySDK/Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity
  60. 80
      UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
  61. 21
      UnitySDK/Assets/ML-Agents/Scripts/ActionMasker.cs
  62. 81
      UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
  63. 154
      UnitySDK/Assets/ML-Agents/Scripts/Batcher.cs
  64. 278
      UnitySDK/Assets/ML-Agents/Scripts/Brain.cs
  65. 58
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/BrainParametersProto.cs
  66. 4
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityInput.cs
  67. 6
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityMessage.cs
  68. 4
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityOutput.cs
  69. 2
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityRlInitializationOutput.cs
  70. 2
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityRlInput.cs
  71. 8
      UnitySDK/Assets/ML-Agents/Scripts/CommunicatorObjects/UnityToExternalGrpc.cs
  72. 8
      UnitySDK/Assets/ML-Agents/Scripts/Decision.cs
  73. 3
      UnitySDK/Assets/ML-Agents/Scripts/LearningBrain.cs.meta
  74. 80
      config/trainer_config.yaml
  75. 2
      docs/Background-Machine-Learning.md
  76. 16
      docs/Background-TensorFlow.md
  77. 2
      docs/Background-Unity.md
  78. 149
      docs/Basic-Guide.md
  79. 69
      docs/FAQ.md
  80. 80
      docs/Getting-Started-with-Balance-Ball.md
  81. 6
      docs/Glossary.md
  82. 23
      docs/Installation-Windows.md
  83. 42
      docs/Installation.md
  84. 2
      docs/Learning-Environment-Best-Practices.md
  85. 368
      docs/Learning-Environment-Create-New.md
  86. 5
      docs/Learning-Environment-Design-Academy.md
  87. 19
      docs/Learning-Environment-Design-Agents.md
  88. 70
      docs/Learning-Environment-Design-Brains.md
  89. 11
      docs/Learning-Environment-Design-Heuristic-Brains.md
  90. 9
      docs/Learning-Environment-Design-Player-Brains.md
  91. 51
      docs/Learning-Environment-Design.md
  92. 13
      docs/Learning-Environment-Examples.md
  93. 66
      docs/Learning-Environment-Executable.md
  94. 3
      docs/Limitations.md
  95. 64
      docs/ML-Agents-Overview.md
  96. 51
      docs/Migrating.md
  97. 17
      docs/Python-API.md
  98. 6
      docs/Readme.md
  99. 4
      docs/Training-Curriculum-Learning.md
  100. 78
      docs/Training-Imitation-Learning.md

4
.gitignore


/UnitySDK/Assets/AssetStoreTools*
/UnitySDK/Assets/Plugins*
/UnitySDK/Assets/Gizmos*
/UnitySDK/Assets/Demonstrations*
# Tensorflow Model Info
/models

/UnitySDK/Assets/ML-Agents/Plugins/Android*
/UnitySDK/Assets/ML-Agents/Plugins/iOS*
/UnitySDK/Assets/ML-Agents/Plugins/Computer*
/UnitySDK/Assets/ML-Agents/Plugins/System*
/UnitySDK/Assets/ML-Agents/Plugins/System.Numerics*
/UnitySDK/Assets/ML-Agents/Plugins/System.ValueTuple*
# Generated doc folders
/docs/html

19
README.md


* For more information, in addition to installation and usage instructions, see
our [documentation home](docs/Readme.md).
* If you are a researcher interested in a discussion of Unity as an AI platform, see a pre-print of our [reference paper on Unity and the ML-Agents Toolkit](https://arxiv.org/abs/1809.02627). Also, see below for instructions on citing this paper.
* If you have used a version of the ML-Agents toolkit prior to v0.5, we strongly
* If you have used an earlier version of the ML-Agents toolkit, we strongly
recommend our [guide on migrating from earlier versions](docs/Migrating.md).
## Additional Resources

[contribution guidelines](CONTRIBUTING.md) and
[code of conduct](CODE_OF_CONDUCT.md).
You can connect with us and the broader community
through Unity Connect and GitHub:
If you run into any problems using the ML-Agents toolkit,
[submit an issue](https://github.com/Unity-Technologies/ml-agents/issues) and
make sure to include as much detail as possible.
Your opinion matters a great deal to us. Only by hearing your thoughts on the Unity ML-Agents Toolkit can we continue to improve and grow. Please take a few minutes to [let us know about it](https://github.com/Unity-Technologies/ml-agents/issues/1454).
* Join our
[Unity Machine Learning Channel](https://connect.unity.com/messages/c/035fba4f88400000)
to connect with others using the ML-Agents toolkit and Unity developers
enthusiastic about machine learning. We use that channel to surface updates
regarding the ML-Agents toolkit (and, more broadly, machine learning in
games).
* If you run into any problems using the ML-Agents toolkit,
[submit an issue](https://github.com/Unity-Technologies/ml-agents/issues) and
make sure to include as much detail as possible.
* Your opinion matters a great deal to us. Only by hearing your thoughts on the Unity ML-Agents Toolkit can we continue to improve and grow. Please take a few minutes to [let us know about it](https://github.com/Unity-Technologies/ml-agents/issues/1454).
For any other questions or feedback, connect directly with the ML-Agents
team at ml-agents@unity3d.com.

176
UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
using UnityEditor;
using UnityEditor;
using System.Linq;
/*
This code is meant to modify the behavior of the inspector on Brain Components.
Depending on the type of brain that is used, the available fields will be modified in the inspector accordingly.
*/
/// <summary>
/// CustomEditor for the Brain base class. Defines the default Inspector view for a Brain.
/// Shows the BrainParameters of the Brain and expose a tool to deep copy BrainParameters
/// between brains.
/// </summary>
{
[SerializeField] bool _Foldout = true;
{
Brain myBrain = (Brain) target;
SerializedObject serializedBrain = serializedObject;
if (myBrain.transform.parent == null)
{
EditorGUILayout.HelpBox(
"A Brain GameObject must be a child of an Academy GameObject!",
MessageType.Error);
}
else if (myBrain.transform.parent.GetComponent<Academy>() == null)
{
EditorGUILayout.HelpBox(
"The Parent of a Brain must have an Academy Component attached to it!",
MessageType.Error);
}
serializedBrain.Update();
_Foldout = EditorGUILayout.Foldout(_Foldout, "Brain Parameters");
int indentLevel = EditorGUI.indentLevel;
if (_Foldout)
{
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Vector Observation");
EditorGUI.indentLevel++;
SerializedProperty bpVectorObsSize =
serializedBrain.FindProperty("brainParameters.vectorObservationSize");
EditorGUILayout.PropertyField(bpVectorObsSize, new GUIContent("Space Size",
"Length of state " +
"vector for brain (In Continuous state space)." +
"Or number of possible values (in Discrete state space)."));
SerializedProperty bpNumStackedVectorObs =
serializedBrain.FindProperty("brainParameters.numStackedVectorObservations");
EditorGUILayout.PropertyField(bpNumStackedVectorObs, new GUIContent(
"Stacked Vectors", "Number of states that" +
" will be stacked before beeing fed to the neural network."));
EditorGUI.indentLevel--;
SerializedProperty bpCamResol =
serializedBrain.FindProperty("brainParameters.cameraResolutions");
EditorGUILayout.PropertyField(bpCamResol, new GUIContent("Visual Observation",
"Describes height, " +
"width, and whether to greyscale visual observations for the Brain."), true);
EditorGUILayout.LabelField("Vector Action");
EditorGUI.indentLevel++;
SerializedProperty bpVectorActionType =
serializedBrain.FindProperty("brainParameters.vectorActionSpaceType");
EditorGUILayout.PropertyField(bpVectorActionType, new GUIContent("Space Type",
"Corresponds to whether state" +
" vector contains a single integer (Discrete) " +
"or a series of real-valued floats (Continuous)."));
if (bpVectorActionType.enumValueIndex == 1)
{
//Continuous case :
SerializedProperty bpVectorActionSize =
serializedBrain.FindProperty("brainParameters.vectorActionSize");
bpVectorActionSize.arraySize = 1;
SerializedProperty continuousActionSize =
bpVectorActionSize.GetArrayElementAtIndex(0);
EditorGUILayout.PropertyField(continuousActionSize, new GUIContent(
"Space Size", "Length of continuous action vector."));
}
else
{
// Discrete case :
SerializedProperty bpVectorActionSize =
serializedBrain.FindProperty("brainParameters.vectorActionSize");
bpVectorActionSize.arraySize = EditorGUILayout.IntField(
"Branches Size", bpVectorActionSize.arraySize);
EditorGUI.indentLevel++;
for (int branchIndex = 0;
branchIndex < bpVectorActionSize.arraySize;
branchIndex++)
{
SerializedProperty branchActionSize =
bpVectorActionSize.GetArrayElementAtIndex(branchIndex);
EditorGUILayout.PropertyField(branchActionSize, new GUIContent(
"Branch " + branchIndex+" Size",
"Number of possible actions for the branch number " + branchIndex+"."));
}
EditorGUI.indentLevel--;
}
try
{
BrainParameters parameters = myBrain.brainParameters;
int numberOfDescriptions = 0;
if (parameters.vectorActionSpaceType == SpaceType.continuous)
numberOfDescriptions = parameters.vectorActionSize[0];
else
numberOfDescriptions = parameters.vectorActionSize.Length;
if (parameters.vectorActionDescriptions == null ||
parameters.vectorActionDescriptions.Length != numberOfDescriptions)
parameters.vectorActionDescriptions = new string[numberOfDescriptions];
}
catch
{
}
if (bpVectorActionType.enumValueIndex == 1)
{
//Continuous case :
SerializedProperty bpVectorActionDescription =
serializedBrain.FindProperty("brainParameters.vectorActionDescriptions");
EditorGUILayout.PropertyField(bpVectorActionDescription, new GUIContent(
"Action Descriptions", "A list of strings used to name" +
" the available actions for the Brain."), true);
}
else
{
// Discrete case :
SerializedProperty bpVectorActionDescription =
serializedBrain.FindProperty("brainParameters.vectorActionDescriptions");
EditorGUILayout.PropertyField(bpVectorActionDescription, new GUIContent(
"Branch Descriptions", "A list of strings used to name" +
" the available branches for the Brain."), true);
}
}
EditorGUI.indentLevel = indentLevel;
SerializedProperty bt = serializedBrain.FindProperty("brainType");
EditorGUILayout.PropertyField(bt);
if (bt.enumValueIndex < 0)
var brain = (Brain) target;
var brainToCopy = EditorGUILayout.ObjectField(
"Copy Brain Parameters from : ", null, typeof(Brain), false) as Brain;
if (brainToCopy != null)
bt.enumValueIndex = (int) BrainType.Player;
brain.brainParameters = brainToCopy.brainParameters.Clone();
EditorUtility.SetDirty(brain);
AssetDatabase.SaveAssets();
return;
var serializedBrain = serializedObject;
serializedBrain.Update();
EditorGUILayout.PropertyField(serializedBrain.FindProperty("brainParameters"), true);
myBrain.UpdateCoreBrains();
myBrain.coreBrain.OnInspector();
#if !NET_4_6 && ENABLE_TENSORFLOW
EditorGUILayout.HelpBox ("You cannot have ENABLE_TENSORFLOW without NET_4_6", MessageType.Error);
#endif
// Draws a horizontal thick line
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
}
}
}

15
UnitySDK/Assets/ML-Agents/Editor/BrainEditor.cs.meta


fileFormatVersion: 2
guid: f1895a43ed0f54ffd9ee06234c4399e7
timeCreated: 1503270350
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7b07bebd03994ed08559c725da882b62
timeCreated: 1537834304

175
UnitySDK/Assets/ML-Agents/Editor/ResetParameterDrawer.cs


namespace MLAgents
{
/// <summary>
/// PropertyDrawer for ResetParameters. Defines how ResetParameters are displayed in the
/// Inspector.
/// </summary>
private ResetParameters _Dictionary;
private const float lineHeight = 17f;
private ResetParameters _parameters;
// The height of a line in the Unity Inspectors
private const float LineHeight = 17f;
// This is the prefix for the key when you add a reset parameter
private const string NewKeyPrefix = "Param-";
/// <summary>
/// Computes the height of the Drawer depending on the property it is showing
/// </summary>
/// <param name="property">The property that is being drawn.</param>
/// <param name="label">The label of the property being drawn.</param>
/// <returns>The vertical space needed to draw the property.</returns>
CheckInitialize(property, label);
return (_Dictionary.Count + 2) * lineHeight;
LazyInitializeParameters(property, label);
return (_parameters.Count + 2) * LineHeight;
/// <inheritdoc />
CheckInitialize(property, label);
position.height = lineHeight;
LazyInitializeParameters(property, label);
position.height = LineHeight;
position.y += LineHeight;
var width = position.width / 2 - 24;
var keyRect = new Rect(position.x + 20, position.y, width, position.height);
var valueRect = new Rect(position.x + width + 30, position.y, width, position.height);
DrawAddRemoveButtons(keyRect, valueRect);
foreach (var item in _Dictionary)
foreach (var parameter in _parameters)
var key = item.Key;
var value = item.Value;
position.y += lineHeight;
// This is the rectangle for the key
var keyRect = position;
keyRect.x += 20;
keyRect.width /= 2;
keyRect.width -= 24;
var key = parameter.Key;
var value = parameter.Value;
keyRect.y += LineHeight;
valueRect.y += LineHeight;
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
MarkSceneAsDirty();
_Dictionary.Remove(key);
_Dictionary.Add(newKey, value);
_parameters.Remove(key);
_parameters.Add(newKey, value);
// This is the Rectangle for the value
var valueRect = position;
valueRect.x = position.width / 2 + 15;
valueRect.width = keyRect.width - 18;
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
_Dictionary[key] = value;
MarkSceneAsDirty();
_parameters[key] = value;
EditorGUI.EndProperty();
}
// This is the rectangle for the Add button
position.y += lineHeight;
var AddButtonRect = position;
AddButtonRect.x += 20;
AddButtonRect.width /= 2;
AddButtonRect.width -= 24;
if (GUI.Button(AddButtonRect, new GUIContent("Add New",
"Add a new item to the default reset paramters"), EditorStyles.miniButton))
/// <summary>
/// Draws the Add and Remove buttons.
/// </summary>
/// <param name="addRect">The rectangle for the Add New button.</param>
/// <param name="removeRect">The rectangle for the Remove Last button.</param>
private void DrawAddRemoveButtons(Rect addRect, Rect removeRect)
{
// This is the Add button
if (_parameters.Count == 0)
{
addRect.width *= 2;
}
if (GUI.Button(addRect,
new GUIContent("Add New", "Add a new item to the default reset parameters"),
EditorStyles.miniButton))
{
MarkSceneAsDirty();
AddParameter();
}
// If there are no items in the ResetParameters, Hide the Remove button
if (_parameters.Count == 0)
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
AddNewItem();
return;
// This is the rectangle for the Remove button
var RemoveButtonRect = position;
RemoveButtonRect.x = position.width / 2 + 15;
RemoveButtonRect.width = AddButtonRect.width - 18;
if (GUI.Button(RemoveButtonRect, new GUIContent("Remove Last",
"Remove the last item to the default reset paramters"), EditorStyles.miniButton))
// This is the Remove button
if (GUI.Button(removeRect,
new GUIContent(
"Remove Last", "Remove the last item from the default reset parameters"),
EditorStyles.miniButton))
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
RemoveLastItem();
MarkSceneAsDirty();
RemoveLastParameter();
EditorGUI.EndProperty();
private void CheckInitialize(SerializedProperty property, GUIContent label)
/// <summary>
/// Signals that the property has been modified and requires the scene to be saved for
/// the changes to persist. Only works when the Editor is not playing.
/// </summary>
private static void MarkSceneAsDirty()
if (_Dictionary == null)
if (!EditorApplication.isPlaying)
var target = property.serializedObject.targetObject;
_Dictionary = fieldInfo.GetValue(target) as ResetParameters;
if (_Dictionary == null)
{
_Dictionary = new ResetParameters();
fieldInfo.SetValue(target, _Dictionary);
}
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
private void ClearResetParamters()
/// <summary>
/// Ensures that the state of the Drawer is synchronized with the property.
/// </summary>
/// <param name="property">The SerializedProperty of the ResetParameters
/// to make the custom GUI for.</param>
/// <param name="label">The label of this property.</param>
private void LazyInitializeParameters(SerializedProperty property, GUIContent label)
_Dictionary.Clear();
if (_parameters != null)
{
return;
}
var target = property.serializedObject.targetObject;
_parameters = fieldInfo.GetValue(target) as ResetParameters;
if (_parameters == null)
{
_parameters = new ResetParameters();
fieldInfo.SetValue(target, _parameters);
}
private void RemoveLastItem()
/// <summary>
/// Removes the last ResetParameter from the ResetParameters
/// </summary>
private void RemoveLastParameter()
if (_Dictionary.Count > 0)
if (_parameters.Count > 0)
string key = _Dictionary.Keys.ToList()[_Dictionary.Count - 1];
_Dictionary.Remove(key);
string key = _parameters.Keys.ToList()[_parameters.Count - 1];
_parameters.Remove(key);
private void AddNewItem()
/// <summary>
/// Adds a new ResetParameter to the ResetParameters with a default name.
/// </summary>
private void AddParameter()
string key = "Param-" + _Dictionary.Count.ToString();
string key = NewKeyPrefix + _parameters.Count;
_Dictionary.Add(key, value);
_parameters.Add(key, value);
}
catch (Exception e)
{

61
UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs


// It is left empty because we are not testing any brain behavior
public class TestBrain : Brain
{
public int numberOfCallsToInitialize = 0;
public int numberOfCallsToDecideAction = 0;
public static TestBrain Instantiate()
{
return CreateInstance<TestBrain>();
}
protected override void Initialize()
{
numberOfCallsToInitialize++;
}
protected override void DecideAction()
{
numberOfCallsToDecideAction++;
agentInfos.Clear();
}
}

public class EditModeTestInitialization
{
private Brain GenerateTestBrain()
{
return ScriptableObject.CreateInstance<TestBrain>();
}
[Test]
public void TestAcademy()
{

GameObject acaGO = new GameObject("TestAcademy");
acaGO.AddComponent<TestAcademy>();
TestAcademy aca = acaGO.GetComponent<TestAcademy>();
GameObject brainGO = new GameObject("TestBrain");
brainGO.transform.parent = acaGO.transform;
brainGO.AddComponent<TestBrain>();
TestBrain brain = brainGO.GetComponent<TestBrain>();
TestBrain brain = TestBrain.Instantiate();
brain.brainParameters = new BrainParameters();
brain.brainParameters.vectorObservationSize = 0;
agent1.GiveBrain(brain);

GameObject acaGO = new GameObject("TestAcademy");
acaGO.AddComponent<TestAcademy>();
TestAcademy aca = acaGO.GetComponent<TestAcademy>();
GameObject brainGO = new GameObject("TestBrain");
brainGO.transform.parent = acaGO.transform;
brainGO.AddComponent<TestBrain>();
TestBrain brain = brainGO.GetComponent<TestBrain>();
TestBrain brain = TestBrain.Instantiate();
MethodInfo AgentEnableMethod = typeof(Agent).GetMethod(

agent2.agentParameters.onDemandDecision = true;
// agent2 will request decisions only when RequestDecision is called
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new resolution[0];
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

GameObject acaGO = new GameObject("TestAcademy");
acaGO.AddComponent<TestAcademy>();
TestAcademy aca = acaGO.GetComponent<TestAcademy>();
GameObject brainGO = new GameObject("TestBrain");
brainGO.transform.parent = acaGO.transform;
brainGO.AddComponent<TestBrain>();
TestBrain brain = brainGO.GetComponent<TestBrain>();
TestBrain brain = TestBrain.Instantiate();
MethodInfo AgentEnableMethod = typeof(Agent).GetMethod(

agent2.agentParameters.onDemandDecision = true;
// agent2 will request decisions only when RequestDecision is called
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new resolution[0];
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

GameObject acaGO = new GameObject("TestAcademy");
acaGO.AddComponent<TestAcademy>();
TestAcademy aca = acaGO.GetComponent<TestAcademy>();
GameObject brainGO = new GameObject("TestBrain");
brainGO.transform.parent = acaGO.transform;
brainGO.AddComponent<TestBrain>();
TestBrain brain = brainGO.GetComponent<TestBrain>();
TestBrain brain = TestBrain.Instantiate();
MethodInfo AgentEnableMethod = typeof(Agent).GetMethod(

agent1.agentParameters.maxStep = 20;
agent2.agentParameters.maxStep = 30;
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new resolution[0];
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

GameObject acaGO = new GameObject("TestAcademy");
acaGO.AddComponent<TestAcademy>();
TestAcademy aca = acaGO.GetComponent<TestAcademy>();
GameObject brainGO = new GameObject("TestBrain");
brainGO.transform.parent = acaGO.transform;
brainGO.AddComponent<TestBrain>();
TestBrain brain = brainGO.GetComponent<TestBrain>();
TestBrain brain = TestBrain.Instantiate();
MethodInfo AgentEnableMethod = typeof(Agent).GetMethod(

agent1.agentParameters.resetOnDone = false;
agent2.agentParameters.resetOnDone = false;
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new resolution[0];
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

GameObject acaGO = new GameObject("TestAcademy");
acaGO.AddComponent<TestAcademy>();
TestAcademy aca = acaGO.GetComponent<TestAcademy>();
GameObject brainGO = new GameObject("TestBrain");
brainGO.transform.parent = acaGO.transform;
brainGO.AddComponent<TestBrain>();
TestBrain brain = brainGO.GetComponent<TestBrain>();
TestBrain brain = TestBrain.Instantiate();
MethodInfo AgentEnableMethod = typeof(Agent).GetMethod(

// agent2 will request decisions only when RequestDecision is called
agent1.agentParameters.maxStep = 20;
brain.brainParameters.vectorObservationSize = 0;
brain.brainParameters.cameraResolutions = new resolution[0];
brain.brainParameters.cameraResolutions = new Resolution[0];
agent1.GiveBrain(brain);
agent2.GiveBrain(brain);

5
UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/Game.prefab


m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: e35c6159207d7448e988c8cf0c137ab6, type: 2}
m_StaticBatchInfo:

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 00d852aac9443402984416f9dbcd22ea, type: 2}
m_StaticBatchInfo:

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: edd958d75ed1448138de86f3335ea4fa, type: 2}
m_StaticBatchInfo:

m_Script: {fileID: 11500000, guid: aaba48bf82bee4751aa7b89569e57f73, type: 3}
m_Name:
m_EditorClassIdentifier:
brain: {fileID: 0}
brain: {fileID: 11400000, guid: 97d8f9d40dc8c452f932f7caa9549c7d, type: 2}
agentParameters:
agentCameras: []
maxStep: 5000

5
UnitySDK/Assets/ML-Agents/Examples/3DBall/Prefabs/GameHard.prefab


m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 776dd8b57653342839c3fb5f46ce664e, type: 2}
m_StaticBatchInfo:

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: e35c6159207d7448e988c8cf0c137ab6, type: 2}
m_StaticBatchInfo:

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: edd958d75ed1448138de86f3335ea4fa, type: 2}
m_StaticBatchInfo:

m_Script: {fileID: 11500000, guid: edf26e11cf4ed42eaa3ffb7b91bb4676, type: 3}
m_Name:
m_EditorClassIdentifier:
brain: {fileID: 0}
brain: {fileID: 11400000, guid: 55f48be32ac184c6ab67cf647100bac4, type: 2}
agentParameters:
agentCameras: []
maxStep: 5000

280
UnitySDK/Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity


--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3

m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44824862, g: 0.49827534, b: 0.57558274, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
serializedVersion: 9
m_AtlasSize: 1024
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1

propertyPath: m_Name
value: Game12
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: ball
value:
objectReference: {fileID: 174802794}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Game22
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
--- !u!114 &157026687
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 667765197}
--- !u!1001 &159612743
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Game31
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
--- !u!1 &174802794 stripped
GameObject:
m_PrefabParentObject: {fileID: 1536511242562482, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
m_PrefabInternal: {fileID: 119733639}
--- !u!1001 &292233615
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Game13
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Game21
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Game23
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
m_IsPrefabParent: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: ea4e6e61f90ae46daaf643b945c080ed, type: 2}
m_StaticBatchInfo:

m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &548284581
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
keyContinuousPlayerActions:
- key: 273
index: 1
value: 1
- key: 274
index: 1
value: -1
- key: 275
index: 0
value: -1
- key: 276
index: 0
value: 1
axisContinuousPlayerActions: []
discretePlayerActions: []
brain: {fileID: 667765197}
--- !u!114 &667765197
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 114938382745838118, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1456409882}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c676a8ddf5a5f4f64b35e9ed5028679d, type: 3}
m_Name:
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 8
numStackedVectorObservations: 1
vectorActionSize: 02000000
test: 010000000200000003000000
cameraResolutions: []
vectorActionDescriptions:
-
-
vectorActionSpaceType: 1
brainType: 0
CoreBrains:
- {fileID: 548284581}
- {fileID: 1806797620}
- {fileID: 157026687}
- {fileID: 1159453570}
instanceID: 98474
--- !u!1001 &764818074
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Game32
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Game34
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
--- !u!114 &1159453570
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
graphModel: {fileID: 4900000, guid: 93f91f35982184949a09d9ce97965cd5, type: 3}
graphScope:
graphPlaceholders: []
BatchSizePlaceholderName: batch_size
VectorObservationPlacholderName: vector_observation
RecurrentInPlaceholderName: recurrent_in
RecurrentOutPlaceholderName: recurrent_out
VisualObservationPlaceholderName: []
ActionPlaceholderName: action
PreviousActionPlaceholderName: prev_action
brain: {fileID: 667765197}
--- !u!1001 &1318922267
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_Name
value: Game11

propertyPath: m_Name
value: Game33
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
--- !u!1 &1456409882
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 1518777817328868, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1456409884}
- component: {fileID: 667765197}
- component: {fileID: 1456409883}
m_Layer: 0
m_Name: Ball3DBrain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1456409883
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 114933696884682882, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1456409882}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ccaa8f43c15264209b137d8dc26a8d63, type: 3}
m_Name:
m_EditorClassIdentifier:
rotationSpeed: 2
--- !u!4 &1456409884
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 4244963715435272, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1456409882}
m_LocalRotation: {x: -0, y: -0, z: 0.00000000273576, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1583402088}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1583402087
GameObject:
m_ObjectHideFlags: 0

m_LocalRotation: {x: -0.069583125, y: 0.0049145464, z: 0.0702813, w: 0.99508524}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 0.19999993, z: 5}
m_Children:
- {fileID: 1456409884}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_Script: {fileID: 11500000, guid: eb15e3c3d55e54abaafb74c635b6a458, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
broadcastingBrains:
- {fileID: 11400000, guid: 383c589e8bb76464eadc2525b5b0f2c1, type: 2}
_brainsToControl: []
maxSteps: 0
trainingConfiguration:
width: 600

propertyPath: m_Name
value: Game24
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
--- !u!114 &1806797620
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
brain: {fileID: 667765197}
--- !u!1001 &1825513289
Prefab:
m_ObjectHideFlags: 0

- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_Name
value: Game14
objectReference: {fileID: 0}
- target: {fileID: 114980646877373948, guid: ff026d63a00abdc48ad6ddcff89aba04,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1665577603478558, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ff026d63a00abdc48ad6ddcff89aba04, type: 2}

226
UnitySDK/Assets/ML-Agents/Examples/3DBall/Scenes/3DBallHard.unity


--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3

m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.45096254, g: 0.5008292, b: 0.5744089, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
serializedVersion: 9
m_AtlasSize: 1024
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1

debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!114 &96662597
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
brain: {fileID: 667765197}
--- !u!1001 &98684496
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (1)

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: ea4e6e61f90ae46daaf643b945c080ed, type: 2}
m_StaticBatchInfo:

propertyPath: m_RootOrder
value: 13
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (8)

m_IsPrefabParent: 0
--- !u!114 &659951087
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 667765197}
--- !u!114 &667765197
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 114938382745838118, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1456409882}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c676a8ddf5a5f4f64b35e9ed5028679d, type: 3}
m_Name:
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 5
numStackedVectorObservations: 5
vectorActionSize: 02000000
test: 010000000200000003000000
cameraResolutions: []
vectorActionDescriptions:
-
-
vectorActionSpaceType: 1
brainType: 0
CoreBrains:
- {fileID: 1625398132}
- {fileID: 96662597}
- {fileID: 659951087}
- {fileID: 1925628860}
instanceID: 98652
--- !u!1001 &794378715
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_RootOrder
value: 9
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (4)

propertyPath: m_RootOrder
value: 11
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (6)

propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
m_IsPrefabParent: 0

propertyPath: m_RootOrder
value: 16
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (11)

propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (3)

propertyPath: m_RootOrder
value: 12
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (7)

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 20, y: 0, z: 0}
--- !u!1 &1456409882
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 1518777817328868, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1456409884}
- component: {fileID: 667765197}
- component: {fileID: 1456409883}
m_Layer: 0
m_Name: Ball3DHardBrain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1456409883
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 114933696884682882, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1456409882}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ccaa8f43c15264209b137d8dc26a8d63, type: 3}
m_Name:
m_EditorClassIdentifier:
rotationSpeed: 2
--- !u!4 &1456409884
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 4244963715435272, guid: 00a1ebe742cf2394d8c21484e3a02412,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1456409882}
m_LocalRotation: {x: -0, y: -0, z: 0.00000000273576, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1583402088}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1583402087
GameObject:
m_ObjectHideFlags: 0

m_LocalRotation: {x: -0.069583125, y: 0.0049145464, z: 0.0702813, w: 0.99508524}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 0.19999993, z: 5}
m_Children:
- {fileID: 1456409884}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_Script: {fileID: 11500000, guid: eb15e3c3d55e54abaafb74c635b6a458, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
broadcastingBrains:
- {fileID: 11400000, guid: 4f74e089fbb75455ebf6f0495e30be6e, type: 2}
_brainsToControl: []
maxSteps: 0
trainingConfiguration:
width: 300

propertyPath: m_RootOrder
value: 14
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (9)

m_IsPrefabParent: 0
--- !u!114 &1625398132
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
keyContinuousPlayerActions:
- key: 276
index: 0
value: 1
- key: 275
index: 0
value: -1
- key: 273
index: 1
value: 1
- key: 274
index: 1
value: -1
axisContinuousPlayerActions: []
discretePlayerActions: []
brain: {fileID: 667765197}
--- !u!1 &1746325439
GameObject:
m_ObjectHideFlags: 0

propertyPath: m_RootOrder
value: 15
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (10)

m_IsPrefabParent: 0
--- !u!114 &1925628860
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
graphModel: {fileID: 4900000, guid: 477e2fb07d79544e48897e8ba162a74f, type: 3}
graphScope:
graphPlaceholders: []
BatchSizePlaceholderName: batch_size
VectorObservationPlacholderName: vector_observation
RecurrentInPlaceholderName: recurrent_in
RecurrentOutPlaceholderName: recurrent_out
VisualObservationPlaceholderName: []
ActionPlaceholderName: action
PreviousActionPlaceholderName: prev_action
brain: {fileID: 667765197}
--- !u!1001 &1975354163
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_RootOrder
value: 10
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (5)

propertyPath: m_RootOrder
value: 8
objectReference: {fileID: 0}
- target: {fileID: 114716278740392856, guid: 50eec9166a3e043dd8102d117835dee6,
type: 2}
propertyPath: brain
value:
objectReference: {fileID: 667765197}
- target: {fileID: 1236545525418104, guid: 50eec9166a3e043dd8102d117835dee6, type: 2}
propertyPath: m_Name
value: GameHard (2)

9
UnitySDK/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs


using UnityEngine;
using MLAgents;
public class Ball3DDecision : MonoBehaviour, Decision
public class Ball3DDecision : Decision
public float[] Decide(
public override float[] Decide(
List<float> vectorObs,
List<Texture2D> visualObs,
float reward,

if (gameObject.GetComponent<Brain>().brainParameters.vectorActionSpaceType
== SpaceType.continuous)
if (brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
List<float> act = new List<float>();

return new float[1] { 1f };
}
public List<float> MakeMemory(
public override List<float> MakeMemory(
List<float> vectorObs,
List<Texture2D> visualObs,
float reward,

70
UnitySDK/Assets/ML-Agents/Examples/BananaCollectors/Prefabs/RLArea.prefab


m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials: