@@ -9,17 +9,39 @@ namespace Unity.MLAgents.Areas
9
9
/// </summary>
10
10
public class TrainingAreaReplicator : MonoBehaviour
11
11
{
12
+ /// <summary>
13
+ /// The base training area to be replicated.
14
+ /// </summary>
12
15
public GameObject baseArea ;
16
+
17
+ /// <summary>
18
+ /// The number of training areas to replicate.
19
+ /// </summary>
13
20
public int numAreas = 1 ;
21
+
22
+ /// <summary>
23
+ /// The separation between each training area.
24
+ /// </summary>
14
25
public float separation = 10f ;
15
26
16
27
int3 m_GridSize = new int3 ( 1 , 1 , 1 ) ;
17
28
int m_areaCount = 0 ;
18
29
string m_TrainingAreaName ;
19
30
31
+ /// <summary>
32
+ /// The size of the computed grid to pack the training areas into.
33
+ /// </summary>
20
34
public int3 GridSize => m_GridSize ;
35
+
36
+ /// <summary>
37
+ /// The name of the training area.
38
+ /// </summary>
21
39
public string TrainingAreaName => m_TrainingAreaName ;
22
40
41
+ /// <summary>
42
+ /// Called before the simulation begins to computed the grid size for distributing
43
+ /// the replicated training areas and set the area name.
44
+ /// </summary>
23
45
public void Awake ( )
24
46
{
25
47
// Computes the Grid Size on Awake
@@ -28,6 +50,10 @@ public void Awake()
28
50
m_TrainingAreaName = baseArea . name ;
29
51
}
30
52
53
+ /// <summary>
54
+ /// Called after Awake and before the simulation begins and adds the training areas before
55
+ /// the Academy begins.
56
+ /// </summary>
31
57
public void OnEnable ( )
32
58
{
33
59
// Adds the training are replicas during OnEnable to ensure they are added before the Academy begins its work.
@@ -85,4 +111,3 @@ void AddEnvironments()
85
111
}
86
112
}
87
113
}
88
-
0 commit comments