module documentation

This module implements support methods for the control experiments for both the small world and scale free network protocols. This includes initialization methods and information file generation. This file is the equivalent of `scalefree.py` and `smallworld.py` for control simulations.

Function build_scale_free_control_network Constructs a control network for a scale-free network simulation.
Function initialize_scale_free_control No summary
Function make_random_graph Construct a random graph.
Function make_sf_control_graph_info_file Creates an information file (.csv) for this control experiment.
def build_scale_free_control_network(set_of_nodes, G, community_bonus, logger, epoch, all_buyers_in_market):

Constructs a control network for a scale-free network simulation.

Parameters
set_of_nodesrandom subset of buyers
Ggraph representing initial market state
community_bonusbonus to purchase probability from being in the same community
loggerlogging object
epochcurrent epoch (for logger)
all_buyers_in_marketlist of all buyers in market
Returns
graph representing initial market state in scale free structure
def initialize_scale_free_control(number_of_buyers, minimum_number_of_communities, minimum_community_fill, assemblage, initial_set_size, community_bonus, logger):
Parameters
number_of_buyersnumber of buyers in marketspace
minimum_number_of_communitiesminimum number of communities to which buyers belong
minimum_community_fillminimum number of buyers per community
assemblagelist of items for sale in marketspace
initial_set_sizenumber of buyers in market at initialization
community_bonusdegree to which community affiliation impacts purchase intention
loggerlogging object
Returns
Graph, new set of buyers currently in the market
def make_random_graph(group_of_communities, probability_of_link=0.5):

Construct a random graph.

Parameters
group_of_communitiesa CommunitySet object
probability_of_linkprobability that any two nodes (buyers) have an edge
Returns
graph representing randomized market state
def make_sf_control_graph_info_file(num_buyers, min_num_communities, min_community_fill, assemblage, epochs, upper_thresh, lower_thresh, death_thresh, results_dir, community_bonus, initial_set_size, set_size):

Creates an information file (.csv) for this control experiment.

Parameters
num_buyersnumber of buyers in marketspace
min_num_communitiesminimum number of communities to which buyers belong
min_community_fillminimum number of buyers per community
assemblagelist of items for sale in marketspace
epochsnumber of epochs (purchase cycles)
upper_thresh% of buyers that must own a particular item to change a buyer's intention to that item
lower_threshmax % of buyers that may own a particular item to change a buyer's intention to random item
death_threshpercentage at which an item is removed from the market
results_dirpath to directory to store results files
community_bonusdegree to which community affiliation impacts purchase intention
initial_set_sizenumber of buyers in market at initialization
set_sizenumber of buyers added to market after initialization