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

    Class DiscreteActionMasker

    The DiscreteActionMasker class represents a set of masked (disallowed) actions and provides utilities for setting and retrieving them.

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

    Agents that take discrete actions can explicitly indicate that specific actions are not allowed at a point in time. This enables the agent to indicate that some actions may be illegal. For example, if an agent is adjacent to a wall or other obstacle you could mask any actions that direct the agent to move into the blocked space.

    Methods

    SetMask(Int32, IEnumerable<Int32>)

    Modifies an action mask for discrete control agents.

    Declaration
    public void SetMask(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 © 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