Advertisement

Figuring out economic problems

Started by January 23, 2011 08:05 PM
36 comments, last by leopardpm 12 years, 6 months ago

So that you can evaluate cases such as you have a fisherman and lumberjack. If the fisherman needs wood is it better for him to spend an hour gathering the wood himself or spend and hour fishing and then trade some fish to the lumberjack for the wood.

This is known as "specialization of labor" and, when left to settle appropriately, will do so even if there is a 51/49 split of efficiency.

Incidentally, this is really the genesis of the gender split between work outside the home and inside the home. When most "work" was physically intensive and there was more domestic demand (i.e. before microwaves, easy-prep bag meals, etc.) the slight bias in the abilities of the genders made it more efficient as a household unit to have the wife stay at home full time. Starting with modern home conveniences in the 60s and a less physical, service-based industry in the 70s, only then were you able to see those roles mix. Of course, the result wasn't that the man was staying at home a higher percentage, but rather that the woman could create a 2nd income.

This is also the reason that it was more efficient for people to live in groups. Any variance in the skill (either capability or learned) tipped towards specialization. The unit as a whole was more productive when people simply focussed on what they were good at. Add in the homo economicus model of every person trying to improve his or her situation (a la Adam Smith) and a cooperative competition balance is struck (a la John Nash). The "invisible hand" that Adam Smith writes of is sometimes mis-cast as a central planner when, in fact, it is actually the emergent behavior of the economy as a whole that arises out of the individual rationally economic actions. It is THIS idea that the OP is trying to model.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

yes, using a 'time value' unit is something I have considered - it probably will be one of my first units to attempt - seems the most logical as all agents will have 'time' as a calculable value - ie: why would an agent in a remote fishing village check to see to use gems as a commodity for monetary value when they may never have been exposed to gems.

One of my design constraints/goals is to try to keep all calculations as local and individual as possible. The idea is that part of what makes agents unique and individual and bring about unforeseen emergent patterns is that information is not either universal, nor does it transmit instantaneously. What I mean is: the agents in Village A would have knowledge of their local market, and not necessarily know about the market prices of village B unless exposed to them. Also, the transmittion of knowledge is an individual thing: an agent travels to another village, gains new knowledge about something, then comes back to original village and may or may not transmit that knowledge to others. Information, in this case, becomes valuable in itself as the agent with new knowledge gains a tactical advantage over those that do not - ie: he has access to possibly lower priced commodities from another village which he can then profit from by transporting them back to his village, something that other agents can't do yet because of their lack of knowledge about other village market. By the same token, a agent out hunting in the woods might learn that a certain spot is highly dangerous (wolf den nearby) and use that information in his decision process... but other hunters would not know this and should not have access to that information: design-wise this means something akin to a nav-mesh based on 'danger' for EACH agent - something way too large to implement for every agent!!!!! The other way would be to store the locations and threat levels in an agent specific array and then compute the nav mesh 'on the fly' without storing it - very computationally expensive!!! Need to find a balanced solution....

So, I am trying not to have 'world' type knowledge bases, and trying to have each agent maintain its own knowledge. This seems to be VERY storage intensive and does not provide the ability to do grand calculations which the results of can then be accessed by all in order to reduce computational time. My thoughts are that I will often have to compromise in order to balance these varying factors.

BUT... all this talk, although very interesting, is purely theoretical and basically 'dreaming' - I am still figuring out the nuts & bolts of remembering that a wolf attacked an agent in forest A and he found good fishing at stream location D... I am light years from implementing even a single village economic system, let alone a multi-village interconnected economic system!

Also, my goal is to have a GREAT many agents, thousands would be ideal, with villages forming of 50-200 (roughly). This imposes great storage and computational restrictions upon each individual agent. but, I am not restricted to a single computer in modeling the world so the more I can distribute concurrent tasks among multiple threads, the better. I am focusing on getting a single agent 'working right', then will deal with optimization and thread distribution.
Advertisement

This is known as "specialization of labor" and, when left to settle appropriately, will do so even if there is a 51/49 split of efficiency.

