class documentation

Logger objects track market states throughout experiments for future analysis.

Method __init__ Instantiates a Logger object.
Method get_pot_distributions Get distributions of purchased items in marketplace.
Method initialize_results_logger Sets up the logger with field names and heading information.
Method log Undocumented
Method log_buyers Log buyers and their states at a particular timestep.
Method log_communities_matrix Log communities and their states at a particular timestep.
Method log_scale_free Logs statistics about the market at a particular timestep in a scale free experiment.
Method log_small_world Logs statistics about the market at a particular timestep in a small world experiment.
Method log_swi Log the current small world index.
Instance Variable assemblage Undocumented
Instance Variable buyer_fields Undocumented
Instance Variable buyer_log Undocumented
Instance Variable buyer_writer Undocumented
Instance Variable community_names Undocumented
Instance Variable field_names Undocumented
Instance Variable graph_log Undocumented
Instance Variable graph_writer Undocumented
Instance Variable images Undocumented
Instance Variable images_path Undocumented
Instance Variable initialized Undocumented
Instance Variable matrix_fields Undocumented
Instance Variable matrix_init Undocumented
Instance Variable matrix_log Undocumented
Instance Variable matrix_writer Undocumented
Instance Variable model Undocumented
Instance Variable swi_curr_epoch Undocumented
def __init__(self, directory_path, assemblage, model_type='small_world', save_images=True):

Instantiates a Logger object.

Parameters
directory_pathpath of directory to store results files
assemblagelist of items for sale in marketplace
model_typescale free or small world (default: small world)
save_imagessave static images of graphs throughout training (default: True)
def get_pot_distributions(self, graph):

Get distributions of purchased items in marketplace.

Parameters
graphgraph representing the current market state
Returns
distribution in dictionary form of purchased items
def initialize_results_logger(self, graph, all_buyers_in_market):

Sets up the logger with field names and heading information.

Parameters
graphgraph representing the current market state
all_buyers_in_marketlist of all buyers in market
def log(self, graph, epoch, timestep, num_rewires, all_buyers_in_market):

Undocumented

def log_buyers(self, graph, timestamp):

Log buyers and their states at a particular timestep.

Parameters
graphgraph representing the current market state
timestampa list containing the epoch and timestep
def log_communities_matrix(self, graph, epoch, timestep, all_buyers_in_market):

Log communities and their states at a particular timestep.

Parameters
graphgraph representing the current market state
epochcurrent epoch
timestepcurrent timestep
all_buyers_in_marketlist of all buyers in market
def log_scale_free(self, scale_free_graph, timestamp, all_buyers_in_market):

Logs statistics about the market at a particular timestep in a scale free experiment.

Parameters
scale_free_graphgraph representing current market state
timestampa list containing the epoch and timestep
all_buyers_in_marketlist of all buyers in market
def log_small_world(self, small_world_graph, timestamp, num_rewires):

Logs statistics about the market at a particular timestep in a small world experiment.

Parameters
small_world_graphgraph representing current market state
timestampa list containing the epoch and timestep
num_rewiresnumber of nodes that were rewired this timestep
def log_swi(self, graph, epoch, timestep):

Log the current small world index.

Parameters
graphgraph representing the current market state
epochcurrent epoch
timestepcurrent timestep
assemblage =

Undocumented

buyer_fields: list[str] =

Undocumented

buyer_log =

Undocumented

buyer_writer =

Undocumented

community_names: list =

Undocumented

field_names: list[str] =

Undocumented

graph_log =

Undocumented

graph_writer =

Undocumented

images =

Undocumented

images_path =

Undocumented

initialized: bool =

Undocumented

matrix_fields: list[str] =

Undocumented

matrix_init: bool =

Undocumented

matrix_log =

Undocumented

matrix_writer =

Undocumented

model =

Undocumented

swi_curr_epoch: list =

Undocumented