trumania.components.social_networks package

Submodules

trumania.components.social_networks.erdos_renyi module

class trumania.components.social_networks.erdos_renyi.WithErdosRenyi(name, master_seed, **clock_params)[source]

Bases: trumania.core.circus.Circus

Circus mix-in that provides method to build ER random graph

add_er_social_network_relationship(population, relationship_name, average_degree, n_subscribers)[source]

Adds to this population a relationship from and to its members based an ER random graph

trumania.components.social_networks.erdos_renyi.create_er_social_network(customer_ids, p, seed)[source]
Parameters:
  • customer_ids (list) – list of IDs as defined in the data
  • p (float) – probability of existence of 1 edge
  • seed (int) – seed for random generator
Return type:

Pandas DataFrame, with two columns (A and B)

Returns:

all edges in the graph

Module contents