ethicalgardeners.observation.ObservationStrategy

class ethicalgardeners.observation.ObservationStrategy[source]

Bases: ABC

Abstract base class defining the interface for observation strategies.

Observation strategies determine how agents perceive the environment, defining the structure of the observation space and how observations are generated from the world state.

__init__()[source]

Create the observation strategy.

Methods

__init__()

Create the observation strategy.

get_observation(grid_world, agent)

Generate an observation for an agent based on the current world state.

observation_space(agent)

Define the observation space for a specific agent.

abstractmethod get_observation(grid_world, agent: Agent)[source]

Generate an observation for an agent based on the current world state.

Parameters:
  • grid_world (GridWorld) – The current state of the grid.

  • agent (Agent) – The agent for which to generate the observation.

Returns:

The observation for the specified agent.

Return type:

numpy.ndarray

abstractmethod observation_space(agent: Agent)[source]

Define the observation space for a specific agent.

Parameters:

agent (Agent) – The agent for which to define the observation space.

Returns:

The observation space for the specified agent.

Return type:

gym.Space