pykappa.mixture¶
Manages collections of agents.
- class pykappa.mixture.Mixture(patterns=None, track_components=False)[source]¶
A collection of agents and their connections.
Optionally tracks connected components.
- Parameters:
patterns (Iterable[Pattern] | None)
track_components (bool)
- classmethod from_kappa(patterns)[source]¶
Create a mixture from Kappa pattern strings and counts.
- Parameters:
patterns (dict[str, int]) – Dictionary mapping pattern strings to copy counts.
- Return type:
Self
- property kappa_str: str¶
The mixture in Kappa format with %init declarations.
- property kappa_str_with_agent_ids: str¶
1` per component.
- Type:
Kappa representation with IDs and one `%init
- property component_tracking: bool¶
Whether connected components are being tracked.