Actually I think you are talking about comparative advantage, where a given actor has a bit of an advantage in doing a certain task so they focus on that, while another agent focuses on their 'advantageous' task. Specialization of Labor is when you do the same thing repetitively and gain skill in that particular labor, which in turn increases your comparative advantage. Comparative advantage can come from a multitude of sources: physical attributes, predispositions (likes/dislikes), natural resource allocations, etc. BUT, it is also very important to note that comparative advantage works EVEN when an agent is NOT good at anything in particular! Even if A star basketball player is also a great typist, it is more effective for him to trade with a secretary (who might be a worse typist) leaving the typing to him/her(secretary) and focus on his much more advantageous task of shooting baskets. The secretary, who might not be good at anything, also benefits from the trade in that he/she generates more production in total then if left to her own devices. Trade is good for everyone.

Incidentally, this is really the genesis of the gender split between work outside the home and inside the home. When most "work" was physically intensive and there was more domestic demand (i.e. before microwaves, easy-prep bag meals, etc.) the slight bias in the abilities of the genders made it more efficient as a household unit to have the wife stay at home full time. Starting with modern home conveniences in the 60s and a less physical, service-based industry in the 70s, only then were you able to see those roles mix. Of course, the result wasn't that the man was staying at home a higher percentage, but rather that the woman could create a 2nd income. I would agree, but also include other influences which required dual incomes to support the same standard of living - the 50's - 60's were a very unique time where the US had extreme advantages over other nations and all citizens benefited from that. (don't know why we got off into political/economic history, but it is an intense interest of mine as well!)

This is also the reason that it was more efficient for people to live in groups. Any variance in the skill (either capability or learned) tipped towards specialization. The unit as a whole was more productive when people simply focussed on what they were good at. Add in the homo economicus model of every person trying to improve his or her situation (a la Adam Smith) and a cooperative competition balance is struck (a la John Nash). The "invisible hand" that Adam Smith writes of is sometimes mis-cast as a central planner when, in fact, it is actually the emergent behavior of the economy as a whole that arises out of the individual rationally economic actions. It is THIS idea that the OP is trying to model.

Exactly! I think we were carved from the same stone in this regard! Totally agree that most folks think of the 'inviso hand' as an actual entity (much as they refer to 'the market'), when it is an abstraction describing the result of millions of trades and interactions... by humans.

I am still figuring out the nuts & bolts of remembering that a wolf attacked an agent in forest A and he found good fishing at stream location D...

Aggregate the information into multiple influence maps. Danger, food availability, etc. That way, you no longer have to keep track of specific instances, but rather general concepts. If memory is a problem, blackboard that out so that it is accessible to multiple people.


Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"


Actually I think you are talking about comparative advantage, where a given actor has a bit of an advantage in doing a certain task so they focus on that, while another agent focuses on their 'advantageous' task.

I'm sorry... posting too quickly. Comparative advantage will lead to division of labor which will lead to specialization of labor. My bad.


Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"


'leopardpm' said:

I am still figuring out the nuts & bolts of remembering that a wolf attacked an agent in forest A and he found good fishing at stream location D…

Aggregate the information into multiple influence maps. Danger, food availability, etc. That way, you no longer have to keep track of specific instances, but rather general concepts. If memory is a problem, blackboard that out so that it is accessible to multiple people.

yeah, I was/am considering influence maps, but having a separate map for each agent with each different type (danger,food,etc) having its own map -ie: multiple maps for each and every agent, seems extremely memory intensive - either greatly limiting the amount of agents and/or the size of the world.

I gather 'blackboarding' is just having something that is 'common' to multiple agents... if that is the case then it is something that I am also trying to stay away from as I mentioned before regarding imperfect information and transferring of information taking time and how I think that such things will help make the model/simulation more 'realistic' in general. For instance, if a 'resource' influence map is common to the entire world, then an agent from across the continent (or possibly hordes of them!) could migrate over to little fishing town because of a great fishing spot was discovered. Where in reality, those agents would not have any knowledge of the event and the knowledge would only slowly travel across the world depending upon agent interactions between areas....

Sounds like I will have to go with the multiple influence maps per agent and figure out a good way to compress the data as small as possible but still allow for random access to its information. Yuck!

