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().
Inherited Members
Namespace: Unity.MLAgents.Integrations.Match3
Assembly: Unity.ML-Agents.dll
Syntax
public class Match3Actuator : IActuator, IActionReceiver, IHeuristicProvider
Constructors
Match3Actuator(AbstractBoard, bool, int, string)
Create a Match3Actuator.
Declaration
public Match3Actuator(AbstractBoard board, bool forceHeuristic, int seed, string name)
Parameters
Type | Name | Description |
---|---|---|
Abstract |
board | Board |
bool | 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. |
int | seed | The seed used to initialize Random. |
string | name | Name |
Properties
ActionSpec
The specification of the actions for this IActuator.
Declaration
public ActionSpec ActionSpec { get; }
Property Value
Type | Description |
---|---|
Action |
See Also
Name
Gets the name of this IActuator which will be used to sort it.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string | The string name of this |
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 |
---|---|
int | The number of points the move generates. |
GetBuiltInActuatorType()
Return the corresponding BuiltInActuatorType for the actuator.
Declaration
public BuiltInActuatorType GetBuiltInActuatorType()
Returns
Type | Description |
---|---|
Built |
A BuiltInActuatorType corresponding to the actuator. |
Heuristic(in ActionBuffers)
Method called on objects which are expected to fill out the Action
Declaration
public void Heuristic(in ActionBuffers actionsOut)
Parameters
Type | Name | Description |
---|---|---|
Action |
actionsOut |
OnActionReceived(ActionBuffers)
Method called in order too allow object to execute actions based on the
Action
Declaration
public void OnActionReceived(ActionBuffers actions)
Parameters
Type | Name | Description |
---|---|---|
Action |
actions |
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()
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 |
---|---|---|
IDiscrete |
actionMask | The action mask for the agent. |
Remarks
When using Discrete Control, you can prevent the Agent from using a certain
action by masking it with Set
See Agents - Actions for more information on masking actions.