contact_networks#
This module generates the household, school, and workplace contact networks.
Functions
Compute a description of the statistics for the degree distribution by age for a layer in the population contact network. |
|
Create a dataframe from the population of people in the layer, including their uid, age, degree, and the ages of contacts in the layer. |
|
Create contacts between members of group 1 and group 2, fixing the average degree, and the probability of an edge between any two groups controlled by p_matrix if provided. |
|
Helper function to filter people based on their uid and age. |
|
Method to count the number of contacts for individuals in the population based on their role in a layer and the role of their contacts. |
|
Calculate the expected density of an undirected graph with no self-loops given graph properties. |
|
From microstructure objects (dictionary mapping ID to age, lists of lists in different settings, etc.), create a dictionary of individuals. |
|
Generate edges for a group of individuals given their ids from an Erdos-Renyi random graph model given the expected average degree. |