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.
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.
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.
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.
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.
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.