mesa_frames.AgentSetRegistry.replace#
- AgentSetRegistry.replace(mapping: dict[int | str, AgentSet] | list[tuple[int | str, AgentSet]], *, inplace: bool = True, atomic: bool = True) Self[source]#
Batch assign/replace AgentSets by index or name.
- Parameters:
mapping (dict[int | str, mesa_frames.abstract.agentset.AbstractAgentSet] | list[tuple[int | str, mesa_frames.abstract.agentset.AbstractAgentSet]]) – Keys are indices or names to assign; values are AgentSets bound to the same model.
inplace (bool, optional) – Whether to apply on this registry or return a copy, by default True.
atomic (bool, optional) – When True, validates all keys and name invariants before applying any change; either all assignments succeed or none are applied.
- Returns:
Updated registry.
- Return type:
Self