matrx.actions.action.Action

class Action(duration_in_ticks=0)

Contains the effects of an action on the world.

This class is empty and should be overridden if you want to make a new action that is not yet supported. You may also extend other actions, but all MATRX’ actions inherit from this class.

Parameters
duration_in_ticksint

Optional, default: 1. Should be zero or larger.

The default duration of this action in ticks during which the matrx.grid_world.GridWorld blocks the agent performing other actions. By default this is 1, meaning that all actions of this type will take both the tick in which it was decided upon and the subsequent tick. When the agent is blocked / busy with an action, only the matrx.agents.agent_brain.AgentBrain.filter_observations() method is called for that agent, and the matrx.agents.agent_brain.AgentBrain.decide_on_action() method is skipped. This means that agents that are busy with an action can only perceive the world but not decide on a new action untill the action has completed.

An agent can overwrite the duration of an action by returning the action_duration in the action_kwargs in the matrx.agents.agent_brain.AgentBrain.decide_on_action() method, as so: return >action_name<, {'action_duration': >ticks<}

Methods

is_possible(self, grid_world, agent_id, …)

Checks if the Action is possible.

mutate(self, grid_world, agent_id, …)

Method that mutates the world.

__init__(self, duration_in_ticks=0)

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

Methods

__init__(self[, duration_in_ticks])

Initialize self.

is_possible(self, grid_world, agent_id, …)

Checks if the Action is possible.

mutate(self, grid_world, agent_id, …)

Method that mutates the world.