Enemy#

class curiosity_gym.core.objects.Enemy(position: tuple[int, int], state: int = 0, reach: int = 2)#

Moving grid object harmful to the agent.

Can be used to introduce additional reward sparcity by early episode termination.

Parameters:
  • position (tuple[int,int]) – Position in the grid where the object will be placed. Values must be in range (width - 1, height - 1).

  • state (int) – State of the enemy grid object. Determines current movement direction.

  • reach (int) – Number of cells the enemy can move from its starting position.

Methods

get_identity

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

interact

Interact with agent.

is_harmful

The enemy grid object is always harmful to the agent.

is_walkable

The enemy grid object is always walkable.

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

Perform enemy movement.

Attributes

id_map

Dictionary for all ids and their corresponding subclasses.

identifier

Unique id number for each subclass.