make_random_contacts#
- class make_random_contacts(pop_size, n, overshoot=1.2, dispersion=None, mapping=None)[source]#
Make random static contacts for a single layer as an edgelist.
- Parameters:
pop_size (int) – number of agents to create contacts between (N)
n (int) – the average number of contacts per person for this layer
overshoot (float) – to avoid needing to take multiple Poisson draws
dispersion (float) – if not None, use a negative binomial distribution with this dispersion parameter instead of Poisson to make the contacts
mapping (array) – optionally map the generated indices onto new indices
- Returns:
Dictionary of two arrays defining UIDs of the edgelist (sources and targets)
New in 3.1.1: optimized and updated arguments.