docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Struct ActionSpec

    Defines the structure of the actions to be used by the Actuator system.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.MLAgents.Actuators
    Assembly: solution.dll
    Syntax
    [Serializable]
    public struct ActionSpec

    Constructors

    Name Description
    ActionSpec(int, int[])

    Create an ActionSpec initialized with the specified action sizes.

    Fields

    Name Description
    BranchSizes

    An array of branch sizes for discrete actions.

    For an IActuator that uses discrete actions, the number of branches is the Length of the Array and each index contains the branch size. The cumulative sum of the total number of discrete actions can be retrieved by the SumOfDiscreteBranchSizes property.

    For an IActuator with a Continuous it will be null.

    Properties

    Name Description
    NumContinuousActions

    The number of continuous actions that an Agent can take.

    NumDiscreteActions

    The number of branches for discrete actions that an Agent can take.

    SumOfDiscreteBranchSizes

    Get the total number of Discrete Actions that can be taken by calculating the Sum of all of the Discrete Action branch sizes.

    Methods

    Name Description
    Combine(params ActionSpec[])

    Combines a list of actions specs and allocates a new array of branch sizes if needed.

    MakeContinuous(int)

    Creates a Continuous ActionSpec with the number of actions available.

    MakeDiscrete(params int[])

    Creates a Discrete ActionSpec with the array of branch sizes that represents the action space.

    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