pykappa.mixture¶
Functions
|
Get all agents within a distance radius of the given agents. |
Classes
|
A collection of agents and their connections. |
- class pykappa.mixture.Mixture(patterns=None, track_components=False)[source]¶
A collection of agents and their connections.
Optionally tracks connected components, enabled via enable_component_tracking().
- 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 component_tracking: bool¶
Whether connected components are being tracked.
- enable_component_tracking()[source]¶
Turn on connected-component tracking for this mixture.
- Return type:
None
- remove(component)[source]¶
Remove a component from the mixture.
- Parameters:
component (Component)
- Return type:
None