Skip to content

Step

step(state, action, agent_id=None)

Apply an action to the current state, returning the updated state.

If agent_id is not provided, the first agent in the state will be used.

Parameters:

Name Type Description Default
state State

The current state of the environment.

required
action Action

The action to be applied.

required
agent_id Optional[EntityID]

The ID of the agent performing the action. If None, the first agent in the state will be used.

None

Returns:

Name Type Description
State State

The updated state after applying the action.

Raises:

Type Description
ValueError

If no agent_id is provided and no agents exist in the state.