-
Notifications
You must be signed in to change notification settings - Fork 14
v0.2 update 2
The agent AI was not working for me, people would go bankrupt no matter what because they were not making any rational choices (buying until they run out of money with no food to eat, selling at unsustainable prices). So I scraped the whole thing and went with a much simpler system. This system is based on Thomas Simon's excellent article on Building an economy simulator from scratch
Some nice things it comes with:
- maximize utility
- diminishing returns on marginal utility
- price adjusted buy and sell behavior
- agents self stabilize, price matches demand
I gave up a bunch of things using this method:
- lack of dependencies in build recipes (agents always build x amount of stuff)
- people don't go bankrupt anymore (maybe that's a good thing?)
- no more averaging ask and sell prices (although this might still work, haven't tried yet)
- I guess it's mostly the first bullet. With it agents no longer build variable number of items, they don't depend on variable number of items (like needing two wood for every one tool)
- oh changing professions on bankruptcy, but that's something I can easily add as well.
Taking this approach I had a few insights on the previous implementation based on BazaarBot2:
- build dependencies exacerbate supply interruptions (now I know why the original paper had optional dependencies)
- it amplifies shortages and people go broke way faster, but this is good if I want to introduce bankruptcies again once I implement loans
- buying goods is a decision that should be made across all goods to be bought, not isolated on a per commodity type
- corollary - buying goods is a form of maximizing utility with available cash, again, doesn't make sense to consider each good individually (at least not in quantities greater than 1)
- buying and selling in batches cause inequality as the first buyer could buy up everything and leave nothing for the other person. But bid price is a proxy for how desperately someone wants it even though it has no material impact on clearing price at this moment
Oh side note I just saw this video on how electricity auction works, where the agent buying buys in bulk and the sellers sell in units less than the bid. The cheapest asks are taken to match the fill order, but the clearing price is equal to the most expensive ask. So solar and wind will often use an ask price of 0 to make sure they get in on the order. Jokes on them if they ever max out the bid order and get paid nothing!