Skip to content

Commit e8018e8

Browse files
authored
Merge pull request #2190 from gregnz/develop-rayperception-docs
Develop rayperception docs
2 parents a740162 + 0a37a43 commit e8018e8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RayPerception2D.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ public class RayPerception2D : RayPerception
1515

1616
/// <summary>
1717
/// Creates perception vector to be used as part of an observation of an agent.
18+
/// Each ray in the rayAngles array adds a sublist of data to the observation.
19+
/// The sublist contains the observation data for a single ray. The list is composed of the following:
20+
/// 1. A one-hot encoding for detectable objects. For example, if detectableObjects.Length = n, the
21+
/// first n elements of the sublist will be a one-hot encoding of the detectableObject that was hit, or
22+
/// all zeroes otherwise.
23+
/// 2. The 'length' element of the sublist will be 1 if the ray missed everything, or 0 if it hit
24+
/// something (detectable or not).
25+
/// 3. The 'length+1' element of the sublist will contain the normalised distance to the object hit.
26+
/// NOTE: Only objects with tags in the detectableObjects array will have a distance set.
1827
/// </summary>
1928
/// <returns>The partial vector observation corresponding to the set of rays</returns>
2029
/// <param name="rayDistance">Radius of rays</param>

UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RayPerception3D.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ public class RayPerception3D : RayPerception
1515

1616
/// <summary>
1717
/// Creates perception vector to be used as part of an observation of an agent.
18+
/// Each ray in the rayAngles array adds a sublist of data to the observation.
19+
/// The sublist contains the observation data for a single ray. The list is composed of the following:
20+
/// 1. A one-hot encoding for detectable objects. For example, if detectableObjects.Length = n, the
21+
/// first n elements of the sublist will be a one-hot encoding of the detectableObject that was hit, or
22+
/// all zeroes otherwise.
23+
/// 2. The 'length' element of the sublist will be 1 if the ray missed everything, or 0 if it hit
24+
/// something (detectable or not).
25+
/// 3. The 'length+1' element of the sublist will contain the normalised distance to the object hit.
26+
/// NOTE: Only objects with tags in the detectableObjects array will have a distance set.
1827
/// </summary>
1928
/// <returns>The partial vector observation corresponding to the set of rays</returns>
2029
/// <param name="rayDistance">Radius of rays</param>

0 commit comments

Comments
 (0)