ethicalgardeners.gridworldΒΆ

The gridworld module represents the physical environment simulation grid for Ethical Gardeners.

This module defines the fundamental structures of the simulated environment where agents (gardeners) interact with the world. The environment consists of:

1. A 2D grid of cells (Cell) - Each cell represents a physical location that can be of different types (CellType). The cells have a pollution level that evolves over time, depending on whether they contain flowers or not.

  1. Flowers (Flower) - Plants that agents can grow in ground cells:

  • Different types with unique growth patterns and properties

  • Progress through growth stages over time

  • Reduce pollution in their cell based on type and growth stage

  • Can be harvested for monetary value when fully grown

  • Return seeds when harvested that can be used to plant more flowers

3. Agents (Agent) - Gardeners that move through and interact with the environment:

  • Can move between cells

  • Plant flowers using seeds from their inventory

  • Harvest fully grown flowers for monetary value

The GridWorld provides methods to initialize the environment (from file, randomly, or programmatically), place and manage agents and flowers, update environmental conditions, and validate agent actions.

members:

Classes

Cell(cell_type[, pollution, pollution_increment])

Represents a single cell in the grid world.

CellType(*values)

Enum representing the possible types of cells in the grid world.

Flower(position, flower_type, flowers_data)

Represents a flower that can be planted and harvested in the environment.

GridWorld(init_method, init_config[, width, ...])

Represents the physical grid world environment for the Ethical Gardeners simulation.