Creates a random undirected and unweighted network of a certain density among agents.
density — float, required
A number between 0 and 1 indicating the desired graph density, i.e. the probability that any two agents will be directly connected.
kind — str, optional
A string indicating the edge kind, in order to allow for multiple networks.
Default value: 'edge'
prim — str, optional
The agent primitive among which to create the network. If
prim==Nonethe network will be created among agents of all primitives.
Default value: None
Return Value — networkx.Graph
A NetworkX Graph object representing the created network.
Notes and Examples
charwickJun 04, 2020 at 22:25
To create a network at the beginning of the model, use the
modelPostSetuphook, as it runs right after agents are created.