Skip to content

Commit

Permalink
Updates for package validation errors. (Unity-Technologies#5671)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelalonsojr committed Jan 17, 2022
1 parent 2868461 commit ff0171d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
4 changes: 2 additions & 2 deletions DevProject/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"com.unity.inputsystem": "1.3.0",
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
"com.unity.package-manager-doctools": "1.7.0-preview",
"com.unity.package-validation-suite": "0.19.0-preview",
"com.unity.package-manager-doctools": "1.10.0-preview",
"com.unity.package-validation-suite": "0.23.4-preview",
"com.unity.test-framework": "1.1.24",
"com.unity.test-framework.performance": "2.2.0-preview",
"com.unity.testtools.codecoverage": "1.0.0-pre.3",
Expand Down
18 changes: 13 additions & 5 deletions DevProject/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"depth": 0,
"source": "local",
"dependencies": {
"com.unity.ml-agents": "2.1.0-exp.1",
"com.unity.ml-agents": "2.2.0",
"com.unity.modules.physics": "1.0.0"
}
},
Expand All @@ -88,17 +88,18 @@
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.package-manager-doctools": {
"version": "1.7.0-preview",
"version": "1.10.0-preview",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.package-validation-suite": "0.10.0-preview",
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
"com.unity.package-validation-suite": "0.19.2-preview",
"com.unity.nuget.newtonsoft-json": "2.0.0-preview",
"com.unity.sharp-zip-lib": "1.2.2-preview"
},
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.package-validation-suite": {
"version": "0.19.0-preview",
"version": "0.23.4-preview",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -113,6 +114,13 @@
"dependencies": {},
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.sharp-zip-lib": {
"version": "1.2.2-preview",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates"
},
"com.unity.test-framework": {
"version": "1.1.24",
"depth": 0,
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2017-2021 Unity Technologies
com.unity.ml-agents copyright © 2017 Unity Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 3 additions & 1 deletion com.unity.ml-agents/Runtime/Academy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,11 @@ public int InferenceSeed
set { m_InferenceSeed = value; }
}

// Number of training areas to instantiate
int m_NumAreas;

/// <summary>
/// Number of training areas to instantiate.
/// </summary>
public int NumAreas => m_NumAreas;

/// <summary>
Expand Down
27 changes: 26 additions & 1 deletion com.unity.ml-agents/Runtime/Areas/TrainingAreaReplicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,39 @@ namespace Unity.MLAgents.Areas
/// </summary>
public class TrainingAreaReplicator : MonoBehaviour
{
/// <summary>
/// The base training area to be replicated.
/// </summary>
public GameObject baseArea;

/// <summary>
/// The number of training areas to replicate.
/// </summary>
public int numAreas = 1;

/// <summary>
/// The separation between each training area.
/// </summary>
public float separation = 10f;

int3 m_GridSize = new int3(1, 1, 1);
int m_areaCount = 0;
string m_TrainingAreaName;

/// <summary>
/// The size of the computed grid to pack the training areas into.
/// </summary>
public int3 GridSize => m_GridSize;

/// <summary>
/// The name of the training area.
/// </summary>
public string TrainingAreaName => m_TrainingAreaName;

/// <summary>
/// Called before the simulation begins to computed the grid size for distributing
/// the replicated training areas and set the area name.
/// </summary>
public void Awake()
{
// Computes the Grid Size on Awake
Expand All @@ -28,6 +50,10 @@ public void Awake()
m_TrainingAreaName = baseArea.name;
}

/// <summary>
/// Called after Awake and before the simulation begins and adds the training areas before
/// the Academy begins.
/// </summary>
public void OnEnable()
{
// Adds the training are replicas during OnEnable to ensure they are added before the Academy begins its work.
Expand Down Expand Up @@ -85,4 +111,3 @@ void AddEnvironments()
}
}
}

0 comments on commit ff0171d

Please sign in to comment.