pycellga.neighborhoods package

Submodules

pycellga.neighborhoods.compact_13 module

class pycellga.neighborhoods.compact_13.Compact13(position, n_rows, n_cols)[source]

Bases: object

Compact13 calculates the positions of the 12 neighbors in a 2D grid for a given position, considering wrapping at the grid edges.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

__init__(position, n_rows, n_cols)[source]

Initialize the Compact13 object.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

calculate_neighbors_positions() list[source]

Calculate the positions of the 12 neighbors for the given position in the grid.

The neighbors are determined by considering wrapping at the grid edges.

Returns:

A list of tuples representing the positions of the 12 neighbors.

Return type:

list

pycellga.neighborhoods.compact_21 module

class pycellga.neighborhoods.compact_21.Compact21(position, n_rows, n_cols)[source]

Bases: object

Compact21 calculates the positions of the 20 neighbors in a 2D grid for a given position, considering wrapping at the grid edges.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

__init__(position, n_rows, n_cols)[source]

Initialize the Compact21 object.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

calculate_neighbors_positions() list[source]

Calculate the positions of the 20 neighbors for the given position in the grid.

The neighbors are determined by considering wrapping at the grid edges.

Returns:

A list of tuples representing the positions of the 20 neighbors.

Return type:

list

pycellga.neighborhoods.compact_25 module

class pycellga.neighborhoods.compact_25.Compact25(position, n_rows, n_cols)[source]

Bases: object

Compact25 calculates the positions of the 24 neighbors in a 2D grid for a given position, considering wrapping at the grid edges.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

__init__(position, n_rows, n_cols)[source]

Initialize the Compact25 object.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

calculate_neighbors_positions() list[source]

Calculate the positions of the 24 neighbors for the given position in the grid.

The neighbors are determined by considering wrapping at the grid edges.

Returns:

A list of tuples representing the positions of the 24 neighbors.

Return type:

list

pycellga.neighborhoods.compact_9 module

class pycellga.neighborhoods.compact_9.Compact9(position, n_rows, n_cols)[source]

Bases: object

Compact9 calculates the positions of the 8 neighbors in a 2D grid for a given position, considering wrapping at the grid edges.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

__init__(position, n_rows, n_cols)[source]

Initialize the Compact9 object.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

calculate_neighbors_positions() list[source]

Calculate the positions of the 8 neighbors for the given position in the grid.

The neighbors are determined by considering wrapping at the grid edges.

Returns:

A list of tuples representing the positions of the 8 neighbors.

Return type:

list

pycellga.neighborhoods.linear_5 module

class pycellga.neighborhoods.linear_5.Linear5(position, n_rows, n_cols)[source]

Bases: object

Linear5 calculates the positions of the 4 neighbors in a 2D grid for a given position, considering wrapping at the grid edges.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

__init__(position, n_rows, n_cols)[source]

Initialize the Linear5 object.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

calculate_neighbors_positions() list[source]

Calculate the positions of the 4 neighbors for the given position in the grid.

The neighbors are determined by considering wrapping at the grid edges.

Returns:

A list of tuples representing the positions of the 4 neighbors.

Return type:

list

pycellga.neighborhoods.linear_9 module

class pycellga.neighborhoods.linear_9.Linear9(position, n_rows, n_cols)[source]

Bases: object

Linear9 calculates the positions of the 8 neighbors in a 2D grid for a given position, considering wrapping at the grid edges.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

__init__(position, n_rows, n_cols)[source]

Initialize the Linear9 object.

Parameters:
  • position (tuple) – The (x, y) position of the point whose neighbors are to be calculated.

  • n_rows (int) – The number of rows in the grid.

  • n_cols (int) – The number of columns in the grid.

calculate_neighbors_positions() list[source]

Calculate the positions of the 8 neighbors for the given position in the grid.

The neighbors are determined by considering wrapping at the grid edges.

Returns:

A list of tuples representing the positions of the 8 neighbors.

Return type:

list

Module contents