mesa_frames.AgentSet.do#

AgentSet.do(method_name: str, *args, mask: Sequence[int] | int | Literal['all', 'active'] | None | Expr | Series | DataFrame = None, return_results: Literal[False] = False, inplace: bool = True, **kwargs) Self[source]#
AgentSet.do(method_name: str, *args, mask: Sequence[int] | int | Literal['all', 'active'] | None | Expr | Series | DataFrame = None, return_results: Literal[True], inplace: bool = True, **kwargs) Any

Invoke a method on the AgentSet.

Parameters:
  • method_name (str) – The name of the method to invoke.

  • *args (Any) – Positional arguments to pass to the method

  • mask (AgentMask | None, optional) – The subset of agents on which to apply the method

  • return_results (bool, optional) – Whether to return the result of the method, by default False

  • inplace (bool, optional) – Whether the operation should be done inplace, by default False

  • **kwargs (Any) – Keyword arguments to pass to the method

Returns:

The updated AgentSet or the result of the method.

Return type:

Self | Any