Skip to content

Commit ca72bee

Browse files
committed
_PropertyGrid: Rename functions to select and move by multiple properties
Hopefully these names are a little clearer
1 parent 907d60a commit ca72bee

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mesa/space.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -684,11 +684,11 @@ class _PropertyGrid(_Grid):
684684
remove_property_layer(property_name): Removes a property layer from the grid by its name.
685685
get_empty_mask(): Generates a boolean mask indicating empty cells on the grid.
686686
get_neighborhood_mask(pos, moore, include_center, radius): Generates a boolean mask of the neighborhood.
687-
select_cells_multi_properties(conditions, mask, return_list): Selects cells based on multiple property conditions,
687+
select_cells_by_properties(conditions, mask, return_list): Selects cells based on multiple property conditions,
688688
optionally with a mask, returning either a list of coordinates or a mask.
689689
select_extreme_value_cells(property_name, mode, mask, return_list): Selects cells with extreme values of a property,
690690
optionally with a mask, returning either a list of coordinates or a mask.
691-
move_agent_to_random_cell(agent, conditions, mask): Moves an agent to a random cell meeting specified property
691+
move_agent_to_cell_by_properties(agent, conditions, mask): Moves an agent to a random cell meeting specified property
692692
conditions, optionally with a mask.
693693
move_agent_to_extreme_value_cell(agent, property_name, mode, mask): Moves an agent to a cell with extreme value of
694694
a property, optionally with a mask.
@@ -814,7 +814,7 @@ def get_neighborhood_mask(
814814
mask[coords[:, 0], coords[:, 1]] = True
815815
return mask
816816

817-
def select_cells_multi_properties(
817+
def select_cells_by_properties(
818818
self, conditions: dict, mask: np.ndarray = None, return_list: bool = True
819819
) -> list[Coordinate] | np.ndarray:
820820
"""
@@ -847,7 +847,7 @@ def select_cells_multi_properties(
847847
else:
848848
return combined_mask
849849

850-
def move_agent_to_random_cell(
850+
def move_agent_to_cell_by_properties(
851851
self, agent: Agent, conditions: dict, mask: np.ndarray = None
852852
) -> None:
853853
"""
@@ -859,7 +859,7 @@ def move_agent_to_random_cell(
859859
conditions (dict): Conditions for selecting the cell.
860860
mask (np.ndarray, optional): A boolean mask to restrict the selection.
861861
"""
862-
eligible_cells = self.select_cells_multi_properties(
862+
eligible_cells = self.select_cells_by_properties(
863863
conditions, mask, return_list=True
864864
)
865865

0 commit comments

Comments
 (0)