hmmm... maybe variable sized maps that are sized to each agent's 'discovered world' - that way the agents that are 'homebodies' are not needing/using large, world-spanning influence maps, and those that might travel still have maps that cover areas they have explored.... yeah, its a bit trickier to implement, but probably worth it in the things it will allow me to do like sharing information between two agents, etc... really interesting 'realistic' effects and migrations..... yeah, I like it!
Advertisement
Another method that is more like a relational database model is to have each agent have a list of "events" from which to derive knowledge. Each event in the list involves a who/what/where/when structure. If you want to scan your memory of good or bad things about certain places or things, you traverse the list and match tags. For example, when it is time to fish, you can enumerate the possible fishing locations, then as part of the utility-based calculations, iterate through your "memories" and apply positives and negatives accordingly. That way, you are only holding information about specific things that actually happened to you whereas an influence map would contain largely neutral information until you have a reason to feel otherwise.

Also, you can set expiry information on the events. Something that is more transient can be dropped off the list through timed sweeps.

Also, you can allow for the transfer of information from agent to agent by simply passing these list entries (with a possible random bias). If two fishermen meet up someplace, you could scan their lists for information about fishing locations and pass some or all of the tokens to each other. The emergence that spills out of this is that one person's discovery gradually propagates through a population.

This can also be used in opinion-based models such as "I don't like the food at ASDF." As people meet, they may pass this information to others. That way, a person who has never eaten at ASDF might have a poor opinion of it already "by reputation" and elect not to try it.

(BTW, I've been working on the design of a simulation like this for some time.)
cool.gif

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"


Another method that is more like a relational database model is to have each agent have a list of "events" from which to derive knowledge. Each event in the list involves a who/what/where/when structure. If you want to scan your memory of good or bad things about certain places or things, you traverse the list and match tags. For example, when it is time to fish, you can enumerate the possible fishing locations, then as part of the utility-based calculations, iterate through your "memories" and apply positives and negatives accordingly. That way, you are only holding information about specific things that actually happened to you whereas an influence map would contain largely neutral information until you have a reason to feel otherwise.

Also, you can set expiry information on the events. Something that is more transient can be dropped off the list through timed sweeps.

yes yes yes! This is definitely the best method so far - both memory efficient AND allows quick access (especially for specifics like: where is the nearest/best fishing spot relative to my location) NICE! This seems to define that basic memory structure I was asking about before, if I make the database all-inclusive enough... hmm must ponder the structure.....


Also, you can allow for the transfer of information from agent to agent by simply passing these list entries (with a possible random bias). If two fishermen meet up someplace, you could scan their lists for information about fishing locations and pass some or all of the tokens to each other. The emergence that spills out of this is that one person's discovery gradually propagates through a population.
yes, exactly... and other very interesting real world effects as well...

This can also be used in opinion-based models such as "I don't like the food at ASDF." As people meet, they may pass this information to others. That way, a person who has never eaten at ASDF might have a poor opinion of it already "by reputation" and elect not to try it.
hmmm... I hadn't considered actually transferring 'opinions' - that is a great insight! I was just thinking about 'facts' - but opinions really livens things up! very interesting...

(BTW, I've been working on the design of a simulation like this for some time.)
cool.gif

yeah, I sorta figured that this sort of idea is kinda the 'holy grail' of ALL AI programmers... how could it not be?! but... if this is so, then how come I see very little (make that none) examples of what folks have accomplished so far? I mean, even my dopey little basic sim would be considered 'something', and I haven't been able to find ANY examples of folks trying this sorta thing... or at least not sharing their progress with others (maybe everyone is secretly typing away at this holy grail, expecting some sorta big payoff in the end - like discovering 'relativity'...)


along those lines... do you have any fun sim you care to share? I'll show you mine if you show me yours! (trust me, mine ain't nothing great...yet)
I have an idea to contribute from reading this thread.

You stated earlier in the thread that you saw some interesting emergent behaviour where the agents were wandering around digging for fun. Now, i program for fun. It can be used to make money but for me its a hobby when it comes to games. Let's use a similar example. The guy likes to dig, and he digs all day until all of a sudden in his hobby of digging he comes across something of value. Some ore, or some gold or such. He pockets this and can then profit from it.

Is this something worth factoring in, that sometimes even these amusement activities that bored agents do might have a profit value attached that might weight the agents decision to do them as well as just entertainment and/or having nothing better to do? Especially if in the past the agent has had a 'lucky' windfall.
To take it further fishing may be a hobby as well as a way of sustinence, as for berry picking, a little more doubtful :-)

What do you guys think, is this a good idea to consider or did i miss something here?
Call it the "hobbyist effect".

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

This topic is closed to new replies.

Advertisement