src.agent.default_geo_neighbor_helpers module

class NeighborHelpers[source]

Bases: object

Helper functions to determine the direction of a neighbor cell relative to a cell when initializing model to default geometry.

ROOTCAP_CELL_IDs = [60, 90, 120, 136, 166, 210, 296, 75, 105, 135, 151, 181, 225, 311]
static get_neighbor_dir_neighbor_shares_one_v_default_geo(cell: Cell, neighbor: Cell) str[source]

Determine the direction of a neighbor cell sharing one vertex in default geometry.

Parameters:
  • cell (Cell) – The reference cell.

  • neighbor (Cell) – The neighboring cell being considered.

Returns:

The direction of the neighbor relative to the cell (‘a’, ‘b’, ‘l’, ‘m’), or an empty string if no direction is applicable.

Return type:

str

Notes

The direction is determined by comparing cell IDs. These directions will only be correct if model is initialized to default geometry.

static check_if_neighbors_with_new_root_cap_cell(cell: Cell, sim: GrowingSim) None[source]

Checks if the neighbor is the next root cap cell.

Parameters:
  • cell (Cell) – The current cell.

  • neighbor (Cell) – The neighboring cell.

Returns:

The direction of the neighbor (‘a’, ‘b’, ‘l’, ‘m’)

or None if no direction is found.

Return type:

str

static get_neighbor_dir_neighbor_shares_no_vs_default_geo(cell: Cell, neighbor: Cell) str[source]

Determine the direction of a neighbor cell without shared vertices in default geometry.

Parameters:
  • cell (Cell) – The reference cell.

  • neighbor (Cell) – The neighboring cell being considered.

Returns:

The direction of the neighbor relative to the cell (‘a’, ‘b’, ‘l’, ‘m’), or an appropriate message if no standard direction is found.

Return type:

str

Notes

This method accounts for special cases where neighboring cells do not share a common vertex. These assignments will only be true if model is initialized to default geometry.

static fix_lrc_neighbors_after_growth(sim: GrowingSim) None[source]
static check_if_no_longer_neighbors_with_root_cap_cell(cell: Cell, lrc_neighbor: Cell) None[source]
static cell_and_lrc_cell_are_neighbors(cell: Cell, lrc_cell: Cell) bool[source]