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().
Namespace: Unity.MLAgents.Integrations.Match3
Syntax
public class Match3Actuator : object, 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 |
String | name |
Properties
ActionSpec
The specification of the actions for this IActuator.
Declaration
public ActionSpec ActionSpec { get; }
Property Value
Type | Description |
---|---|
ActionSpec |
Implements
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 |
Implements
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(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
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
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
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
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.