浏览代码

Merge branch 'main' into develop-api-documentation-update

Updating with main.
/develop/api-documentation-update-some-fixes
Miguel Alonso Jr 4 年前
当前提交
4846cf0f
共有 177 个文件被更改,包括 530 次插入378 次删除
  1. 2
      .yamato/com.unity.ml-agents-coverage.yml
  2. 2
      .yamato/com.unity.ml-agents-optional-dep-tests.yml
  3. 2
      .yamato/com.unity.ml-agents-pack.yml
  4. 4
      .yamato/com.unity.ml-agents-test.yml
  5. 2
      .yamato/compressed-sensor-test.yml
  6. 2
      .yamato/coverage_tests.metafile
  7. 2
      .yamato/gym-interface-test.yml
  8. 2
      .yamato/protobuf-generation-test.yml
  9. 2
      .yamato/pytest-gpu.yml
  10. 2
      .yamato/python-ll-api-test.yml
  11. 2
      .yamato/standalone-build-test.yml
  12. 2
      .yamato/standalone-build-webgl-test.yml
  13. 2
      .yamato/training-int-tests.yml
  14. 4
      DevProject/Packages/packages-lock.json
  15. 1
      Project/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs
  16. 2
      Project/Assets/ML-Agents/Examples/Basic/Scripts/BasicActuatorComponent.cs
  17. 7
      Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawler.demo.meta
  18. 1
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
  19. 1
      Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/PushAgentEscape.cs
  20. 3
      Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/SimpleNPC.cs
  21. 136
      Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab
  22. 2
      Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs
  23. 50
      Project/Assets/ML-Agents/Examples/Hallway/Prefabs/HallwayArea.prefab
  24. 8
      Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Agent.cs
  25. 4
      Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Drawer.cs
  26. 1
      Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3ExampleActuator.cs
  27. 1
      Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3ExampleActuatorComponent.cs
  28. 54
      Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockCollabAreaGrid.prefab
  29. 5
      Project/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlockCollab.unity
  30. 2
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetectTrigger.cs
  31. 2
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs
  32. 4
      Project/Assets/ML-Agents/Examples/PushBlockWithInput/Scripts/PushBlockWithInputAgentBasic.cs
  33. 2
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs
  34. 12
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ModelOverrider.cs
  35. 8
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab
  36. 6
      Project/Assets/ML-Agents/Examples/Soccer/Prefabs/StrikersVsGoalieField.prefab
  37. 3
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs
  38. 4
      Project/Assets/ML-Agents/Examples/Sorter/Scripts/NumberTile.cs
  39. 2
      Project/Assets/ML-Agents/Examples/Sorter/Scripts/SorterAgent.cs
  40. 3
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs
  41. 1
      Project/Assets/ML-Agents/Examples/Worm/Scripts/WormAgent.cs
  42. 4
      Project/Packages/packages-lock.json
  43. 12
      README.md
  44. 13
      com.unity.ml-agents.extensions/Documentation~/com.unity.ml-agents.extensions.md
  45. 1
      com.unity.ml-agents.extensions/Runtime/Input/Adaptors/ButtonInputActionAdaptor.cs
  46. 2
      com.unity.ml-agents.extensions/Runtime/Input/Adaptors/Vector2InputActionAdaptor.cs
  47. 1
      com.unity.ml-agents.extensions/Runtime/Input/IRLActionInputAdaptor.cs
  48. 1
      com.unity.ml-agents.extensions/Runtime/Input/InputActionActuator.cs
  49. 2
      com.unity.ml-agents.extensions/Tests/Runtime/Input/Adaptors/IntegerInputActionAdaptorTests.cs
  50. 2
      com.unity.ml-agents.extensions/Tests/Runtime/Sensors/CountingGridSensorTests.cs
  51. 1
      com.unity.ml-agents.extensions/Tests/Runtime/Sensors/RigidBodySensorTests.cs
  52. 2
      com.unity.ml-agents.extensions/package.json
  53. 24
      com.unity.ml-agents/CHANGELOG.md
  54. 14
      com.unity.ml-agents/Documentation~/com.unity.ml-agents.md
  55. 2
      com.unity.ml-agents/Editor/BufferSensorComponentEditor.cs
  56. 2
      com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs
  57. 2
      com.unity.ml-agents/Editor/DemonstrationDrawer.cs
  58. 3
      com.unity.ml-agents/Editor/GridSensorComponentEditor.cs
  59. 4
      com.unity.ml-agents/Editor/RayPerceptionSensorComponentBaseEditor.cs
  60. 2
      com.unity.ml-agents/Editor/RenderTextureSensorComponentEditor.cs
  61. 2
      com.unity.ml-agents/Editor/VectorSensorComponentEditor.cs
  62. 4
      com.unity.ml-agents/Runtime/Academy.cs
  63. 1
      com.unity.ml-agents/Runtime/Actuators/ActionSpec.cs
  64. 1
      com.unity.ml-agents/Runtime/Actuators/ActuatorComponent.cs
  65. 2
      com.unity.ml-agents/Runtime/Actuators/IActionReceiver.cs
  66. 4
      com.unity.ml-agents/Runtime/Actuators/IDiscreteActionMask.cs
  67. 26
      com.unity.ml-agents/Runtime/Agent.cs
  68. 2
      com.unity.ml-agents/Runtime/Analytics/InferenceAnalytics.cs
  69. 2
      com.unity.ml-agents/Runtime/Analytics/TrainingAnalytics.cs
  70. 6
      com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
  71. 2
      com.unity.ml-agents/Runtime/DecisionRequester.cs
  72. 9
      com.unity.ml-agents/Runtime/Demonstrations/DemonstrationRecorder.cs
  73. 44
      com.unity.ml-agents/Runtime/Inference/ApplierImpl.cs
  74. 30
      com.unity.ml-agents/Runtime/Inference/BarracudaModelExtensions.cs
  75. 86
      com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs
  76. 58
      com.unity.ml-agents/Runtime/Inference/GeneratorImpl.cs
  77. 13
      com.unity.ml-agents/Runtime/Inference/ModelRunner.cs
  78. 9
      com.unity.ml-agents/Runtime/Inference/TensorApplier.cs
  79. 9
      com.unity.ml-agents/Runtime/Inference/TensorGenerator.cs
  80. 12
      com.unity.ml-agents/Runtime/InplaceArray.cs
  81. 42
      com.unity.ml-agents/Runtime/Integrations/Match3/Match3ActuatorComponent.cs
  82. 27
      com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs
  83. 2
      com.unity.ml-agents/Runtime/Integrations/Match3/Move.cs
  84. 3
      com.unity.ml-agents/Runtime/MLAgentsSettingsManager.cs
  85. 2
      com.unity.ml-agents/Runtime/MultiAgentGroupIdCounter.cs
  86. 1
      com.unity.ml-agents/Runtime/Policies/HeuristicPolicy.cs
  87. 1
      com.unity.ml-agents/Runtime/Policies/RemotePolicy.cs
  88. 23
      com.unity.ml-agents/Runtime/Sensors/BoxOverlapChecker.cs
  89. 17
      com.unity.ml-agents/Runtime/Sensors/GridSensorComponent.cs
  90. 3
      com.unity.ml-agents/Runtime/Sensors/ISensor.cs
  91. 2
      com.unity.ml-agents/Runtime/Sensors/ObservationSpec.cs
  92. 3
      com.unity.ml-agents/Runtime/Sensors/RenderTextureSensor.cs
  93. 1
      com.unity.ml-agents/Runtime/Sensors/SensorComponent.cs
  94. 1
      com.unity.ml-agents/Runtime/Sensors/StackingSensor.cs
  95. 1
      com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs
  96. 1
      com.unity.ml-agents/Runtime/Sensors/VectorSensorComponent.cs
  97. 1
      com.unity.ml-agents/Runtime/SideChannels/TrainingAnalyticsSideChannel.cs
  98. 2
      com.unity.ml-agents/Runtime/SimpleMultiAgentGroup.cs
  99. 2
      com.unity.ml-agents/Tests/Editor/AcademyTests.cs

2
.yamato/com.unity.ml-agents-coverage.yml


{% if package.name == "com.unity.ml-agents.extensions" %}
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
{% endif %}
pull_request.changes.any match ".yamato/com.unity.ml-agents-test.yml")
pull_request.changes.any match ".yamato/com.unity.ml-agents-coverage.yml")
{% endif %}
{% endfor %}
{% endfor %}

2
.yamato/com.unity.ml-agents-optional-dep-tests.yml


