Door#

class curiosity_gym.core.objects.Door(position: tuple[int, int], color: int = 0, state: int = 0)#

Grid object with walkability depending on its state.

A closed door cannot be walked or seen through. Doors can be opened by the agent through interaction. State 2 represents a locked door, that can only be opened if the agent has collected a Key object of the same color.

Can be used in combination with Key objects to introduce additional reward sparcity to an environment, as more precice actions are required for the agent to get the reward.

Methods

get_identity

Return a tuple that identifies the grid object and its state in the enviroment.

interact

Interact with the door.

is_harmful

Determine whether grid object is harmful to the agent.

is_walkable

Return the walkability of a door, as determined by its state.

render

Render grid object in PyGame.

reset

Reset attributes of the grid object to their starting values.

simulate

Simulate how grid object would change if a given action were taken.

step

Compute grid object changes after single timestep.

Attributes

id_map

Dictionary for all ids and their corresponding subclasses.

identifier

Unique id number for each subclass.