matrx.actions.object_actions.DropObject¶
-
class
DropObject
(duration_in_ticks=0)¶ Drops a carried object.
The action that can drop an
matrx.objects.env_object.EnvObject
that is in an agent’s inventory. After dropping, the object is added to thematrx.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 thematrx.agents.agent_brain.AgentBrain.filter_observations()
method is called for that agent, and thematrx.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 theaction_kwargs
in thematrx.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 dropped.
mutate
(self, grid_world, agent_id, …)Drops the carried 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 dropped.
mutate
(self, grid_world, agent_id, …)Drops the carried object.