name : Test Optional Package Dependencies {{ optional_dep.name }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
commands:
- |

2
.yamato/com.unity.ml-agents-pack.yml


name: Pack
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.small
commands:
- |

4
.yamato/com.unity.ml-agents-test.yml


flavor: b1.small
- name: linux
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
packages:

flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ noDefaultPackagesOptions }} --extra-utr-arg "reruncount=2"
- upm-ci package test -u {{ editor.version }} --package-path {{ package.name }} {{ noDefaultPackagesOptions }} --warnings-as-errors --extra-utr-arg "reruncount=2"
artifacts:
logs:
paths:

2
.yamato/compressed-sensor-test.yml


name: Test Compressed Sensor Observation {{ editor.version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
variables:
UNITY_VERSION: {{ editor.version }}

2
.yamato/coverage_tests.metafile


coverage_test_platforms:
- name: linux
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
coverage_test_packages:

2
.yamato/gym-interface-test.yml


name: Test Linux Gym Interface {{ editor.version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
variables:
UNITY_VERSION: {{ editor.version }}

2
.yamato/protobuf-generation-test.yml


name: Protobuf Generation Tests
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.large
variables:
GRPC_VERSION: "1.14.1"

2
.yamato/pytest-gpu.yml


name: Pytest GPU
agent:
type: Unity::VM::GPU
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.large
commands:
- |

2
.yamato/python-ll-api-test.yml


name: Test Linux LL-API {{ editor.version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
variables:
UNITY_VERSION: {{ editor.version }}

2
.yamato/standalone-build-test.yml


name: Test Linux Standalone {{ editor.version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.large
variables:
UNITY_VERSION: {{ editor.version }}

2
.yamato/standalone-build-webgl-test.yml


name: Test WebGL Standalone {{ editor_version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.large
variables:
UNITY_VERSION: {{ editor_version }}

2
.yamato/training-int-tests.yml


name: Test Linux Fast Training {{ editor.version }}
agent:
type: Unity::VM
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.medium
variables:
UNITY_VERSION: {{ editor.version }}

4
DevProject/Packages/packages-lock.json


{
"dependencies": {
"com.unity.barracuda": {
"version": "1.3.3-preview",
"version": "1.4.0-preview",
"depth": 1,
"source": "registry",
"dependencies": {

"depth": 0,
"source": "local",
"dependencies": {
"com.unity.barracuda": "1.3.3-preview",
"com.unity.barracuda": "1.4.0-preview",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}

1
Project/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Sensors.Reflection;
public class Ball3DHardAgent : Agent

2
Project/Assets/ML-Agents/Examples/Basic/Scripts/BasicActuatorComponent.cs


/// <summary>
/// Simple actuator that converts the action into a {-1, 0, 1} direction
/// </summary>
public class BasicActuator : IActuator, IHeuristicProvider
public class BasicActuator : IActuator
{
public BasicController basicController;
ActionSpec m_ActionSpec;

7
Project/Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawler.demo.meta


fileFormatVersion: 2
guid: 34586a8d0f1c342a49973b36a609e73b
guid: 258df0219226d4b5191ced1365c20f67
internalIDToNameTable:
- first:
114: 11400002
second: Assets/ML-Agents/Examples/Crawler/Demos/ExpertCrawler.demo
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData: ' (Unity.MLAgents.Demonstrations.DemonstrationSummary)'

1
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.Barracuda;
using Unity.MLAgents.Actuators;
using Unity.MLAgentsExamples;
using Unity.MLAgents.Sensors;

1
Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/PushAgentEscape.cs


using System.Collections;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Sensors;

3
Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/SimpleNPC.cs


// using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleNPC : MonoBehaviour

136
Project/Assets/ML-Agents/Examples/FoodCollector/Prefabs/VisualFoodCollectorArea.prefab


m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

- component: {fileID: 114380897261200276}
- component: {fileID: 114326390494230518}
- component: {fileID: 4034342608499629224}
- component: {fileID: 3681854374749311046}
m_Layer: 0
m_Name: Agent (3)
m_TagString: agent

m_Width: 84
m_Height: 84
m_Grayscale: 0
m_ObservationType: 0
m_ObservationStacks: 1
m_Compression: 1
--- !u!114 &4034342608499629224

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
--- !u!114 &3681854374749311046
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1165679820726490}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a6da8f78a394c6ab027688eab81e04d, type: 3}
m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!1 &1179319070824364
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

- component: {fileID: 114869844339180154}
- component: {fileID: 114429222608880102}
- component: {fileID: 7234640249101665162}
- component: {fileID: 3300832746663767942}
m_Layer: 0
m_Name: Agent (1)
m_TagString: agent

m_Width: 84
m_Height: 84
m_Grayscale: 0
m_ObservationType: 0
m_ObservationStacks: 1
m_Compression: 1
--- !u!114 &7234640249101665162

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
--- !u!114 &3300832746663767942
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1317136368302180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a6da8f78a394c6ab027688eab81e04d, type: 3}
m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!1 &1353209702154624
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

- component: {fileID: 114484596947519388}
- component: {fileID: 114036270357198286}
- component: {fileID: 3164735207755090463}
- component: {fileID: 8027755491947001153}
m_Layer: 0
m_Name: Agent
m_TagString: agent

m_Width: 84
m_Height: 84
m_Grayscale: 0
m_ObservationType: 0
m_ObservationStacks: 1
m_Compression: 1
--- !u!114 &3164735207755090463

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
--- !u!114 &8027755491947001153
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1373801553976666}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a6da8f78a394c6ab027688eab81e04d, type: 3}
m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!1 &1399553220224106
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

- component: {fileID: 114729119221978826}
- component: {fileID: 114322691115031348}
- component: {fileID: 5903164052970896384}
- component: {fileID: 7317454953167631695}
m_Layer: 0
m_Name: Agent (2)
m_TagString: agent

m_Width: 84
m_Height: 84
m_Grayscale: 0
m_ObservationType: 0
m_ObservationStacks: 1
m_Compression: 1
--- !u!114 &5903164052970896384

m_EditorClassIdentifier:
DecisionPeriod: 5
TakeActionsBetweenDecisions: 1
--- !u!114 &7317454953167631695
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1939112378710628}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a6da8f78a394c6ab027688eab81e04d, type: 3}
m_Name:
m_EditorClassIdentifier:
debugCommandLineOverride:
--- !u!1 &1971119195936814
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
serializedVersion: 4
m_CookingOptions: 14
m_CookingOptions: 30
m_Mesh: {fileID: 4300000, guid: a9d8f499f5b9848438d280dc28b3b52e, type: 3}

2
Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs


dirToGo += transform.right * right;
rotateDir = -transform.up * rotate;
var shootCommand = (int)discreteActions[0] > 0;
var shootCommand = discreteActions[0] > 0;
if (shootCommand)
{
m_Shoot = true;

50
Project/Assets/ML-Agents/Examples/Hallway/Prefabs/HallwayArea.prefab


m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_ClearFlags: 2
m_BackGroundColor: {r: 0.5043253, g: 0.5998091, b: 0.64705884, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 11400000, guid: 317f4f8da7e4846b3aae0969781824a2, type: 3}
m_Model: {fileID: 5022602860645237092, guid: 5e4f7c94351f346859ff7e00810f5d34, type: 3}
m_InferenceDevice: 2
m_BehaviorType: 0
m_BehaviorName: Hallway

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_ClearFlags: 2
m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_GateFitMode: 2
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_Component:
- component: {fileID: 4726744827719472}
m_Layer: 0
m_Name: SymbolFinderArea
m_Name: HallwayArea
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0

8
Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Agent.cs


using System;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Integrations.Match3;
namespace Unity.MLAgentsExamples
{

State m_CurrentState = State.WaitForMove;
float m_TimeUntilMove;
private int m_MovesMade;
private ModelOverrider m_ModelOverrider;
m_ModelOverrider = GetComponent<ModelOverrider>();
}
public override void OnEpisodeBegin()

private void FixedUpdate()
{
if (Academy.Instance.IsCommunicatorOn)
// Make a move every step if we're training, or we're overriding models in CI.
var useFast = Academy.Instance.IsCommunicatorOn || (m_ModelOverrider != null && m_ModelOverrider.HasOverrides);
if (useFast)
{
FastUpdate();
}

4
Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Drawer.cs


if (!m_Board)
{
m_Board = GetComponent<Match3Board>();
if (m_Board == null)
{
return;
}
}
var currentSize = m_Board.GetCurrentBoardSize();

1
Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3ExampleActuator.cs


using Unity.MLAgents;
using Unity.MLAgents.Integrations.Match3;
namespace Unity.MLAgentsExamples

1
Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3ExampleActuatorComponent.cs


public override IActuator[] CreateActuators()
{
var board = GetComponent<Match3Board>();
var agent = GetComponentInParent<Agent>();
var seed = RandomSeed == -1 ? gameObject.GetInstanceID() : RandomSeed + 1;
return new IActuator[] { new Match3ExampleActuator(board, ForceHeuristic, ActuatorName, seed) };
}

54
Project/Assets/ML-Agents/Examples/PushBlock/Prefabs/PushBlockCollabAreaGrid.prefab


m_Modification:
m_TransformParent: {fileID: 8188317207052398481}
m_Modifications:
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_RootReference
value:
objectReference: {fileID: 8190299122290044757}
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_AgentGameObject
value:
objectReference: {fileID: 8190299122290044757}
- target: {fileID: 2598450485826216109, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_Model

type: 3}
m_PrefabInstance: {fileID: 6067781793364901444}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 8190299122290044757}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d94a85eca2e074578943301959c555ba, type: 3}

type: 3}
m_PrefabInstance: {fileID: 6067781793364901444}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8190299122290044757 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2710286047221272849, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
m_PrefabInstance: {fileID: 6067781793364901444}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6565363751102736699
PrefabInstance:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_RootReference
value:
objectReference: {fileID: 9115291448867436586}
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_AgentGameObject
value:
objectReference: {fileID: 9115291448867436586}
- target: {fileID: 2598450485826216109, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_Model

type: 3}
m_PrefabInstance: {fileID: 6565363751102736699}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 9115291448867436586}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d94a85eca2e074578943301959c555ba, type: 3}

type: 3}
m_PrefabInstance: {fileID: 6565363751102736699}
m_PrefabAsset: {fileID: 0}
--- !u!1 &9115291448867436586 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2710286047221272849, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
m_PrefabInstance: {fileID: 6565363751102736699}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6716844123244810954
PrefabInstance:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_RootReference
value:
objectReference: {fileID: 8695281997955662811}
- target: {fileID: 1548337883655231979, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_AgentGameObject
value:
objectReference: {fileID: 8695281997955662811}
- target: {fileID: 2598450485826216109, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
propertyPath: m_Model

type: 3}
m_PrefabInstance: {fileID: 6716844123244810954}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_GameObject: {fileID: 8695281997955662811}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d94a85eca2e074578943301959c555ba, type: 3}

type: 3}
m_PrefabInstance: {fileID: 6716844123244810954}
m_PrefabAsset: {fileID: 0}
--- !u!1 &8695281997955662811 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2710286047221272849, guid: ac01d0f42c5e1463e943632a60d99967,
type: 3}
m_PrefabInstance: {fileID: 6716844123244810954}
m_PrefabAsset: {fileID: 0}

5
Project/Assets/ML-Agents/Examples/PushBlock/Scenes/PushBlockCollab.unity


m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4704531522807670703, guid: f5bbed44a6ea747a687fbbb738eb1730,
type: 3}
propertyPath: m_ShowGizmos
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8188317207052398481, guid: f5bbed44a6ea747a687fbbb738eb1730,
type: 3}
propertyPath: m_RootOrder

