docs.unity3d.com
    Show / Hide Table of Contents

    Class Match3Actuator

    Actuator for a Match3 game. It translates valid moves (defined by AbstractBoard.IsMoveValid()) in action masks, and applies the action to the board via AbstractBoard.MakeMove().

    Inheritance
    Object
    Match3Actuator
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.MLAgents.Integrations.Match3
    Syntax
    public class Match3Actuator : IActuator, IActionReceiver, IHeuristicProvider, IBuiltInActuator

    Constructors

    Match3Actuator(AbstractBoard, Boolean, Int32, String)

    Create a Match3Actuator.

    Declaration
    public Match3Actuator(AbstractBoard board, bool forceHeuristic, int seed, string name)
    Parameters
    Type Name Description
    AbstractBoard board
    Boolean forceHeuristic

    Whether the inference action should be ignored and the Agent's Heuristic should be called. This should only be used for generating comparison stats of the Heuristic.

    Int32 seed

    The seed used to initialize Random.

    String name

    Properties

    ActionSpec

    The specification of the actions for this IActuator.

    Declaration
    public ActionSpec ActionSpec { get; }
    Property Value
    Type Description
    ActionSpec
    Implements
    IActuator.ActionSpec
    See Also
    ActionSpec

    Name

    Gets the name of this IActuator which will be used to sort it.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String
    Implements
    IActuator.Name

    Methods

    EvalMovePoints(Move)

    Method to be overridden when evaluating how many points a specific move will generate.

    Declaration
    protected virtual int EvalMovePoints(Move move)
    Parameters
    Type Name Description
    Move move

    The move to evaluate.

    Returns
    Type Description
    Int32

    The number of points the move generates.

    GetBuiltInActuatorType()

    Declaration
    public BuiltInActuatorType GetBuiltInActuatorType()
    Returns
    Type Description
    BuiltInActuatorType

    Heuristic(in ActionBuffers)

    Method called on objects which are expected to fill out the ActionBuffers data structure. Object that implement this interface should be careful to be consistent in the placement of their actions in the ActionBuffers data structure.

    Declaration
    public void Heuristic(in ActionBuffers actionsOut)
    Parameters
    Type Name Description
    ActionBuffers actionsOut
    Implements
    IHeuristicProvider.Heuristic(in ActionBuffers)

    OnActionReceived(ActionBuffers)

    Method called in order too allow object to execute actions based on the ActionBuffers contents. The structure of the contents in the ActionBuffers are defined by the ActionSpec.

    Declaration
    public void OnActionReceived(ActionBuffers actions)
    Parameters
    Type Name Description
    ActionBuffers actions
    Implements
    IActionReceiver.OnActionReceived(ActionBuffers)

    ResetData()

    Resets the internal state of the actuator. This is called at the end of an Agent's episode. Most implementations can leave this empty.

    Declaration
    public void ResetData()
    Implements
    IActuator.ResetData()

    WriteDiscreteActionMask(IDiscreteActionMask)

    Implement WriteDiscreteActionMask() to modify the masks for discrete actions. When using discrete actions, the agent will not perform the masked action.

    Declaration
    public void WriteDiscreteActionMask(IDiscreteActionMask actionMask)
    Parameters
    Type Name Description
    IDiscreteActionMask actionMask

    The action mask for the agent.

    Implements
    IActionReceiver.WriteDiscreteActionMask(IDiscreteActionMask)
    Remarks

    When using Discrete Control, you can prevent the Agent from using a certain action by masking it with SetActionEnabled(Int32, Int32, Boolean).

    See Agents - Actions for more information on masking actions.

    See Also
    OnActionReceived(ActionBuffers)

    Extension Methods

    IActuatorExtensions.TotalNumberOfActions(IActuator)
    Back to top
    Terms of use
    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