Skip to content

Actions

The action system determines the next state of the environment given the current state and an action.

Complete action set for the environment. This set includes all the actions that can be taken by the agent, and does not mirror the Minigrid action set.

Default action set from Minigrid. See https://github.com/Farama-Foundation/Minigrid/blob/master/minigrid/core/actions.py

Steps the player backward without changing the direction.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the player moved backward.

A placeholder action that does nothing, but is a signal to the environment that the episode is over. This action does not terminate the episode, unless the termination function explicitly checks for it (not default).

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The same state.

Replaces the position in front of the player with the item in the pocket.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the item in the pocket dropped in front of the player.

Moves the player forward.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the player moved forward.

Steps the player to the left without changing the direction.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the player moved to the left.

No operation. Does nothing.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The same state.

Unlocks and opens an openable object (like a door) if possible.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the openable object opened.

Picks up an item in front of the player and puts it in the pocket. Args: state (State): The current state. Returns: State: The new state with the player entity having the item in the pocket.

Steps the player to the right without changing the direction.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the player moved to the right.

Rotates the player counter-clockwise.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the player rotated counter-clockwise.

Rotates the player clockwise.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the player rotated clockwise.

Toggles an openable object (like a door) if possible.

Parameters:

Name Type Description Default
state State

The current state.

required

Returns:

Name Type Description
State State

The new state with the openable object toggled.