2
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetectTrigger.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

2
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs


//Put this script on your blue cube.
using System.Collections;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;

4
Project/Assets/ML-Agents/Examples/PushBlockWithInput/Scripts/PushBlockWithInputAgentBasic.cs


//Put this script on your blue cube.
using System;
using System.Collections;
using UnityEngine;
using Unity.MLAgents;

/// <summary>
/// The area bounds.
/// </summary'PushAgentBasic'>
/// </summary>
[HideInInspector]
public Bounds areaBounds;

2
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs


using UnityEngine;
using Random = UnityEngine.Random;
using Unity.MLAgents;
using UnityEngine.Events;
namespace Unity.MLAgentsExamples

12
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ModelOverrider.cs


// The attached Agent
Agent m_Agent;
// Whether or not the commandline args have already been processed.
// Used to make sure that HasOverrides doesn't spam the logs if it's called multiple times.
private bool m_HaveProcessedCommandLine;
string m_BehaviorNameOverrideDirectory;
private List<string> m_OverrideExtensions = new List<string>();

/// <summary>
/// Get the asset path to use from the commandline arguments.
/// Can be called multiple times - if m_HaveProcessedCommandLine is set, will have no effect.
if (m_HaveProcessedCommandLine)
{
return;
}
var maxEpisodes = 0;
var timeoutSeconds = 0;

{
m_Deadline = DateTime.Now + TimeSpan.FromSeconds(timeoutSeconds);
Debug.Log($"setting deadline to {timeoutSeconds} from now.");
}
}
m_HaveProcessedCommandLine = true;
}
void OnEnable()

8
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/SoccerFieldTwos.prefab


agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 0
position: 2
agentRb: {fileID: 0}

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 1
position: 2
agentRb: {fileID: 0}

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 0
position: 2
agentRb: {fileID: 0}

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 1
position: 2
agentRb: {fileID: 0}

6
Project/Assets/ML-Agents/Examples/Soccer/Prefabs/StrikersVsGoalieField.prefab


agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 0
position: 1
agentRb: {fileID: 0}

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 1
position: 0
agentRb: {fileID: 0}

agentParameters:
maxStep: 0
hasUpgradedFromAgentParameters: 1
MaxStep: 3000
MaxStep: 0
team: 1
position: 0
agentRb: {fileID: 0}

3
Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs


using System.Collections;
using System.Collections.Generic;
using Unity.MLAgents;
using UnityEngine;

var randomPosX = Random.Range(-2.5f, 2.5f);
var randomPosZ = Random.Range(-2.5f, 2.5f);
ball.transform.position = m_BallStartingPos + new Vector3(randomPosX, 0f, randomPosZ); ;
ball.transform.position = m_BallStartingPos + new Vector3(randomPosX, 0f, randomPosZ);
ballRb.velocity = Vector3.zero;
ballRb.angularVelocity = Vector3.zero;

4
Project/Assets/ML-Agents/Examples/Sorter/Scripts/NumberTile.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberTile : MonoBehaviour

public Material SuccessMaterial;
private bool m_Visited = false;
private bool m_Visited;
private MeshRenderer m_Renderer;
public bool IsVisited

2
Project/Assets/ML-Agents/Examples/Sorter/Scripts/SorterAgent.cs


// Here, the observation for the tile is added to the BufferSensor
m_BufferSensor.AppendObservation(listObservation);
};
}
}

3
Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs


Vector3 GetAvgVelocity()
{
Vector3 velSum = Vector3.zero;
Vector3 avgVel = Vector3.zero;
//ALL RBS
int numOfRb = 0;

velSum += item.rb.velocity;
}
avgVel = velSum / numOfRb;
var avgVel = velSum / numOfRb;
return avgVel;
}

1
Project/Assets/ML-Agents/Examples/Worm/Scripts/WormAgent.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.Barracuda;
using Unity.MLAgents.Actuators;
using Unity.MLAgentsExamples;
using Unity.MLAgents.Sensors;

4
Project/Packages/packages-lock.json


