From c78e1de632fd061bfeda8794e9313ca6a4000bff Mon Sep 17 00:00:00 2001 From: brccabral Date: Sun, 13 Dec 2020 13:00:40 -0800 Subject: [PATCH 1/2] set multiple obstacles from area added a parameter to GridArea to control how many obstacles will be created in the scene --- .../Examples/GridWorld/Scenes/GridWorld.unity | 18 +++++++++++------- .../Examples/GridWorld/Scripts/GridArea.cs | 3 ++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity b/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity index 93ee5931ca..8a9a91a673 100644 --- a/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity +++ b/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44971168, g: 0.4997775, b: 0.57563686, a: 1} + m_IndirectSpecularColor: {r: 0.44971228, g: 0.49977815, b: 0.57563734, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -296,7 +296,7 @@ MonoBehaviour: agentParameters: maxStep: 100 hasUpgradedFromAgentParameters: 1 - maxStep: 100 + MaxStep: 100 area: {fileID: 1795599557} timeBetweenDecisionsAtInference: 0.15 renderCamera: {fileID: 797520692} @@ -337,17 +337,19 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_BrainParameters: - vectorObservationSize: 0 - numStackedVectorObservations: 1 - vectorActionSize: 05000000 - vectorActionDescriptions: [] - vectorActionSpaceType: 0 + VectorObservationSize: 0 + NumStackedVectorObservations: 1 + VectorActionSize: 05000000 + VectorActionDescriptions: [] + VectorActionSpaceType: 0 m_Model: {fileID: 11400000, guid: a812f1ce7763a4a0c912717f3594fe20, type: 3} m_InferenceDevice: 0 m_BehaviorType: 0 m_BehaviorName: GridWorld TeamId: 0 m_UseChildSensors: 1 + m_UseChildActuators: 1 + m_ObservableAttributeHandling: 0 --- !u!114 &125487791 MonoBehaviour: m_ObjectHideFlags: 0 @@ -363,6 +365,7 @@ MonoBehaviour: m_RenderTexture: {fileID: 8400000, guid: 114608d5384404f89bff4b6f88432958, type: 2} m_SensorName: RenderTextureSensor m_Grayscale: 0 + m_ObservationStacks: 1 m_Compression: 1 --- !u!1 &260425459 GameObject: @@ -2072,6 +2075,7 @@ MonoBehaviour: trueAgent: {fileID: 125487785} goalPref: {fileID: 1508142483324970, guid: 1ec4e4e96e7514d45b7ebc3ba5a9a481, type: 3} pitPref: {fileID: 1811317785436014, guid: d13ee2db77b3a4dcc8664d2fe2a0f219, type: 3} + numberOfObstacles: 2 --- !u!4 &1795599558 Transform: m_ObjectHideFlags: 0 diff --git a/Project/Assets/ML-Agents/Examples/GridWorld/Scripts/GridArea.cs b/Project/Assets/ML-Agents/Examples/GridWorld/Scripts/GridArea.cs index 6567261773..bc7840a8af 100644 --- a/Project/Assets/ML-Agents/Examples/GridWorld/Scripts/GridArea.cs +++ b/Project/Assets/ML-Agents/Examples/GridWorld/Scripts/GridArea.cs @@ -18,6 +18,7 @@ public class GridArea : MonoBehaviour public GameObject goalPref; public GameObject pitPref; GameObject[] m_Objects; + public int numberOfObstacles = 1; GameObject m_Plane; GameObject m_Sn; @@ -54,7 +55,7 @@ void SetEnvironment() transform.position = m_InitialPosition * (m_ResetParams.GetWithDefault("gridSize", 5f) + 1); var playersList = new List(); - for (var i = 0; i < (int)m_ResetParams.GetWithDefault("numObstacles", 1); i++) + for (var i = 0; i < (int)m_ResetParams.GetWithDefault("numObstacles", numberOfObstacles); i++) { playersList.Add(1); } From 4590d32a8a9c33994cd01658857bb8d98356d5f6 Mon Sep 17 00:00:00 2001 From: brccabral Date: Tue, 15 Dec 2020 10:49:32 -0800 Subject: [PATCH 2/2] set number of obstacles to 1 in scene --- .../Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity b/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity index 8a9a91a673..5bf6716301 100644 --- a/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity +++ b/Project/Assets/ML-Agents/Examples/GridWorld/Scenes/GridWorld.unity @@ -2075,7 +2075,7 @@ MonoBehaviour: trueAgent: {fileID: 125487785} goalPref: {fileID: 1508142483324970, guid: 1ec4e4e96e7514d45b7ebc3ba5a9a481, type: 3} pitPref: {fileID: 1811317785436014, guid: d13ee2db77b3a4dcc8664d2fe2a0f219, type: 3} - numberOfObstacles: 2 + numberOfObstacles: 1 --- !u!4 &1795599558 Transform: m_ObjectHideFlags: 0