docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class OneHotGridSensor

    Grid-based sensor with one-hot observations.

    Inheritance
    object
    GridSensorBase
    OneHotGridSensor
    Implements
    ISensor
    IDisposable
    Inherited Members
    GridSensorBase.CompressionType
    GridSensorBase.DetectableTags
    GridSensorBase.Reset()
    GridSensorBase.ResetPerceptionBuffer()
    GridSensorBase.GetName()
    GridSensorBase.GetCompressionSpec()
    GridSensorBase.GetBuiltInSensorType()
    GridSensorBase.GetCompressedObservation()
    GridSensorBase.Update()
    GridSensorBase.GetObservationSpec()
    GridSensorBase.Write(ObservationWriter)
    GridSensorBase.Dispose()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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.

    Extension Methods

    SensorExtensions.ObservationSize(ISensor)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023