docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Struct ActionBuffers

    A structure that wraps the ActionSegment<T>s for a particular IActionReceiver and is used when OnActionReceived(ActionBuffers) is called.

    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.MLAgents.Actuators
    Assembly: solution.dll
    Syntax
    public readonly struct ActionBuffers

    Constructors

    Name Description
    ActionBuffers(float[], int[])

    Construct an ActionBuffers instance with the continuous and discrete actions that will be used. ///

    ActionBuffers(ActionSegment<float>, ActionSegment<int>)

    Construct an ActionBuffers instance with the continuous and discrete actions that will be used.

    ActionBuffers(ActionSpec)

    Construct an ActionBuffers instance with ActionSpec. All values are initialized to zeros. ///

    Fields

    Name Description
    Empty

    An empty action buffer.

    Properties

    Name Description
    ContinuousActions

    Holds the Continuous ActionSegment<T> to be used by an IActionReceiver.

    DiscreteActions

    Holds the Discrete ActionSegment<T> to be used by an IActionReceiver.

    Methods

    Name Description
    Clear()

    Clear the ContinuousActions and DiscreteActions segments to be all zeros.

    Equals(object)

    Indicates whether the current ActionBuffers is equal to another ActionBuffers.

    FromDiscreteActions(float[])

    Create an ActionBuffers instance with discrete actions stored as a float array. This exists to achieve backward compatibility with the former Agent methods which used a float array for both continuous and discrete actions.

    GetHashCode()

    Computes the hash code of the ActionBuffers.

    IsEmpty()

    Check if the ActionBuffers is empty.

    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