From f588f73e8d031c1612a093c877ae865502343a38 Mon Sep 17 00:00:00 2001 From: Henry Peteet Date: Wed, 16 Feb 2022 14:36:52 -0500 Subject: [PATCH] Update docs regarding the "range" field in AddOneHotObservation (#16) --- com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs | 2 +- docs/Learning-Environment-Design-Agents.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs b/com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs index 76c47419f..d4bd0507c 100644 --- a/com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs +++ b/com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs @@ -206,7 +206,7 @@ namespace Unity.MLAgents.Sensors /// Adds a one-hot encoding observation. /// /// The index of this observation. - /// The max index for any observation. + /// The upper limit on the value observation can take (exclusive). public void AddOneHotObservation(int observation, int range) { for (var i = 0; i < range; i++) diff --git a/docs/Learning-Environment-Design-Agents.md b/docs/Learning-Environment-Design-Agents.md index 51f3cbbae..d6bd89293 100644 --- a/docs/Learning-Environment-Design-Agents.md +++ b/docs/Learning-Environment-Design-Agents.md @@ -284,7 +284,7 @@ to the previous one. ```csharp enum ItemType { Sword, Shield, Bow, LastItem } -const int NUM_ITEM_TYPES = (int)ItemType.LastItem; +const int NUM_ITEM_TYPES = (int)ItemType.LastItem + 1; public override void CollectObservations(VectorSensor sensor) {