world_helpers

Module world_helpers. Specifies various helpers so that we have more uniform interface when using the various environments.

world_helpers.n_actions(env: Env) int

Queries the env if it has n_actions attribute if yes it uses it to return the number of actions in the environment. Otherwise it uses env.action_space.n

Parameters

env (The environment to query) –

Return type

The number of actions in the environment

world_helpers.n_states(env: Env) int

Queries the env if it has n_states attribute if yes it uses it to return the number of states in the environment. Otherwise it uses env.observation_space.n

Parameters

env (The environment to query) –

Return type

The number of states in the environment

world_helpers.reset(env: Env) TimeStep

Reset the environment

Parameters

env (The environment to reset) –

Return type

An instance to TimeStep

world_helpers.step(env: Env, action: Action) TimeStep

Step in the environment using the given action

Parameters
  • env (The environment to step) –

  • action (The action to execute) –

Return type

An instance to TimeStep