mesa_frames.AgentSetRegistry.do#
- AgentSetRegistry.do(method_name: str, *args: Any, sets: AgentSetSelector | None = None, return_results: Literal[False] = False, inplace: bool = True, key_by: Literal['name', 'index', 'type'] = 'name', **kwargs: Any) Self[source]#
- AgentSetRegistry.do(method_name: str, *args: Any, sets: AgentSetSelector, return_results: Literal[True], inplace: bool = True, key_by: Literal['name', 'index', 'type'] = 'name', **kwargs: Any) dict[str, Any] | dict[int, Any] | dict[type[AgentSet], Any]
Invoke a method on the AbstractAgentSetRegistry.
- Parameters:
method_name (str) – The name of the method to invoke.
*args (Any) – Positional arguments to pass to the method
sets (AgentSetSelector, optional) – Which AgentSets to target (instance, type, name, or collection thereof). Defaults to all.
return_results (bool, optional) – Whether to return per-set results as a dictionary, by default False.
inplace (bool, optional) – Whether the operation should be done inplace, by default True
key_by (KeyBy, optional) – Key domain for the returned mapping when
return_resultsis True. - “name” (default) → keys are set names (str) - “index” → keys are positional indices (int) - “type” → keys are concrete set classes (type)**kwargs (Any) – Keyword arguments to pass to the method
- Returns:
The updated registry, or the method result(s). When
return_resultsis True, returns a dictionary keyed perkey_by.- Return type:
Self | Any | dict[str, Any] | dict[int, Any] | dict[type[mesa_frames.abstract.agentset.AbstractAgentSet], Any]