GridEngine#

class curiosity_gym.core.gridengine.GridEngine(env_settings: EnvironmentSettings, render_settings: RenderSettings, env_objects: EnvironmentObjects, agent_pov: AgentPOV | str)#

Abstract grid-based environment class that implements the gymnasium api.

Parameters:
  • env_settings (EnvironmentSettings) – Object storing settings for the environment.

  • render_settings (RenderSettings) – Object storing render settings that should be apllied when the environment is used.

  • env_objects (EnvironmentObjects) – Object storing all grid objects that were placed in the environment.

  • agent_pov (AgentPOV | str) – Object or string defining the observations and action spaces of the RL agent. Valid string values are ‘global’, ‘local_W’ and ‘forward_L_W’, where W and L are integers defining the width and length of the respective POV.

Methods

check_task

Check whether the main task of an environment has been completed by the agent.

close

Clean up the environment.

find_object

Get non-wall grid object at given position.

get_object_ids

Get ids for all grid object types.

get_state

Get the current state of the environment.

get_wrapper_attr

Gets the attribute name from the environment.

has_wrapper_attr

Checks if the attribute name exists in the environment.

heatmap

Display heatmap of position counts of the agent.

init_render

Initialise render objects.

load_walls

Convert array of positions to wall objects for environment.

render

Compute the render frames as specified by render_mode.

reset

Reset the environment to an initial internal state.

set_wrapper_attr

Sets the attribute name on the environment with value.

simulate

Simulate the state of the environment if a given action were taken.

step

Run one timestep of the environment’s dynamics using the agent actions.

Attributes

metadata

Metadata of the environment.

np_random

Returns the environment's internal _np_random that if not set will initialise with a random seed.

np_random_seed

Returns the environment's internal _np_random_seed that if not set will first initialise with a random int as seed.

render_mode

Render mode in which the environment is run.

spec

unwrapped

Returns the base non-wrapped environment.

reward_range

Range of rewards that can be obtained within one episode.

action_space

Space of possible actions a RL agent can choose from.

observation_space

Space of possible observations returned by the environment.