mlpy.environments.gridworld.Cell

class mlpy.environments.gridworld.Cell(x, y, func)[source]

Bases: object

The abstract cell module.

A cell is a base unit in a 2d-grid. The GridWorld is composed of cells.

Parameters:

x : int

The x-position of the cell.

y : int

The y-position of the cell.

func : callable

A callback function to find the neighboring cells.

Notes

Every class inheriting from Cell must implement is_occupied.

Attributes

neighbors The cell’s neighbors.
x The x-position of the cell.
y The y-position of the cell.

Methods

is_occupied() Determines if the cell is occupied.