Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarconomy (2) : Money (Commodity), Price (Value), and Market (Shops)  (Read 2034 times)

counting

  • Bay Watcher
  • Zenist
    • View Profile
    • Crazy Zenist Hospital

While I am busy with the thesis last month, thus left the previous "Dwarconomy: The danger of world trading based on local supply/demand differences" an opening end. And now, it's time for part 2 of the economy FUN in dwarf world. But this time I will start with the basic stuff - the emergence of Money from exchanging Commodity, Price from delivering Value, and Market from specialized trading Shops.

First, lets see a fairly new field of study in economics - ACE (Agent-based Computational Economics). For the purpose of better understanding what it is about, I'll quote some definitions from a book of research papers - L. Tesfatsion, K.L. Judd, "Handbook of Computational Economics, Agent-Based Computational Economics", vol. 2, Elsevier, North-Holland, Amsterdam, 2006. And here is a describe of what is concept of economy in general:
Quote from: Handbook of Computational Economics, Agent-Based Computational Economics, page 833
Economies are complex dynamic systems. Large numbers of micro agents engage repeatedly in local interactions, giving rise to global regularities such as employment and growth rates, income distributions, market institutions, and social conventions. These global regularities in turn feed back into the determination of local interactions. The result is an intricate system of interdependent feedback loops connecting micro behaviors, interaction patterns, and global regularities.

As you may observed that DF is a world defined by local interactions and a simulated global system, they should interact with each other. And the upcoming caravan arc should also give us the real feedback loop. Hence under such conditions, we should have no problem forming realistic economic structure in DF. So lets see what's ACE about:
Quote from: Handbook of Computational Economics, Agent-Based Computational Economics, page 835-836
ACE is the computational study of economic processes modeled as dynamic systems of interacting agents.5 Here “agent” refers broadly to bundled data and behavioral methods representing an entity constituting part of a computationally constructed world. Examples of possible agents include individuals (e.g., consumers, workers), social groupings (e.g., families, firms, government agencies), institutions (e.g., markets, regulatory systems), biological entities (e.g., crops, livestock, forests), and physical entities (e.g., infrastructure, weather, and geographical regions). Thus, agents can range from active data-gathering decision-makers with sophisticated learning capabilities to passive world features with no cognitive functioning. Moreover, agents can be composed of other agents, thus permitting hierarchical constructions. For example, a firm might be composed of workers and managers.
DF is essentially a world of multi-entities which mostly like agents. Thus the rules applied in ACE should sufficiently be applied in DF world as well. Although in practice, we rarely construct a complete world with full background story like DF, but a rather abstract and simplified system model for simulations.

