module documentation

This module contains methods that support the purchasing and removal of items in the market.

Function buy_pots Every buyer purchases their intended item.
Function change_all_buyer_intentions Changes buyer intentions to purchase new items (potentially).
Function check_for_pot_death Checks if any items are to be removed from the market.
Function get_most_popular_pot Returns the most popular item in the market (based on buyers' purchases).
Function get_neighbors_pots Returns a list of items owned by a buyer's neighbors.
def buy_pots(G):

Every buyer purchases their intended item.

Parameters
Ggraph representing current market state
Returns
graph representing the market state with purchased items
def change_all_buyer_intentions(G, upper_threshold, lower_threshold, death_threshold):

Changes buyer intentions to purchase new items (potentially).

Parameters
Ggraph representing current market state
upper_threshold% of buyers that must own a particular item to change a buyer's intention to that item
lower_thresholdmax % of buyers that may own a particular item to change a buyer's intention to random item
death_thresholdpercentage at which an item is removed from the market
Returns
graph representing market state with changed buyer intentions
def check_for_pot_death(G, death_threshold):

Checks if any items are to be removed from the market.

Parameters
Ggraph representing current market state
death_thresholdpercentage at which an item is removed from the market
Returns
list of remaining items in market
def get_most_popular_pot(pots_list):

Returns the most popular item in the market (based on buyers' purchases).

Parameters
pots_listlist of pots owned by buyers in the market
Returns
the most popular item in the pots_list
def get_neighbors_pots(node, graph):

Returns a list of items owned by a buyer's neighbors.

Parameters
nodetarget buyer
graphgraph containing buyer representing current market state
Returns
a list of items owned by a buyer's neighbors