matrx.actions.object_actions.GrabObject

class GrabObject(duration_in_ticks=0)

Grab and hold objects.

The action that can pick up / grab and hold an matrx.objects.env_object.EnvObject. Cannot be performed on agents (including the agent performing the action). After grabbing / picking up, the object is automatically added to the agent’s inventory and removed from the matrx.grid_world.GridWorld.

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<}

Notes

The actual carrying mechanism of objects is implemented in the matrx.actions.move_actions.Move actions: whenever an agent moves who holds objects, those objects it is holding are also moved with it.

Methods

is_possible(self, grid_world, agent_id, …)

Checks if the object can be grabbed.

mutate(self, grid_world, agent_id, \*\*kwargs)

Grabs an object.

__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 object can be grabbed.

mutate(self, grid_world, agent_id, \*\*kwargs)

Grabs an object.