Class OneHotGridSensor
Grid-based sensor with one-hot observations.
Inherited Members
Namespace: Unity.MLAgents.Sensors
Assembly: solution.dll
Syntax
public class OneHotGridSensor : GridSensorBase, ISensor, IDisposable
Constructors
| Name | Description |
|---|---|
| OneHotGridSensor(string, Vector3, Vector3Int, string[], SensorCompressionType) | Create a OneHotGridSensor with the specified configuration. |
Methods
| Name | Description |
|---|---|
| GetCellObservationSize() | Get the observation size for each cell. This will be the size of dataBuffer for GetObjectData(GameObject, int, float[]). If overriding GetObjectData(GameObject, int, float[]), override this method as well to the custom observation size. |
| GetObjectData(GameObject, int, float[]) | Get the one-hot representation of the detected game object's tag. |
| GetProcessCollidersMethod() | Whether to process all detected colliders in a cell. Default to false and only use the one closest to the agent. If overriding GetObjectData(GameObject, int, float[]), consider override this method when needed. |
| IsDataNormalized() | Whether the data is normalized within [0, 1]. The sensor can only use PNG compression if the data is normailzed. If overriding GetObjectData(GameObject, int, float[]), override this method as well according to the custom observation values. |