mesa_frames.Grid.move_agents#

Grid.move_agents(agents: int | Collection[int] | Series | DataFrame | AbstractAgentSet | AbstractAgentSetRegistry | Collection[AbstractAgentSet] | Collection[AbstractAgentSetRegistry], pos: int | DataFrame | Sequence[int] | float | Sequence[float] | Collection[int | DataFrame] | Sequence[int | slice | Sequence[int]] | Collection[int | Sequence[int] | DataFrame] | Sequence[float | Sequence[float]] | Collection[float | Sequence[float] | DataFrame], inplace: bool = True) Self#

Move agents in the Space to the specified coordinates.

If some agents are not placed,raises a RuntimeWarning.

Parameters:
  • agents (IdsLike | AbstractAgentSet | AbstractAgentSetRegistry | Collection[AbstractAgentSet] | Collection[AbstractAgentSetRegistry]) – The agents to move

  • pos (SpaceCoordinate | SpaceCoordinates) – The coordinates for each agents. The length of the coordinates must match the number of agents.

  • inplace (bool, optional) – Whether to perform the operation inplace, by default True

Raises:
  • RuntimeWarning – If some agents are not placed in the space.

  • ValueError

    • If some agents are not part of the model.

    • If agents is IdsLike and some agents are present multiple times.

Return type:

Self