Interface IDiscreteActionMask | ML Agents | 1.6.0-preview
docs.unity.cn
    Show / Hide Table of Contents

    Interface IDiscreteActionMask

    Interface for writing a mask to disable discrete actions for agents for the next decision.

    Namespace: Unity.MLAgents.Actuators
    Syntax
    public interface IDiscreteActionMask

    Methods

    GetMask()

    Get the current mask for an agent.

    Declaration
    bool[] GetMask()
    Returns
    Type Description
    Boolean[]

    A mask for the agent. A boolean array of length equal to the total number of actions.

    ResetMask()

    Resets the current mask for an agent.

    Declaration
    void ResetMask()

    WriteMask(Int32, IEnumerable<Int32>)

    Modifies an action mask for discrete control agents.

    Declaration
    void WriteMask(int branch, IEnumerable<int> actionIndices)
    Parameters
    Type Name Description
    Int32 branch

    The branch for which the actions will be masked.

    IEnumerable<Int32> actionIndices

    The indices of the masked actions.

    Remarks

    When used, the agent will not be able to perform the actions passed as argument at the next decision for the specified action branch. The actionIndices correspond to the action options the agent will be unable to perform.

    See Agents - Actions for more information on masking actions.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 20 November 2020