{
"dependencies": {
"com.unity.barracuda": {
"version": "1.3.3-preview",
"version": "1.4.0-preview",
"depth": 1,
"source": "registry",
"dependencies": {

"depth": 0,
"source": "local",
"dependencies": {
"com.unity.barracuda": "1.3.3-preview",
"com.unity.barracuda": "1.4.0-preview",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}

12
README.md


# Unity ML-Agents Toolkit
[![docs badge](https://img.shields.io/badge/docs-reference-blue.svg)](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/)
[![docs badge](https://img.shields.io/badge/docs-reference-blue.svg)](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/)
[![license badge](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE)

## Releases & Documentation
**Our latest, stable release is `Release 16`. Click
[here](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Readme.md)
**Our latest, stable release is `Release 17`. Click
[here](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/Readme.md)
to get started with the latest release of ML-Agents.**
The table below lists all our releases, including our `main` branch which is

| **Version** | **Release Date** | **Source** | **Documentation** | **Download** | **Python Package** | **Unity Package** |
|:-------:|:------:|:-------------:|:-------:|:------------:|:------------:|:------------:|
| **main (unstable)** | -- | [source](https://github.com/Unity-Technologies/ml-agents/tree/main) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/main/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/main.zip) | -- | -- |
| **Release 16** | **April 13, 2021** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/release_16)** | **[docs](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Readme.md)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/release_16.zip)** | **[0.25.1](https://pypi.org/project/mlagents/0.25.1/)** | **[1.9.1](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.9/manual/index.html)** |
| **Release 17** | **April 22, 2021** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/release_17)** | **[docs](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/Readme.md)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/release_17.zip)** | **[0.26.0](https://pypi.org/project/mlagents/0.26.0/)** | **[2.0.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@2.0/manual/index.html)** |
| **Release 16** | April 13, 2021 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_16) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_16.zip) | [0.25.1](https://pypi.org/project/mlagents/0.25.1/) | [1.9.1](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.9/manual/index.html) |
| **Release 15** | March 17, 2021 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_15) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_15_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_15.zip) | [0.25.0](https://pypi.org/project/mlagents/0.25.0/) | [1.9.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.9/manual/index.html) |
| **Verified Package 1.0.7** | **March 8, 2021** | **[source](https://github.com/Unity-Technologies/ml-agents/tree/com.unity.ml-agents_1.0.7)** | **[docs](https://github.com/Unity-Technologies/ml-agents/blob/release_2_verified_docs/docs/Readme.md)** | **[download](https://github.com/Unity-Technologies/ml-agents/archive/com.unity.ml-agents_1.0.7.zip)** | **[0.16.1](https://pypi.org/project/mlagents/0.16.1/)** | **[1.0.7](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/manual/index.html)** |
| **Release 14** | March 5, 2021 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_14) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_14_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_14.zip) | [0.24.1](https://pypi.org/project/mlagents/0.24.1/) | [1.8.1](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.8/manual/index.html) |

| **Release 10** | November 18, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/release_10) | [docs](https://github.com/Unity-Technologies/ml-agents/tree/release_10_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/release_10.zip) | [0.22.0](https://pypi.org/project/mlagents/0.22.0/) | [1.6.0](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.6/manual/index.html) |
| **Verified Package 1.0.6** | November 16, 2020 | [source](https://github.com/Unity-Technologies/ml-agents/tree/com.unity.ml-agents_1.0.6) | [docs](https://github.com/Unity-Technologies/ml-agents/blob/release_2_verified_docs/docs/Readme.md) | [download](https://github.com/Unity-Technologies/ml-agents/archive/com.unity.ml-agents_1.0.6.zip) | [0.16.1](https://pypi.org/project/mlagents/0.16.1/) | [1.0.6](https://docs.unity3d.com/Packages/com.unity.ml-agents@1.0/manual/index.html) |
If you are a researcher interested in a discussion of Unity as an AI platform,
see a pre-print of our

13
com.unity.ml-agents.extensions/Documentation~/com.unity.ml-agents.extensions.md


The Runtime directory currently contains these features:
* Physics-based sensors
* [Input System Package Integration](InputActuatorComponent.md)
* [Custom Grid-based Sensors](CustomGridSensors.md)
## Installation
The ML-Agents Extensions package is not currently available in the Package Manager. There are two

[Clone the repository](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Installation.md#clone-the-ml-agents-toolkit-repository-optional) and follow the
[Local Installation for Development](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Installation.md#advanced-local-installation-for-development-1)
[Clone the repository](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/Installation.md#clone-the-ml-agents-toolkit-repository-optional) and follow the
[Local Installation for Development](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/Installation.md#advanced-local-installation-for-development-1)
![Package Manager git URL](https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/images/unity_package_manager_git_url.png)
![Package Manager git URL](https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/images/unity_package_manager_git_url.png)
git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents.extensions#release_16
git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents.extensions#release_17
"com.unity.ml-agents.extensions": "git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents.extensions#release_16",
"com.unity.ml-agents.extensions": "git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents.extensions#release_17",
```
See [Git dependencies](https://docs.unity3d.com/Manual/upm-git.html#subfolder) for more information. Note that this
may take several minutes to resolve the packages the first time that you add it.

- No way to customize the action space of the `InputActuatorComponent`
## Need Help?
The main [README](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/README.md) contains links for contacting the team or getting support.
The main [README](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/README.md) contains links for contacting the team or getting support.

1
com.unity.ml-agents.extensions/Runtime/Input/Adaptors/ButtonInputActionAdaptor.cs


#if MLA_INPUT_SYSTEM
using Unity.MLAgents.Actuators;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.LowLevel;

2
com.unity.ml-agents.extensions/Runtime/Input/Adaptors/Vector2InputActionAdaptor.cs


#if MLA_INPUT_SYSTEM
using System;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.LowLevel;
namespace Unity.MLAgents.Extensions.Input

1
com.unity.ml-agents.extensions/Runtime/Input/IRLActionInputAdaptor.cs


#if MLA_INPUT_SYSTEM
using System;
using Unity.MLAgents.Actuators;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.LowLevel;

1
com.unity.ml-agents.extensions/Runtime/Input/InputActionActuator.cs


using Unity.MLAgents.Actuators;
using Unity.MLAgents.Policies;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Profiling;

2
com.unity.ml-agents.extensions/Tests/Runtime/Input/Adaptors/IntegerInputActionAdaptorTests.cs


#if MLA_INPUT_TESTS
using System;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Unity.MLAgents.Extensions.Tests.Runtime.Input

2
com.unity.ml-agents.extensions/Tests/Runtime/Sensors/CountingGridSensorTests.cs


gridSensor.Update();
subarrayIndicies = new int[] { 77, 78, 87, 88 };
subarrayIndicies = new[] { 77, 78, 87, 88 };
expectedSubarrays = DuplicateArray(new float[] { 2, 0 }, 4);
expectedDefault = new float[] { 0, 0 };
AssertSubarraysAtIndex(gridSensor.PerceptionBuffer, subarrayIndicies, expectedSubarrays, expectedDefault);

1
com.unity.ml-agents.extensions/Tests/Runtime/Sensors/RigidBodySensorTests.cs


using System.Runtime.CompilerServices;
using UnityEngine;
using NUnit.Framework;
using Unity.MLAgents.Sensors;

2
com.unity.ml-agents.extensions/package.json


{
"name": "com.unity.ml-agents.extensions",
"displayName": "ML Agents Extensions",
"version": "0.3.1-preview",
"version": "0.4.0-preview",
"unity": "2019.4",
"description": "A source-only package for new features based on ML-Agents",
"dependencies": {

24
com.unity.ml-agents/CHANGELOG.md


## [Unreleased]
### Major Changes
### Minor Changes
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)
#### ml-agents / ml-agents-envs / gym-unity (Python)
### Bug Fixes
## [2.0.0-exp.1] - 2021-04-22
### Major Changes
[Migration Guide](https://github.com/Unity-Technologies/ml-agents/blob/release_14_docs/docs/Migrating.md) for more
[Migration Guide](https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Migrating.md) for more
details.
- Some methods previously marked as `Obsolete` have been removed. If you were using these methods, you need to replace them with their supported counterpart.
- The interface for disabling discrete actions in `IDiscreteActionMask` has changed.

sizes and will need to be retrained. (#5181)
- The `AbstractBoard` class for integration with Match-3 games was changed to make it easier to support boards with
different sizes using the same model. For a summary of the interface changes, please see the Migration Guide. (##5189)
- Updated the Barracuda package to version `1.3.3-preview`(#5236)
- Updated the Barracuda package to version `1.4.0-preview`(#5236)
- Models trained with 1.x versions of ML-Agents will no longer work at inference if they were trained using recurrent neural networks (#5254)
### Minor Changes
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)

#### ml-agents / ml-agents-envs / gym-unity (Python)
- Some console output have been moved from `info` to `debug` and will not be printed by default. If you want all messages to be printed, you can run `mlagents-learn` with the `--debug` option or add the line `debug: true` at the top of the yaml config file. (#5211)
- When using a configuration YAML, it is required to define all behaviors found in a Unity
executable in the trainer configuration YAML, or specify `default_settings`. (#5210)
- The embedding size of attention layers used when a BufferSensor is in the scene has been changed. It is now fixed to 128 units. It might be impossible to resume training from a checkpoint of a previous version. (#5272)
### Bug Fixes
#### com.unity.ml-agents / com.unity.ml-agents.extensions (C#)

- Removed additional memory allocations that were occurring due to assert messages and iterating of DemonstrationRecorders. (#5246)
- Fixed a bug where agent trying to access unintialized fields when creating a new RayPerceptionSensorComponent on an agent. (#5261)
- Fixed a bug where the DemonstrationRecorder would throw a null reference exception if Num Steps To Record was > 0 and Record was turned off. (#5274)
#### ml-agents / ml-agents-envs / gym-unity (Python)
- Fixed a bug where --results-dir has no effect. (#5269)
- Fixed a bug where old `.pt` checkpoints were not deleted during training. (#5271)
- The `UnityToGymWrapper` initializer now accepts an optional `action_space_seed` seed. If this is specified, it will
be used to set the random seed on the resulting action space. (#5303)
## [1.9.1-preview] - 2021-04-13
### Major Changes

14
com.unity.ml-agents/Documentation~/com.unity.ml-agents.md


In Unity 2019.4 or later, open the Package Manager, hit the "+" button, and select "Add package from git URL".
![Package Manager git URL](https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/images/unity_package_manager_git_url.png)
![Package Manager git URL](https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/images/unity_package_manager_git_url.png)
git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents#release_16
git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents#release_17
"com.unity.ml-agents": "git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents#release_16",
"com.unity.ml-agents": "git+https://github.com/Unity-Technologies/ml-agents.git?path=com.unity.ml-agents#release_17",
```
See [Git dependencies](https://docs.unity3d.com/Manual/upm-git.html#subfolder) for more information. Note that this
may take several minutes to resolve the packages the first time that you add it.

[Clone the repository](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Installation.md#clone-the-ml-agents-toolkit-repository-optional) and follow the
[Local Installation for Development](https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/Installation.md#advanced-local-installation-for-development-1)
[Clone the repository](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/Installation.md#clone-the-ml-agents-toolkit-repository-optional) and follow the
[Local Installation for Development](https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/Installation.md#advanced-local-installation-for-development-1)
directions.
## Requirements

[unity ML-Agents Toolkit]: https://github.com/Unity-Technologies/ml-agents
[unity inference engine]: https://docs.unity3d.com/Packages/com.unity.barracuda@latest/index.html
[package manager documentation]: https://docs.unity3d.com/Manual/upm-ui-install.html
[installation instructions]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Installation.md
[installation instructions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Installation.md
[ML-Agents GitHub repo]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/com.unity.ml-agents.extensions
[ML-Agents GitHub repo]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/com.unity.ml-agents.extensions

2
com.unity.ml-agents/Editor/BufferSensorComponentEditor.cs


namespace Unity.MLAgents.Editor
{
[CustomEditor(typeof(BufferSensorComponent))]
[CustomEditor(typeof(BufferSensorComponent), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class BufferSensorComponentEditor : UnityEditor.Editor
{

2
com.unity.ml-agents/Editor/CameraSensorComponentEditor.cs


namespace Unity.MLAgents.Editor
{
[CustomEditor(typeof(CameraSensorComponent))]
[CustomEditor(typeof(CameraSensorComponent), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class CameraSensorComponentEditor : UnityEditor.Editor
{

2
com.unity.ml-agents/Editor/DemonstrationDrawer.cs


using System.Text;
using UnityEditor;
using Unity.MLAgents.Demonstrations;
using Unity.MLAgents.Policies;
namespace Unity.MLAgents.Editor
{

3
com.unity.ml-agents/Editor/GridSensorComponentEditor.cs


namespace Unity.MLAgents.Editor
{
[CustomEditor(typeof(GridSensorComponent))]
[CustomEditor(typeof(GridSensorComponent), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class GridSensorComponentEditor : UnityEditor.Editor
{

gridSize.vector3IntValue = new Vector3Int(newGridSize.x, 1, newGridSize.z);
}
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_AgentGameObject)), true);
EditorGUILayout.PropertyField(so.FindProperty(nameof(GridSensorComponent.m_RotateWithAgent)), true);
EditorGUI.BeginDisabledGroup(!EditorUtilities.CanUpdateModelProperties());

4
com.unity.ml-agents/Editor/RayPerceptionSensorComponentBaseEditor.cs


}
}
[CustomEditor(typeof(RayPerceptionSensorComponent2D))]
[CustomEditor(typeof(RayPerceptionSensorComponent2D), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class RayPerceptionSensorComponent2DEditor : RayPerceptionSensorComponentBaseEditor
{

}
}
[CustomEditor(typeof(RayPerceptionSensorComponent3D))]
[CustomEditor(typeof(RayPerceptionSensorComponent3D), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class RayPerceptionSensorComponent3DEditor : RayPerceptionSensorComponentBaseEditor
{

2
com.unity.ml-agents/Editor/RenderTextureSensorComponentEditor.cs


using Unity.MLAgents.Sensors;
namespace Unity.MLAgents.Editor
{
[CustomEditor(typeof(RenderTextureSensorComponent))]
[CustomEditor(typeof(RenderTextureSensorComponent), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class RenderTextureSensorComponentEditor : UnityEditor.Editor
{

2
com.unity.ml-agents/Editor/VectorSensorComponentEditor.cs


namespace Unity.MLAgents.Editor
{
[CustomEditor(typeof(VectorSensorComponent))]
[CustomEditor(typeof(VectorSensorComponent), editorForChildClasses: true)]
[CanEditMultipleObjects]
internal class VectorSensorComponentEditor : UnityEditor.Editor
{

4
com.unity.ml-agents/Runtime/Academy.cs


* API. For more information on each of these entities, in addition to how to
* set-up a learning environment and train the behavior of characters in a
* Unity scene, please browse our documentation pages on GitHub:
* https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/docs/
* https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/docs/
*/
namespace Unity.MLAgents

/// fall back to inference or heuristic decisions. (You can also set agents to always use
/// inference or heuristics.)
/// </remarks>
[HelpURL("https://github.com/Unity-Technologies/ml-agents/tree/release_16_docs/" +
[HelpURL("https://github.com/Unity-Technologies/ml-agents/tree/release_17_docs/" +
"docs/Learning-Environment-Design.md")]
public class Academy : IDisposable
{

1
com.unity.ml-agents/Runtime/Actuators/ActionSpec.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

1
com.unity.ml-agents/Runtime/Actuators/ActuatorComponent.cs


using System;
using UnityEngine;
namespace Unity.MLAgents.Actuators

2
com.unity.ml-agents/Runtime/Actuators/IActionReceiver.cs


///
/// See [Agents - Actions] for more information on masking actions.
///
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
/// </remarks>
/// <seealso cref="IActionReceiver.OnActionReceived"/>
void WriteDiscreteActionMask(IDiscreteActionMask actionMask);

4
com.unity.ml-agents/Runtime/Actuators/IDiscreteActionMask.cs


using System.Collections.Generic;
namespace Unity.MLAgents.Actuators
{
/// <summary>

///
/// See [Agents - Actions] for more information on masking actions.
///
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
/// </remarks>
/// <param name="branch">The branch for which the actions will be masked.</param>
/// <param name="actionIndex">Index of the action</param>

26
com.unity.ml-agents/Runtime/Agent.cs


/// [OnDisable()]: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnDisable.html]
/// [OnBeforeSerialize()]: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnBeforeSerialize.html
/// [OnAfterSerialize()]: https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnAfterSerialize.html
/// [Agents]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md
/// [Reinforcement Learning in Unity]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design.md
/// [Agents]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md
/// [Reinforcement Learning in Unity]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design.md
/// [Unity ML-Agents Toolkit manual]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Readme.md
/// [Unity ML-Agents Toolkit manual]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Readme.md
[HelpURL("https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/" +
[HelpURL("https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/" +
"docs/Learning-Environment-Design-Agents.md")]
[Serializable]
[RequireComponent(typeof(BehaviorParameters))]

/// for information about mixing reward signals from curiosity and Generative Adversarial
/// Imitation Learning (GAIL) with rewards supplied through this method.
///
/// [Agents - Rewards]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#rewards
/// [Reward Signals]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/ML-Agents-Overview.md#a-quick-note-on-reward-signals
/// [Agents - Rewards]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#rewards
/// [Reward Signals]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/ML-Agents-Overview.md#a-quick-note-on-reward-signals
/// </remarks>
/// <param name="reward">The new value of the reward.</param>
public void SetReward(float reward)

/// for information about mixing reward signals from curiosity and Generative Adversarial
/// Imitation Learning (GAIL) with rewards supplied through this method.
///
/// [Agents - Rewards]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#rewards
/// [Reward Signals]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/ML-Agents-Overview.md#a-quick-note-on-reward-signals
/// [Agents - Rewards]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#rewards
/// [Reward Signals]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/ML-Agents-Overview.md#a-quick-note-on-reward-signals
///</remarks>
/// <param name="increment">Incremental reward value.</param>
public void AddReward(float increment)

/// implementing a simple heuristic function can aid in debugging agent actions and interactions
/// with its environment.
///
/// [Demonstration Recorder]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#recording-demonstrations
/// [Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [Demonstration Recorder]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#recording-demonstrations
/// [Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [GameObject]: https://docs.unity3d.com/Manual/GameObjects.html
/// </remarks>
/// <example>

/// For more information about observations, see [Observations and Sensors].
///
/// [GameObject]: https://docs.unity3d.com/Manual/GameObjects.html
/// [Observations and Sensors]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#observations-and-sensors
/// [Observations and Sensors]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#observations-and-sensors
/// </remarks>
public virtual void CollectObservations(VectorSensor sensor)
{

///
/// See [Agents - Actions] for more information on masking actions.
///
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
/// </remarks>
/// <seealso cref="IActionReceiver.OnActionReceived"/>
public virtual void WriteDiscreteActionMask(IDiscreteActionMask actionMask) { }

///
/// For more information about implementing agent actions see [Agents - Actions].
///
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs/Learning-Environment-Design-Agents.md#actions
/// [Agents - Actions]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs/Learning-Environment-Design-Agents.md#actions
/// </remarks>
/// <param name="actions">
/// Struct containing the buffers of actions to be executed at this step.

2
com.unity.ml-agents/Runtime/Analytics/InferenceAnalytics.cs


/// <summary>
/// Whether or not we've registered this particular event yet
/// </summary>
static bool s_EventRegistered = false;
static bool s_EventRegistered;
/// <summary>
/// Hourly limit for this event name

2
com.unity.ml-agents/Runtime/Analytics/TrainingAnalytics.cs


/// <summary>
/// Whether or not we've registered this particular event yet
/// </summary>
static bool s_EventsRegistered = false;
static bool s_EventsRegistered;
/// <summary>
/// Behaviors that we've already sent events for.

6
com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs


/// <summary>
/// Static flag to make sure that we only fire the warning once.
/// </summary>
private static bool s_HaveWarnedTrainerCapabilitiesAgentGroup = false;
private static bool s_HaveWarnedTrainerCapabilitiesAgentGroup;
/// <summary>
/// Converts a AgentInfo to a protobuf generated AgentInfoActionPairProto

/// <summary>
/// Static flag to make sure that we only fire the warning once.
/// </summary>
private static bool s_HaveWarnedTrainerCapabilitiesMultiPng = false;
private static bool s_HaveWarnedTrainerCapabilitiesMapping = false;
private static bool s_HaveWarnedTrainerCapabilitiesMultiPng;
private static bool s_HaveWarnedTrainerCapabilitiesMapping;
/// <summary>
/// Generate an ObservationProto for the sensor using the provided ObservationWriter.

2
com.unity.ml-agents/Runtime/DecisionRequester.cs


///
/// The DecisionRequester component provides a convenient and flexible way to
/// trigger the agent decision making process. Without a DecisionRequester,
/// your <see cref="Agent"/> implmentation must manually call its
/// your <see cref="Agent"/> implementation must manually call its
/// <seealso cref="Agent.RequestDecision"/> function.
/// </remarks>
[AddComponentMenu("ML Agents/Decision Requester", (int)MenuGroup.Default)]

9
com.unity.ml-agents/Runtime/Demonstrations/DemonstrationRecorder.cs


/// See [Imitation Learning - Recording Demonstrations] for more information.
///
/// [GameObject]: https://docs.unity3d.com/Manual/GameObjects.html
/// [Imitation Learning - Recording Demonstrations]: https://github.com/Unity-Technologies/ml-agents/blob/release_16_docs/docs//Learning-Environment-Design-Agents.md#recording-demonstrations
/// [Imitation Learning - Recording Demonstrations]: https://github.com/Unity-Technologies/ml-agents/blob/release_17_docs/docs//Learning-Environment-Design-Agents.md#recording-demonstrations
/// </remarks>
[RequireComponent(typeof(Agent))]
[AddComponentMenu("ML Agents/Demonstration Recorder", (int)MenuGroup.Default)]

void Update()
{
if (Record)
if (!Record)
LazyInitialize();
return;
LazyInitialize();
// Quit when num steps to record is reached
if (NumStepsToRecord > 0 && m_DemoWriter.NumSteps >= NumStepsToRecord)
{
Application.Quit(0);

44
com.unity.ml-agents/Runtime/Inference/ApplierImpl.cs


}
}
}
internal class BarracudaMemoryOutputApplier : TensorApplier.IApplier
{
readonly int m_MemoriesCount;
readonly int m_MemoryIndex;
Dictionary<int, List<float>> m_Memories;
public BarracudaMemoryOutputApplier(
int memoriesCount,
int memoryIndex,
Dictionary<int, List<float>> memories)
{
m_MemoriesCount = memoriesCount;
m_MemoryIndex = memoryIndex;
m_Memories = memories;
}
public void Apply(TensorProxy tensorProxy, IList<int> actionIds, Dictionary<int, ActionBuffers> lastActions)
{
var agentIndex = 0;
var memorySize = (int)tensorProxy.shape[tensorProxy.shape.Length - 1];
for (var i = 0; i < actionIds.Count; i++)
{
var agentId = actionIds[i];
List<float> memory;
if (!m_Memories.TryGetValue(agentId, out memory)
|| memory.Count < memorySize * m_MemoriesCount)
{
memory = new List<float>();
memory.AddRange(Enumerable.Repeat(0f, memorySize * m_MemoriesCount));
}
for (var j = 0; j < memorySize; j++)
{
memory[memorySize * m_MemoryIndex + j] = tensorProxy.data[agentIndex, j];
}
m_Memories[agentId] = memory;
agentIndex++;
}
}
}
}

30
com.unity.ml-agents/Runtime/Inference/BarracudaModelExtensions.cs


});
}
var modelVersion = model.GetVersion();
if (modelVersion < (int)BarracudaModelParamLoader.ModelApiVersion.MLAgents2_0)
{
foreach (var mem in model.memories)
{
tensors.Add(new TensorProxy
{
name = mem.input,
valueType = TensorProxy.TensorType.FloatingPoint,
data = null,
shape = TensorUtils.TensorShapeFromBarracuda(mem.shape)
});
}
}
tensors.Sort((el1, el2) => string.Compare(el1.name, el2.name, StringComparison.InvariantCulture));
return tensors;

var memory = (int)model.GetTensorByName(TensorNames.MemorySize)[0];
if (memory > 0)
{
if (modelVersion < (int)BarracudaModelParamLoader.ModelApiVersion.MLAgents2_0)
{
foreach (var mem in model.memories)
{
names.Add(mem.output);
}
}
else
{
names.Add(TensorNames.RecurrentOutput);
}
names.Add(TensorNames.RecurrentOutput);
}
names.Sort(StringComparer.InvariantCulture);

}
else
{
return model.outputs.Contains(TensorNames.DiscreteActionOutput) &&
(int)model.DiscreteOutputSize() > 0;
return model.outputs.Contains(TensorNames.DiscreteActionOutput) && model.DiscreteOutputSize() > 0;
}
}

86
com.unity.ml-agents/Runtime/Inference/BarracudaModelParamLoader.cs


}
/// <summary>
/// Checks that a model has the appropriate version.
/// </summary>
/// <param name="model">
/// The Barracuda engine model for loading static parameters
/// </param>
/// <returns>A FailedCheck containing the error message if the version of the model does not mach, else null</returns>
public static FailedCheck CheckModelVersion(Model model)
{
var modelApiVersion = model.GetVersion();
if (modelApiVersion < (int)ModelApiVersion.MinSupportedVersion)
{
return FailedCheck.Error(
"Model was trained with a older version of the trainer than is supported. " +
"Either retrain with an newer trainer, or use an older version of com.unity.ml-agents.\n" +
$"Model version: {modelApiVersion} Minimum supported version: {(int)ModelApiVersion.MinSupportedVersion}"
);
}
if (modelApiVersion > (int)ModelApiVersion.MaxSupportedVersion)
{
return FailedCheck.Error(
"Model was trained with a newer version of the trainer than is supported. " +
"Either retrain with an older trainer, or update to a newer version of com.unity.ml-agents.\n" +
$"Model version: {modelApiVersion} Maximum supported version: {(int)ModelApiVersion.MaxSupportedVersion}"
);
}
var memorySize = (int)model.GetTensorByName(TensorNames.MemorySize)[0];
if (modelApiVersion == (int)ModelApiVersion.MLAgents1_0 && memorySize > 0)
{
// This block is to make sure that models that are trained with MLAgents version 1.x and have
// an LSTM (i.e. use the barracuda _c and _h inputs and outputs) will not work with MLAgents version
// 2.x. This is because Barracuda version 2.x will eventually drop support for the _c and _h inputs
// and only ML-Agents 2.x models will be compatible.
return FailedCheck.Error(
"Models from com.unity.ml-agents 1.x that use recurrent neural networks are not supported in newer versions. " +
"Either retrain with an newer trainer, or use an older version of com.unity.ml-agents.\n"
);
}
return null;
}
/// <summary>
/// Factory for the ModelParamLoader : Creates a ModelParamLoader and runs the checks
/// on it.
/// </summary>

}
var modelApiVersion = model.GetVersion();
if (modelApiVersion < (int)ModelApiVersion.MinSupportedVersion || modelApiVersion > (int)ModelApiVersion.MaxSupportedVersion)
var versionCheck = CheckModelVersion(model);
if (versionCheck != null)
failedModelChecks.Add(
FailedCheck.Warning($"Version of the trainer the model was trained with ({modelApiVersion}) " +
$"is not compatible with the current range of supported versions: " +
$"({(int)ModelApiVersion.MinSupportedVersion} to {(int)ModelApiVersion.MaxSupportedVersion}).")
);
return failedModelChecks;
failedModelChecks.Add(versionCheck);
}
var memorySize = (int)model.GetTensorByName(TensorNames.MemorySize)[0];

if (memory > 0)
{
var modelVersion = model.GetVersion();
var netHasMemories = false;
if (modelVersion < (int)BarracudaModelParamLoader.ModelApiVersion.MLAgents2_0)
{
netHasMemories = tensorsNames.Any(x => x.EndsWith("_h")) &&
tensorsNames.Any(x => x.EndsWith("_c"));
}
else
{
netHasMemories = tensorsNames.Any(x => x == TensorNames.RecurrentInPlaceholder);
}
if (!netHasMemories)
if (!tensorsNames.Any(x => x == TensorNames.RecurrentInPlaceholder))
{
failedModelChecks.Add(
FailedCheck.Warning("The model does not contain a Recurrent Input Node but has memory_size.")

// If there is no Recurrent Output but the model is Recurrent.
if (memory > 0)
{
var netHasMemories = false;
var modelVersion = model.GetVersion();
if (modelVersion < (int)BarracudaModelParamLoader.ModelApiVersion.MLAgents2_0)
{
var memOutputs = model.memories.Select(x => x.output).ToList();
netHasMemories = memOutputs.Any(x => x.EndsWith("_h")) &&
memOutputs.Any(x => x.EndsWith("_c"));
}
else
{
var allOutputs = model.GetOutputNames().ToList();
netHasMemories = allOutputs.Any(x => x == TensorNames.RecurrentOutput);
}
if (!netHasMemories)
var allOutputs = model.GetOutputNames().ToList();
if (!allOutputs.Any(x => x == TensorNames.RecurrentOutput))
{
failedModelChecks.Add(
FailedCheck.Warning("The model does not contain a Recurrent Output Node but has memory_size.")

58
com.unity.ml-agents/Runtime/Inference/GeneratorImpl.cs


using System.Collections.Generic;
using System;
using UnityEngine;
using Unity.Barracuda;
using Unity.MLAgents.Inference.Utils;
using Unity.MLAgents.Sensors;

break;
}
tensorProxy.data[agentIndex, 0, j, 0] = memory[j];
}
agentIndex++;
}
}
}
internal class BarracudaRecurrentInputGenerator : TensorGenerator.IGenerator
{
int m_MemoriesCount;
readonly int m_MemoryIndex;
readonly ITensorAllocator m_Allocator;
Dictionary<int, List<float>> m_Memories;
public BarracudaRecurrentInputGenerator(
int memoryIndex,
ITensorAllocator allocator,
Dictionary<int, List<float>> memories)
{
m_MemoryIndex = memoryIndex;
m_Allocator = allocator;
m_Memories = memories;
}
public void Generate(TensorProxy tensorProxy, int batchSize, IList<AgentInfoSensorsPair> infos)
{
TensorUtils.ResizeTensor(tensorProxy, batchSize, m_Allocator);
var memorySize = (int)tensorProxy.shape[tensorProxy.shape.Length - 1];
var agentIndex = 0;
for (var infoIndex = 0; infoIndex < infos.Count; infoIndex++)
{
var infoSensorPair = infos[infoIndex];
var info = infoSensorPair.agentInfo;
var offset = memorySize * m_MemoryIndex;
List<float> memory;
if (info.done)
{
m_Memories.Remove(info.episodeId);
}
if (!m_Memories.TryGetValue(info.episodeId, out memory))
{
for (var j = 0; j < memorySize; j++)
{
tensorProxy.data[agentIndex, j] = 0;
}
agentIndex++;
continue;
}
for (var j = 0; j < memorySize; j++)
{
if (j >= memory.Count)
{
break;
}
tensorProxy.data[agentIndex, j] = memory[j + offset];
}
agentIndex++;
}

13
com.unity.ml-agents/Runtime/Inference/ModelRunner.cs


using System;
using System.Collections.Generic;
using Unity.Barracuda;
using UnityEngine.Profiling;

D.logEnabled = m_Verbose;
barracudaModel = ModelLoader.Load(model);
var failedCheck = BarracudaModelParamLoader.CheckModelVersion(
barracudaModel
);
if (failedCheck != null)
{
if (failedCheck.CheckType == BarracudaModelParamLoader.FailedCheck.CheckTypeEnum.Error)
{
throw new UnityAgentsException(failedCheck.Message);
}
}
WorkerFactory.Type executionDevice;
switch (inferenceDevice)
{

9
com.unity.ml-agents/Runtime/Inference/TensorApplier.cs


}
}
m_Dict[TensorNames.RecurrentOutput] = new MemoryOutputApplier(memories);
if (modelVersion < (int)BarracudaModelParamLoader.ModelApiVersion.MLAgents2_0)
{
for (var i = 0; i < model?.memories.Count; i++)
{
m_Dict[model.memories[i].output] =
new BarracudaMemoryOutputApplier(model.memories.Count, i, memories);
}
}
}
/// <summary>

9
com.unity.ml-agents/Runtime/Inference/TensorGenerator.cs


m_Dict[TensorNames.RecurrentInPlaceholder] =
new RecurrentInputGenerator(allocator, memories);
if (m_ApiVersion < (int)BarracudaModelParamLoader.ModelApiVersion.MLAgents2_0)
{
for (var i = 0; i < model.memories.Count; i++)
{
m_Dict[model.memories[i].input] =
new BarracudaRecurrentInputGenerator(i, allocator, memories);
}
}
m_Dict[TensorNames.PreviousActionPlaceholder] =
new PreviousActionInputGenerator(allocator);
m_Dict[TensorNames.ActionMaskPlaceholder] =

12
com.unity.ml-agents/Runtime/InplaceArray.cs


{
m_Length = 1;
m_Elem0 = elem0;
m_Elem1 = new T { };
m_Elem2 = new T { };
m_Elem3 = new T { };
m_Elem1 = new T();
m_Elem2 = new T();
m_Elem3 = new T();
}
/// <summary>

m_Length = 2;
m_Elem0 = elem0;
m_Elem1 = elem1;
m_Elem2 = new T { };
m_Elem3 = new T { };
m_Elem2 = new T();
m_Elem3 = new T();
}
/// <summary>

m_Elem0 = elem0;
m_Elem1 = elem1;
m_Elem2 = elem2;
m_Elem3 = new T { };
m_Elem3 = new T();
}
/// <summary>

42
com.unity.ml-agents/Runtime/Integrations/Match3/Match3ActuatorComponent.cs


using System;
using Unity.MLAgents.Actuators;
using UnityEngine;
using UnityEngine.Serialization;

[AddComponentMenu("ML Agents/Match 3 Actuator", (int)MenuGroup.Actuators)]
public class Match3ActuatorComponent : ActuatorComponent
{
[HideInInspector, SerializeField, FormerlySerializedAs("ActuatorName")]
string m_ActuatorName = "Match3 Actuator";
public string ActuatorName = "Match3 Actuator";
public string ActuatorName
{
get => m_ActuatorName;
set => m_ActuatorName = value;
}
[HideInInspector, SerializeField, FormerlySerializedAs("RandomSeed")]
int m_RandomSeed = -1;
/// A random seed used to generate a board, if needed.
/// A random seed used in the actuator's heuristic, if needed.
public int RandomSeed = -1;
public int RandomSeed
{
get => m_RandomSeed;
set => m_RandomSeed = value;
}
[HideInInspector, SerializeField, FormerlySerializedAs("ForceHeuristic")]
[Tooltip("Force using the Agent's Heuristic() method to decide the action. This should only be used in testing.")]
bool m_ForceHeuristic;
[FormerlySerializedAs("ForceRandom")]
[Tooltip("Force using the Agent's Heuristic() method to decide the action. This should only be used in testing.")]
public bool ForceHeuristic;
public bool ForceHeuristic
{
get => m_ForceHeuristic;
set => m_ForceHeuristic = value;
}
var seed = RandomSeed == -1 ? gameObject.GetInstanceID() : RandomSeed + 1;
return new IActuator[] { new Match3Actuator(board, ForceHeuristic, seed, ActuatorName) };
if (!board)
{
return Array.Empty<IActuator>();
}
var seed = m_RandomSeed == -1 ? gameObject.GetInstanceID() : m_RandomSeed + 1;
return new IActuator[] { new Match3Actuator(board, m_ForceHeuristic, seed, m_ActuatorName) };
}
/// <inheritdoc/>

27
com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs


using System;
using Unity.MLAgents.Sensors;
using UnityEngine;
using UnityEngine.Serialization;
namespace Unity.MLAgents.Integrations.Match3
{

[AddComponentMenu("ML Agents/Match 3 Sensor", (int)MenuGroup.Sensors)]
public class Match3SensorComponent : SensorComponent, IDisposable
{
[HideInInspector, SerializeField, FormerlySerializedAs("SensorName")]
string m_SensorName = "Match3 Sensor";
public string SensorName = "Match3 Sensor";
public string SensorName
{
get => m_SensorName;
set => m_SensorName = value;
}
[HideInInspector, SerializeField, FormerlySerializedAs("ObservationType")]
Match3ObservationType m_ObservationType = Match3ObservationType.Vector;
public Match3ObservationType ObservationType = Match3ObservationType.Vector;
public Match3ObservationType ObservationType
{
get => m_ObservationType;
set => m_ObservationType = value;
}
private ISensor[] m_Sensors;

Dispose();
var board = GetComponent<AbstractBoard>();
var cellSensor = Match3Sensor.CellTypeSensor(board, ObservationType, SensorName + " (cells)");
if (!board)
{
return Array.Empty<ISensor>();
}
var cellSensor = Match3Sensor.CellTypeSensor(board, m_ObservationType, m_SensorName + " (cells)");
var specialSensor = Match3Sensor.SpecialTypeSensor(board, ObservationType, SensorName + " (special)");
var specialSensor = Match3Sensor.SpecialTypeSensor(board, m_ObservationType, m_SensorName + " (special)");
m_Sensors = specialSensor != null
? new ISensor[] { cellSensor, specialSensor }
: new ISensor[] { cellSensor };

2
com.unity.ml-agents/Runtime/Integrations/Match3/Move.cs


if (moveIndex < 0 || moveIndex >= NumPotentialMoves(maxBoardSize))
{
throw new ArgumentOutOfRangeException("Invalid move index.");
throw new ArgumentOutOfRangeException("moveIndex");
}
Direction dir;
int row, col;

3
com.unity.ml-agents/Runtime/MLAgentsSettingsManager.cs


using System;
using System.Linq;
#else
using System.Linq;
#endif
namespace Unity.MLAgents

2
com.unity.ml-agents/Runtime/MultiAgentGroupIdCounter.cs


static int s_Counter;
public static int GetGroupId()
{
return Interlocked.Increment(ref s_Counter); ;
return Interlocked.Increment(ref s_Counter);
}
}
}

1
com.unity.ml-agents/Runtime/Policies/HeuristicPolicy.cs


NullList m_NullList = new NullList();
/// <inheritdoc />
public HeuristicPolicy(ActuatorManager actuatorManager, ActionSpec actionSpec)
{
m_ActuatorManager = actuatorManager;

1
com.unity.ml-agents/Runtime/Policies/RemotePolicy.cs


/// </summary>
private IList<IActuator> m_Actuators;
/// <inheritdoc />
public RemotePolicy(
ActionSpec actionSpec,
IList<IActuator> actuators,

23
com.unity.ml-agents/Runtime/Sensors/BoxOverlapChecker.cs


Vector3Int m_GridSize;
bool m_RotateWithAgent;
LayerMask m_ColliderMask;
GameObject m_RootReference;
GameObject m_CenterObject;
GameObject m_AgentGameObject;
string[] m_DetectableTags;
int m_InitialColliderBufferSize;
int m_MaxColliderBufferSize;

Vector3Int gridSize,
bool rotateWithAgent,
LayerMask colliderMask,
GameObject rootReference,
GameObject centerObject,
GameObject agentGameObject,
string[] detectableTags,
int initialColliderBufferSize,
int maxColliderBufferSize)

m_RotateWithAgent = rotateWithAgent;
m_ColliderMask = colliderMask;
m_RootReference = rootReference;
m_CenterObject = centerObject;
m_AgentGameObject = agentGameObject;
m_DetectableTags = detectableTags;
m_InitialColliderBufferSize = initialColliderBufferSize;
m_MaxColliderBufferSize = maxColliderBufferSize;

/// <summary>Converts the index of the cell to the 3D point (y is zero) relative to grid center</summary>
/// <returns>Vector3 of the position of the center of the cell relative to grid center</returns>
/// <param name="cell">The index of the cell</param>
/// <param name="cellIndex">The index of the cell</param>
Vector3 GetCellLocalPosition(int cellIndex)
{
float x = (cellIndex / m_GridSize.z - m_CellCenterOffset.x) * m_CellScale.x;

{
if (m_RotateWithAgent)
{
return m_RootReference.transform.TransformPoint(m_CellLocalPositions[cellIndex]);
return m_CenterObject.transform.TransformPoint(m_CellLocalPositions[cellIndex]);
return m_CellLocalPositions[cellIndex] + m_RootReference.transform.position;
return m_CellLocalPositions[cellIndex] + m_CenterObject.transform.position;
return m_RotateWithAgent ? m_RootReference.transform.rotation : Quaternion.identity;
return m_RotateWithAgent ? m_CenterObject.transform.rotation : Quaternion.identity;
}
/// <summary>

var currentColliderGo = foundColliders[i].gameObject;
// Continue if the current collider go is the root reference
if (ReferenceEquals(currentColliderGo, m_RootReference))
if (ReferenceEquals(currentColliderGo, m_AgentGameObject))
var currentDistanceSquared = (closestColliderPoint - m_RootReference.transform.position).sqrMagnitude;
var currentDistanceSquared = (closestColliderPoint - m_CenterObject.transform.position).sqrMagnitude;
if (currentDistanceSquared >= minDistanceSquared)
{

for (int i = 0; i < numFound; i++)
{
var currentColliderGo = foundColliders[i].gameObject;
if (!ReferenceEquals(currentColliderGo, m_RootReference))
if (!ReferenceEquals(currentColliderGo, m_AgentGameObject))
{
detectedAction.Invoke(currentColliderGo, cellIndex);
}

17
com.unity.ml-agents/Runtime/Sensors/GridSensorComponent.cs


namespace Unity.MLAgents.Sensors
{
/// <summary>
/// A SensorComponent that creates a <see cref="GridSensor"/>.
/// A SensorComponent that creates a <see cref="GridSensorBase"/>.
/// </summary>
[AddComponentMenu("ML Agents/Grid Sensor", (int)MenuGroup.Sensors)]
public class GridSensorComponent : SensorComponent

{
get { return m_RotateWithAgent; }
set { m_RotateWithAgent = value; }
}
[HideInInspector, SerializeField]
internal GameObject m_AgentGameObject;
/// <summary>
/// The reference of the root of the agent. This is used to disambiguate objects with
/// the same tag as the agent. Defaults to current GameObject.
/// </summary>
public GameObject AgentGameObject
{
get { return (m_AgentGameObject == null ? gameObject : m_AgentGameObject); }
set { m_AgentGameObject = value; }
}
[HideInInspector, SerializeField]

/// <inheritdoc/>
public override ISensor[] CreateSensors()
{
List<ISensor> m_Sensors = new List<ISensor>();
m_Sensors = new List<ISensor>();
m_BoxOverlapChecker = new BoxOverlapChecker(
m_CellScale,
m_GridSize,

AgentGameObject,
m_DetectableTags,
m_InitialColliderBufferSize,
m_MaxColliderBufferSize

3
com.unity.ml-agents/Runtime/Sensors/ISensor.cs


using System;
using System.Collections.Generic;
using System.Linq;
namespace Unity.MLAgents.Sensors
{

[System.Flags]
[Flags]
public enum DimensionProperty
{
/// <summary>

2
com.unity.ml-agents/Runtime/Sensors/ObservationSpec.cs


using Unity.Barracuda;
namespace Unity.MLAgents.Sensors
{
/// <summary>

3
com.unity.ml-agents/Runtime/Sensors/RenderTextureSensor.cs


/// <param name="texture2D">Texture2D to render to.</param>
public static void ObservationToTexture(RenderTexture obsTexture, Texture2D texture2D)
{
var height = obsTexture.height;
var width = obsTexture.width;
var prevActiveRt = RenderTexture.active;
RenderTexture.active = obsTexture;

1
com.unity.ml-agents/Runtime/Sensors/SensorComponent.cs


using UnityEngine;
using System;
namespace Unity.MLAgents.Sensors
{

1
com.unity.ml-agents/Runtime/Sensors/StackingSensor.cs


using System;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine;
using Unity.Barracuda;

1
com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;

1
com.unity.ml-agents/Runtime/Sensors/VectorSensorComponent.cs


using UnityEngine;
using UnityEngine.Serialization;
namespace Unity.MLAgents.Sensors
{

1
com.unity.ml-agents/Runtime/SideChannels/TrainingAnalyticsSideChannel.cs


using System;
using UnityEngine;
using Unity.MLAgents.Analytics;
using Unity.MLAgents.CommunicatorObjects;

2
com.unity.ml-agents/Runtime/SimpleMultiAgentGroup.cs


/// </returns>
public IReadOnlyCollection<Agent> GetRegisteredAgents()
{
return (IReadOnlyCollection<Agent>)m_Agents;
return m_Agents;
}
/// <summary>

2
com.unity.ml-agents/Tests/Editor/AcademyTests.cs


using NUnit.Framework;
using Unity.MLAgents.Sensors;
using UnityEngine;
using System.Reflection;
using Unity.MLAgents;
namespace Unity.MLAgents.Tests
{

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

正在加载...
取消
保存