Reference 〉 Function

Agents.network(kindstr'edge', primstrNone)

Exports the model’s graph structure to a NetworkX object; useful for further network analysis. Agent breed, primitive, and (if a spatial model) position are also stored as metadata.

Parameters

  • kind str, optional

    The network kind for which to generate the graph object.

    Default value: 'edge'

  • prim str, optional

    Narrows the node list to agents of a specific primitive. By default it includes agents of all primitives, as edges can cross primitives.

    Default value: None

Return Value networkx.Graph

A networkx.Graph object representing the model state at the time of the function call. Note that this object is not automatically updated as the model runs.

Notes and Examples

  1. Contribute a Note

    Your email address will not be published. Required fields are marked *

    You may use limited HTML for formatting. Please embed blocks of code in <pre><code> </code></pre> tags.

History