class ActionResult(result, succeeded)

Represents the generic (expected) result of an action.

This class functions as a simple wrapper around a boolean representing the success (True) or failure (False) of the (expected) mutation of an matrx.actions.action.Action, as well as the reason for it.

The matrx.actions.action.ActionResult class contains several generic reasons for a succeed or fail as constant class attributes.


A string representing the reason for the (expected) success or fail of an matrx.actions.action.Action.


A boolean representing the (expected) success or fail of an matrx.actions.action.Action.

See also


The super-class whose children return an ActionResult


Both the methods matrx.actions.Action.is_possible() and matrx.actions.Action.mutate() should return an matrx.actions.action.ActionResult. With the former it represents the expected success or failure of the matrx.actions.action.Action, with the latter the actual success or failure.

The matrx.actions.action.ActionResult class contain several reasons why an matrx.actions.action.Action may succeed or fail that are being checked by a matrx.grid_world.GridWorld instance. These are:

  • IDLE_ACTION: Always given when an AgentBrain decided upon returning None (the idle action)

  • AGENT_WAS_REMOVED: Always given when an agent does not exist anymore in the GridWorld.

  • AGENT_NOT_CAPABLE: Always given when the Action an AgentBrain decided upon is not an Action that agent should be capable of.

  • UNKNOWN_ACTION: Always given when the Action name an AgentBrain decided upon is not recognized as a class name of an Action or some class inheriting from Action. Could be caused by either that class not existing or because it is never imported anywhere (and hence is not on the path the GridWorld searches in).

When creating a new matrx.actions.action.Action class, you can also extend this class with your own. This allows you to set your own constants representing reasons for that matrx.actions.action.Action specific results. This allows an matrx.agents.agent_brain.AgentBrain to directly match the matrx.actions.ActionResult.result with a constant and potentially adjust its behavior.

__init__(self, result, succeeded)

Initialize self. See help(type(self)) for accurate signature.


__init__(self, result, succeeded)

Initialize self.



Result when the agent is not capable of performing that action.


Result when the action is not expected to succeed.


Result when the action name does not represent an Action class


Result when the action succeeded or is expected to succeed.


Result string for when the agent was removed before performing its action.



Deprecated: Use IDLE_ACTION instead.