There is a particular basic model - trading post model, proposed very early in 19th century by Leon Walras, denote that trading is done via specialized trading firms/shops. Direct face to face barters between people are rare, due to double coincidence of wants problems, or distance barriers (caravans can/will travel far, but ordinary people don't). And if there are no money in the beginning, then there will be n*(n-1)/2 kinds of trading shops for n kinds of commodities. But somehow after a while, the market suddenly "decide" to make 1 of the commodity as the commodity money, leaves only n kinds of shops. And during the process the exchange ratios of commodities(goods) and commodity(money) eventually becomes the price of goods.

The reasons of why money emerges from commodities, why price becomes the pointer to deliver commodities' relative value, and why the market is more stabilized via many same kind of shops competing with each other, were not answered for more than a century. These questions become one of the many fundamental properties/mysteries of the market system, and scholars argued about them and build models and theories over them. Not till recently we began to understand them and tested this model using ACE. And now it's safe to say that a system build on top of this more well defined ground with ACE models, can be more close to mimic real world economy.

In recent decades, many researches are done using ACE, and we now know that in order for monetary system emerging from the trading post model, there are several properties about commodities and trading itself need to be satisfied first.

1. The different amount of cost/lost of the quantity with different commodities during exchange, play a vital role of the emergence of commodity money. The commodities with less cost (more liquidity) have better chance to become medium of exchange.

2. The scalability of trading, it is that specialized exchange firms can cut trading cost during large transactions, is also a big factor to drive commodity exchange using indirect trade via the medium commodity money. Since it will reward those who use money instead of direct trade.

3. Difficulty of find coincidence of wants is not a necessary condition, if there is scalability in trading. Otherwise, a stable full barter economy will be easy to maintain under no scalability trading. However if n*(n-1)/2 the number of possible trading pairs are sufficient large, partially lack of double coincidence will occur. Using indirect trade with medium of exchange via firms hence becomes necessary. And once the market system stabilized in choosing one commodity money it will stay that way, until it meets with another previously not contacted market, but this too will reach a new commodity money very rapidly.

And we also find that the price using commodity money as base, not only related with the traditional theory about the amount of supply and demand, but also to the cost of establishing trade and the expectation of profit during trading. Hence we no longer need a magic value system, and an artificial monetary design for a market to work, and every entity that participates the exchange should increase it's consumption rate. If DF is ready to embrace economy system, I believe it can use some of these basic concepts to establish a more robust trading system.

The specific detail about the ACE model will be described in following reply posts. And by the end of it, I think we will have a better understanding about commodity, its value, and the shops where exchange happens, and bring us to a more realistic and functional money, price, and market system which emerge naturally.



Logged
Currency is not excessive, but a necessity.
The stark assumption:
Individuals trade with each other only through the intermediation of specialist traders called: shops.
Nelson and Winter:
The challenge to an evolutionary formation is this: it must provide an analysis that at least comes close to matching the power of the neoclassical theory to predict and illuminate the macro-economic patterns of growth

counting

  • Bay Watcher
  • Zenist
    • View Profile
    • Crazy Zenist Hospital

This model using following papers as references (too old paper has no link, and the very new one not yet open for download)

  N. Kiyotaki, R. Wright, "On Money as a Medium of Exchange",The Journal of Political Economy, Vol. 97, No. 4, pp.927-954, 1989

  P. Howiit, R. Clower, "The emergence of economic organization", Journal of Economic Behavior & Organization, Vol. 41, pp. 55–84, 2000.

  R. M. Starr, "The Existence and uniqueness of money in general equilibrium natural monopoly in the most liquid asset", 2004

  L.Tesfatsion, "Agent-based computational economics: a constructive approach to economic theory", 2006

  Herbert Newhouse, "The Emergence of Commodity Money as a Medium of Exchange", 2007

  Ross M. Starr, "Commodity Money Equilibrium in a Convex Trading Post Economy with Transaction Costs", 2007

  Ross M. Starr, "Mengerian saleableness and commodity money in a Walrasian trading post example", Economics Letters 100, pp. 35–38, 2008

  X. Hu, Y-J. Whang, Q-X. Zhang, "Convergence to monetary equilibrium: computational simulation of a trading post economy with transaction costs", 2010

I'll introduce a 3-level hierarchy ACE system model to bring out the topics - Money, Price, and Market, then we'll see if this simplified model can be put to use and apply its principles in a more complex world like DF. (real world as well). The 3-level are : transactor->firm->market. It will be a system with many transactors, limited firms, and  single market. It has many transaction cycles. Each cycle the transactor bartering its commodity via specialized trading firm. Over time transactors and firms will adapt new behaviors. Hence it will evolve, and our work will be to observe if there is anything interesting emerges. Each level will be defined as follows :

  1. Transactor level :
   - Each transactor produce certain commodity, and consume another kind of commodity. Such as a transactor R produce commodity A and consume commodity B can be represented as R[A->B]. The more commodity B the transactor R has, the "happier" it will be (utility function is linear with a top limit). And the amount of commodity A it produces is also fixed with a limit in each cycle as well. R will always trades out the commodity it produce to the limit in order to gain maximum return, if trading is possible. We will discuss this more in market level.

  2. Firm level :
   - A trading post or a shop. Every shop exchange only one commodity A for one another commodity B. As a pair of exchange, transactors can exchange A for B, or B for A. Notice that this is a barter exchange, so the ratio between transaction quantity can be A:B when exchange A->B, or B:A when exchange B->A. And most often that the inverse of B/A doesn't equal to A/B. If this concept is hard to grasp, then you can think of B as money. So A->B is like selling product A (for money), and B->A is like buying product A (with money). Hence you will expect a shop needs to make a profit, thus making buying price cheaper than selling price. Also from here, you can understand that the price is merely a concept of exchanging ratio determined by shop managers. This shop S will be represented as S{A<->B}.

   - A firm is not opening without a cost. And transaction always has costs, whether in the form of risks or lost during transportation, and also commodities have depreciation (food gone bad, tools worn out or broken). And different commodities have different costs. Hence the amount of cost(lost) of a certain commodity during trading is depended on the commodity itself by its property, such as a function of the cost of commodity A is f(A). For example, gold is compact, easy to carry  with less volumes than others, and also it's rarely depreciated, so the cost(lost) of gold during trading is small. But things like food are heavy, hard to transport, and will be depreciated quickly, hence their costs are large. Or something like furniture although is heavy, hard to move, but little depreciation, and the over all cost will be between as average.

  3. Market level :
   - When many shops opening or becoming bankrupt due to lack of profit, we should observe the changes and phenomenas emerge/evolve from this level. There are regulations about how often new shops appears, and how many shops can exist. Also the transactors and firms will each find their shopping stores and customers in the market, but the amount of information is limited. Each transactor can know a finite amount of shops and only buying or selling its commodity to specific store all at once a time. And although a shop can have many customers, it does not actively advertising or search new customers, but as a passive role waiting to be found and chosen by customers.
   - When a customer finds a new shop, it will first check if the shop sells or buys the commodity it produces or consumes. If it has, than it will than check if the type of commodities the shop exchanged is suitable. If the shop's transaction commodities exactly matches the customer's need and sell, this will be a direct trade(bartering). Otherwise, if the shop only satisfied the need or the sell, than the customer will search again for another shop, and check if it matches the missing half. And this time when the customer finds the complete need/sell pair shops, it will then check if a common intermediate commodity existed. Such as a customer R[A->B] and there are shops S1{A<->C} and S2{C<->B}. In this situation the customer will trade indirectly, and the commodity C will function as media of exchange. (Like a commodity money with its property)


Until now its only the first transaction cycle and the system is static, and we want it to be adapted. So here we borrow some basic concepts from General Equilibrium Theory, that each transactor/customer will want to maximize its consumption (transactor goal), and each firm/shop will want to maximize its profit (firm goal). And we want to observe if an economic equilibrium (in price and its structure) will emerge from this simulation (market goal). And the adapted rules for transactors and firms are :

 * Transactor rule :
   - Each cycle the customer will search a limited amount of randomly selected shops. And check if there is any direct or indirect trade opportunity. If there is, then the customer checks to see if the new shop(s) provide better deal than the old one. If there is a better deal, the transactor does NOT always choose the new one (or best one), but adopted it with a certain probability, hence the adoption rate is more gradual and imperfect. There are several possible actions a transactor can take, or very complex ones. But for the transactor goal of maximizing the consumption level this simple rule will do (over time).

 * Firm rule :
   - Each cycle there will be certain small amount of entrepreneurs emerge. And at the beginning, if a entrepreneur tries to open a shop, it will move its place from a transactor into a firm. Hence a transactor R[A->B] will open a firm S{A<->B}. And it will has at least 1 customer as itself. Then it needs to decide the initial exchange ratios of both transaction A->B as $(A/B) and B->A as $(B/A), and the way of choosing initial value will be based on its expected transaction volumes of commodity A and B as eQA and eQB. By using these and the cost function to calculate the expected lost of f(A) and f(B), we can now decided the initial ratios :

   $(A/B) = (eQA - f(A)) / eQB

   $(B/A) = (eQB - f(B)) / eQA

   - During the transaction cycle with the business open, a shop will start to receive customers using the price it offers, and it's unlikely the exact transaction quantity of commodity A as aQA will meet the expected one as eQA. But as a firm goal is to maximized profit, it need to calculate them using :

   profitA = aQA - $(A/B) * aQB - f(A)

   profitB = aQB - $(B/A) * aQA - f(B)

   - From the above profit calculations, it's easy to see that the profit will be 0 if the actual quantity of transaction equal to expected quantity (aQA = eQA), so we need to define an expected profit margin as ePA. Thus we need to redefined the exchange ratios (pricing equations) into :

   $(A/B) = (eQA - f(A) - ePA) / eQB

   $(B/A) = (eQB - f(B) - ePB) / eQA

   - And the final rule is for the shop to adapt and changing price when it's in negative profit, and maintain profit when its positive. So the shop will change its expectation using the actual exchange quantity of the commodity, but its the same as transactor adaption that the shop will not jump from eQA directly to aQA, using an adaption speed of aDS with the equation

   New_eQX = eQX + aDS * (aQX - eQX)

   Where X commodity has eQX = expected trading quantity, and aQX = actual, 0 < aDS < 1.

   - An additional rule is about when there are new businesses open, there are also old shops perish. A way to kick out old shops is using the survival of the fittest. Any shop that has negative profit will have a chance to go out of business. For simplicity, we can choose a fixed drop out rate with small enough value, so it won't happen to often and too soon. However it can be modified later with a more complicated model.

Here is a list of other variables used in this ACE model :

n : number of transaters

m : kinds of commodities

k : number of shops

kMAX : maximum shop locations

eQMAX : maximum expected trading quantity

sRate : customers search percetage rate

cycleMAX : maximum amount of cycles

As descibed in previous post, that there will be a total of m(m-1)/2 kinds of combinations bartering shops possible, and m(m-1) exchanging ratios. (each pair with different selling and buying "price"). We can try to simulate this model and changing these variables and functions to see what will affect the outcomes. Also we can observe if there will be a single or multiple commodity money emerge, and if there is/are money emerged then what's the avarage (sell/buy) price during and at the end of the simultion. Or we can observe if bartering can presist the emerge of monetary structure.


The system follow of this model will look like this :

Step 0: Initial variables, functions and name space

Step 1: While not reach cycleMAX, and not find a monetary structure go to step 2, else go to step 7

Step 2: Open new shops using eQX, eQY to setup $(X/Y), $(Y/X) if not reach kMAX shops

Step 3: Customers searching new shops, and update its trading plan

Step 4: Shopping and exchange commodity, calculating aQX, aQY

Step 5: Calculate shop profits, and close down obsolete shops

Step 6: Shops adapting using aDS, tuning ePX, ePY, and update price, go back to Step 1

Step 7: Calculate statistical data about commodities price and market structure


Next time, we will try to expend this model, and see if it's possible to combine this into DF trading/market/caravan system. Maybe in a way of adding the 4th level of long range global exchange. And we will see if I can convert the touch reading into the next stage of the unfinished story in Dwarconomy : "Goddess, drunk, kids, and old fisherman", and "The Island - Beach and Forest, Beauty and the Beast".



« Last Edit: July 05, 2011, 01:16:20 am by counting »
Logged
Currency is not excessive, but a necessity.
The stark assumption:
Individuals trade with each other only through the intermediation of specialist traders called: shops.
Nelson and Winter:
The challenge to an evolutionary formation is this: it must provide an analysis that at least comes close to matching the power of the neoclassical theory to predict and illuminate the macro-economic patterns of growth

aepurniet

  • Bay Watcher
    • View Profile

So this is all for worldgen mode right?  Maybe you could use something like this to automate towns in adventurer mode, but I don't see how it will solve the problems with fortress mode economics.
Logged

counting

  • Bay Watcher
  • Zenist
    • View Profile
    • Crazy Zenist Hospital

If you still confused about what a trade shop model is about, then I'll map the agents in this ACE model with DF terms. And by applying meaningful physical representation, then we can work on how to modify the model more suitable for the DF setting.

First, an important thing about agents in ACE, is that an agent can be anything, and certainly NOT equal to an individual. A dwarf is analog to a "tight-group" of transactor agents in the 3-level model, with each transactor in it share the common production goods, yet each demand different other goods. It's a small set of transactors [production, consumption] pairs, such as a stonecrafter will be a set of [stonecraft, food], [stonecraft, drink], [stonecraft, stone], ... etc, a warrior-miner may be [ore, food], [stone, food], [ore, drink], [ore, armor], [ore weapon], ... etc. And when in time a dwarf specialization in its job, it should eventually be able to produce enough commodities in order to accommodate its needs.

Many kinds of commodities existed in DF, but only a few dwarfs to begin with, hence most dwarfs are not specialist at first, but multi-tasking in many productions (thus the requirement of more manpower). And a small enough group is more efficient in pure sharing community since it very likely the multi-tasking dwarfs although produce less goods, still can easily find the goods it needs due to low demand and abundant starting resources. In this case, if we group the transactor agents of these dwarfs, we get a larger uneven group of supply/demand sets. A few of the demand and supply can cancel out each other, such as a stonecrafter with [stonecraft, stone], will fulfill a pair of transactor from miner with [stone, stonecraft-throne]. However, do to the lack of workers, most of the supply/demand pair [Xi, Yi] would be left unsatisfied. Hence a fortress is essentially a bigger set of transactor group as [supply X1, X2, ... Xi, demand Y1, Y1, ... Yi], and the number of Yi are most likely more than Xi in the beginning.

With more and more workers joined in from migrants or from new birth, more and more supply can be made to satisfied the larger demands. Thus a dwarf fortress has become more and more self sustain. The amount and number of commodities Xi increased, and Yi decreased. But due to the limitation of the nature resources, or skill-set of the dwarfs, or simply bad luck, there are always excess supplies and certain demands. And this is where the caravans can fill in. They carry off map commodities to accommodate the local supply/demand differences.

However, the above scenario is under optimal condition, and often when a fortress become more and more populated the supply/demand pairs doesn't just cancel each other out. A lot of time a small clot in production, or a misplaced stockpile can delay or even destroy the over-all balance. Since there is no "invisible hand" to guide the commodity exchange, you have to do it by "your hand". And this is where the firm-level comes in. Originally, a stockpile is purely for the purpose of sharing goods in a public open area. It the fundamental concept of a market. But instead of leaving the management role at the hand of a player, it can also be done by setting a group of specialized trading firms. A shop is also a group of firms and agents, with its stockpiles, the zone where exchange take place (shelf), and also the workers and shopkeepers to transport goods (haulers) and book keeping. We can imagine a merchant guild level from the lowest hauler, to shopkeepers (local "caravan"), to long-distance caravans, to trade post managers (long-distance shop), and eventually international merchant moguls.

The roles of the transactors and firms used in DF under current DF structure, should be sufficient enough for a barter like economy to kick in from a pure sharing economy. And overtime it should allow the monetary structure emerge. Next time, we will discuss the concept of commodity divisibility, and the role of transactors who produce or consume being analog to mideval era goldsmith, nobleman, and banker.

P.S And for the answer of the question.
So this is all for worldgen mode right?  Maybe you could use something like this to automate towns in adventurer mode, but I don't see how it will solve the problems with fortress mode economics.
It's partially right, and I have not go into caravan as a higher level of bigger group of firms. The first idea is when generating the world, we can build a monetary system dynamically, and different monetary system can emerge with different kinds of possible commodity money (small stone-mug could be used as medium of exchange, why not?). Hence the value of different commodity can be defined properly base on a series of local markets connected with caravans. And although some remote and small community will remain as bartering or sharing economy, larger fortress or even town-level (close to thousands population if it possible in the future) city will benefit from a local monetary system, or even a banking system. (That remain to be discussed, and there are already some ACE models deal with the design of banking and fiat money, see Q. Ashraf, B. Gershman, P. Howitt, "Banks, Market Organization, and Macroeconomic Performance: An Agent-Based Computational Analysis", 2011.) And large economic center of the area, can also be modified by users. If designed correctly, the shops should help fortress mode player to handle the production when there is a large population. A player can assigned shopkeepers, haulers, or the type of goods to be traded. Or setup the the margin of profit, the level of interests rate (if there is banking in the future).

And the setup of new shops can be made by players, (it doesn't care how it is created, as long as there is new shops setting up, and old shops abandon). There should be options of how the price is set, either automatically adapted using the rules I described, or a very slow adaption rate by user defined. If it is set to defined by user, then it will be more like communism than market driven price. Or it can even be hybrid, like the player can push certain directions, but the final tuning is done by dwarfs. Under different economic structure, they should still be able to link with each other in large scale through caravans since the difference in exchange ratio didn't effect the global market, it only effect the profit shops made or lose as a whole. A player can ignore the market signal off the map from other part of world, and suffer the consequence, or use it as a economic weapon to force other civs accepting your economic rule. (if a player is powerful enough economically). Perhaps even in the future, there can be economic policy for player to choose and negotiate with other civs.
« Last Edit: July 05, 2011, 05:21:20 pm by counting »
Logged
Currency is not excessive, but a necessity.
The stark assumption:
Individuals trade with each other only through the intermediation of specialist traders called: shops.
Nelson and Winter:
The challenge to an evolutionary formation is this: it must provide an analysis that at least comes close to matching the power of the neoclassical theory to predict and illuminate the macro-economic patterns of growth

counting

  • Bay Watcher
  • Zenist
    • View Profile
    • Crazy Zenist Hospital

I've been busy building a new model, that is going to base on the foundation of gathering sites into trading posts, a crossbreed between the trade post model and transaction match model. And seems I've already written something about divisibility in other post, I'll post a link below, and talked about the role of commodity money supplier and commodity money consumer later.

http://www.bay12forums.com/smf/index.php?topic=87715.msg2417295#msg2417295
Logged
Currency is not excessive, but a necessity.
The stark assumption:
Individuals trade with each other only through the intermediation of specialist traders called: shops.
Nelson and Winter:
The challenge to an evolutionary formation is this: it must provide an analysis that at least comes close to matching the power of the neoclassical theory to predict and illuminate the macro-economic patterns of growth