| |
- adj_add_good(agent, good, amt, comp=None)
- adj_add_good_w_comp(agent, good, amt, old_amt)
- adjust_dura(trader, good, val)
- This function will check if durability is an attribute of
the goods. If so, utility will be adjusted by durability.
- bear_util_func(qty, divisibility=None)
- cat_util_func(qty, divisibility=None)
- check_age(trader, good)
- Adjust the amt_avaliable if the good is too decayed
- check_complement(trader)
- see if COMPLEMENT is an attribute in trader
- check_div(trader, good)
- This function will check if divisibility is an attribute of
the goods. If so, the function will return divisibility;
else, the function will return 1.
- check_transportability(good, distance)
- compl_lst(agent, good)
- return the complimentary list of this good
- endow(trader, avail_goods, equal=False, rand=False, comp=False)
- This function is going to pick a good at random, and give the
trader all of it, by default. We will write partial distributions
later.
- equal_dist(num_trader, to_goods, from_goods, comp=False)
- each trader get equal amount of goods
to_goods = trader[GOODS], from_goods = avail_goods
- exec_trade(trade_state)
- gen_util_func(qty, divisibility)
- get_lowest(agent, my_good, their_good, bidder=True)
- This function will get the max a bidder want to give up or
the min a reciever want to accept.
- get_rand_good(goods_dict, nonzero=False)
- What should this do with empty dict?
- get_util_func(fname)
- good_all_gone(agent, g)
- Check if this agent no longer has this good
- goods_to_str(goods)
- take a goods dict to string
- incr_util(good_dict, good, amt=None, agent=None, graph=False, comp=None)
- if graph=True, increase the utility according to
the weight of edge in the graph
- is_compl_good(agent, good)
- check if this good is a comp of other goods that the agent have
- is_complement(trader, good, comp)
- see if 'comp' is complement of 'good'
- is_depleted(goods_dict)
- See if `goods_dict` has any non-zero amount of goods in it.
- negotiate(trade)
- See if these two traders (held in `trade` can strike a deal.
- new_good(old_amt, amt)
- penguin_util_func(qty, divisibility=None)
- rand_dist(to_goods, from_goods, comp=False)
- Pick a random good and transfer a random amount of it to trader.
- rand_goods_list(goods)
- seek_a_trade(agent, comp=False, size=None)
- Find closest agent and see if we can trade with them.
- seek_a_trade_w_comp(agent, **kwargs)
- steep_util_func(qty, divisibility=None)
- test_util_func(f, max, d)
- trade(agent, my_good, my_amt, counterparty, their_good, their_amt, comp=None)
- trade_acceptable(trade_state, which_side)
- Is the trade acceptable to `which_side`?
- trade_debug(agent1, agent2, good1, good2, amt1, amt2, gain, loss)
- trade_state_to_str(state)
- convert integer value of ans to string
- transfer(to_goods, from_goods, good_nm, amt=None, comp=False)
- Transfer goods between two goods dicts.
Use `amt` if it is not None.
- utility_delta(agent, good, change)
- We are going to determine the utility of goods gained
(amt is positive) or lost (amt is negative).
`change` will be fractional if good divisibility < 1
|