Skip to content

Grid Representation: Step

step(gridstate, action, agent_id=None)

Execute one step with the given action and return a new GridState.

Converts this GridState to an immutable State, applies the step function, and converts the result back to a mutable GridState.

Parameters:

Name Type Description Default
action Action

The action to execute

required
agent_id int | None

Optional agent entity ID. If None, uses the first agent found.

None

Returns:

Type Description
GridState

New GridState after executing the step