module documentation
This module contains methods that support the purchasing and removal of items in the market.
| Function | buy |
Every buyer purchases their intended item. |
| Function | change |
Changes buyer intentions to purchase new items (potentially). |
| Function | check |
Checks if any items are to be removed from the market. |
| Function | get |
Returns the most popular item in the market (based on buyers' purchases). |
| Function | get |
Returns a list of items owned by a buyer's neighbors. |
Every buyer purchases their intended item.
| Parameters | |
| G | graph representing current market state |
| Returns | |
| graph representing the market state with purchased items | |
Changes buyer intentions to purchase new items (potentially).
| Parameters | |
| G | graph representing current market state |
| upper | % of buyers that must own a particular item to change a buyer's intention to that item |
| lower | max % of buyers that may own a particular item to change a buyer's intention to random item |
| death | percentage at which an item is removed from the market |
| Returns | |
| graph representing market state with changed buyer intentions | |
Checks if any items are to be removed from the market.
| Parameters | |
| G | graph representing current market state |
| death | percentage at which an item is removed from the market |
| Returns | |
| list of remaining items in market | |
Returns the most popular item in the market (based on buyers' purchases).
| Parameters | |
| pots | list of pots owned by buyers in the market |
| Returns | |
| the most popular item in the pots_list | |