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

    SetActionEnabled(Int32, Int32, Boolean)

    Set whether or not the action index for the given branch is allowed.

    Declaration
    void SetActionEnabled(int branch, int actionIndex, bool isEnabled)
    Parameters
    Type Name Description
    Int32 branch

    The branch for which the actions will be masked.

    Int32 actionIndex

    Index of the action.

    Boolean isEnabled

    Whether the action is allowed or not.

    Remarks

    By default, all discrete actions are allowed. If isEnabled is false, the agent will not be able to perform the actions passed as argument at the next decision for the specified action branch. The actionIndex corresponds to the action options the agent will be unable to perform.

    See Agents - Actions for more information on masking actions.

    Back to top Copyright © 2021 Unity Technologies
    Generated by DocFX
    on Monday, November 8, 2021
    Terms of use