Class ObservationWriter | ML Agents | 1.1.0-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class ObservationWriter

    Allows sensors to write to both TensorProxy and float arrays/lists.

    Inheritance
    Object
    ObservationWriter
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.MLAgents.Sensors
    Syntax
    public class ObservationWriter

    Properties

    Item[Int32]

    1D write access at a specified index. Use AddRange if possible instead.

    Declaration
    public float this[int index] { set; }
    Parameters
    Type Name Description
    Int32 index

    Index to write to.

    Property Value
    Type Description
    Single

    Item[Int32, Int32, Int32]

    3D write access at the specified height, width, and channel.

    Declaration
    public float this[int h, int w, int ch] { set; }
    Parameters
    Type Name Description
    Int32 h
    Int32 w
    Int32 ch
    Property Value
    Type Description
    Single

    Methods

    Add(Quaternion, Int32)

    Write the Quaternion components.

    Declaration
    public void Add(Quaternion quat, int writeOffset = 0)
    Parameters
    Type Name Description
    Quaternion quat

    The Quaternion to be written.

    Int32 writeOffset

    Optional write offset.

    Add(Vector3, Int32)

    Write the Vector3 components.

    Declaration
    public void Add(Vector3 vec, int writeOffset = 0)
    Parameters
    Type Name Description
    Vector3 vec

    The Vector3 to be written.

    Int32 writeOffset

    Optional write offset.

    Add(Vector4, Int32)

    Write the Vector4 components.

    Declaration
    public void Add(Vector4 vec, int writeOffset = 0)
    Parameters
    Type Name Description
    Vector4 vec

    The Vector4 to be written.

    Int32 writeOffset

    Optional write offset.

    AddRange(IEnumerable<Single>, Int32)

    Write the range of floats

    Declaration
    public void AddRange(IEnumerable<float> data, int writeOffset = 0)
    Parameters
    Type Name Description
    IEnumerable<Single> data
    Int32 writeOffset

    Optional write offset.

    In This Article
    • Properties
      • Item[Int32]
      • Item[Int32, Int32, Int32]
    • Methods
      • Add(Quaternion, Int32)
      • Add(Vector3, Int32)
      • Add(Vector4, Int32)
      • AddRange(IEnumerable<Single>, Int32)
    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