Jump to content

  • Log In with Google      Sign In   
  • Create Account


Figuring out economic problems


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
37 replies to this topic

#21 IADaveMark   Moderators   -  Reputation: 2326

Like
0Likes
Like

Posted 25 January 2011 - 12:09 PM

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-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

Sponsor:

#22 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 25 January 2011 - 12:21 PM

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.

#23 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 25 January 2011 - 12:37 PM

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.

#24 IADaveMark   Moderators   -  Reputation: 2326

Like
0Likes
Like

Posted 25 January 2011 - 09:44 PM

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-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

#25 IADaveMark   Moderators   -  Reputation: 2326

Like
0Likes
Like

Posted 25 January 2011 - 09:45 PM

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-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

#26 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 25 January 2011 - 10:13 PM


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!

#27 IADaveMark   Moderators   -  Reputation: 2326

Like
0Likes
Like

Posted 25 January 2011 - 10:29 PM

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.)
Posted Image
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC

Professional consultant on game AI, mathematical modeling, simulation modeling
Co-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

#28 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 25 January 2011 - 10:55 PM

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.)
Posted Image

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)

#29 braindigitalis   Members   -  Reputation: 150

Like
0Likes
Like

Posted 26 January 2011 - 12:51 PM

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?

#30 IADaveMark   Moderators   -  Reputation: 2326

Like
0Likes
Like

Posted 26 January 2011 - 01:51 PM

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-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
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!"

#31 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 26 January 2011 - 01:56 PM

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?


nope, didn't miss anything and, in fact, what you describe is 'kinda' already taken into account: an agent chooses his actions through his 'personality filter' (as I call it), and if he 'likes to dig' then he will tend to do things that involve digging, this means everything from 'fun' activities, to activities where he is trying to earn money... but, there is no way (yet) that I can see to link up an arbitrary event (like finding gold) to the task of 'earning money' through which 'digging' would be then chosen.... restated, the agents may know that certain, predetermined, tasks 'earn money', but don't have the ability to 'add new money earning tasks' to this finite list.... very interesting!

Between all these posts on this thread, my programming time to completion in starting to be measured in decades instead of months/years.... but all very worthy ideas, makes me think 'differently'...

#32 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 26 January 2011 - 01:57 PM

Call it the "hobbyist effect".


... or the ever-expanding AI programmers nightmare effect....

#33 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 26 January 2011 - 02:17 PM

as an aside, I am pretty well versed in programming 2D tile games and 2.5D Isometric games, but have stayed away from the true 3D stuff. But DF & MC (Dwarf Fortress, MineCraft) have got me hooked on modifying the terrain by players/AI agents and I came up against the upper limits of what is possible with 2.5D Iso - I had a modifiable terrain, with 32 levels of height, huge scrolling map (view was 72 x 72 x 8 'cubes' in a memory map of 512 x 512 x 32), but after adding in 'height' I discovered that it just wasn't gonna work for digging caves, or when things go around behind hills/mountains/tall buildings/etc - yes, I did add the ability to 'rotate' the map into the 4 directions, which 2.5D is capable of, and this allowed me to look behind things and such... but caves were a different story....

Soooo, long story even longer, the past few days I have been forcing myself to learn OpenGL and dealing with 3D worlds. and in the process of trying to modify my sim (which was just 2D), I broke it, good and thorough, and all I had saved of past versions was just a basic 'tree' locator and basic influence map of forests testing thing.... very sad! Oh well, I probably needed to redesign my whole AI architecture from the ground up anyhow, but this time I will (A) have the sim output in 3D, and more importantly, (B) try to remember to keep multiple versions , or backups of my work as I go along - probably making a copy after every programming session or so.... argh!

Ultimately, my idea is that have this single, versatile, gignormous AI engine which can be dropped into any kind of RPG game environment with minimal hooks, and have it provide interesting gameplay for the user no matter if the game interface is 2D, 2.5D, or 3D... that shouldn't matter much except to a few specific routines (like A* pathfinding, collision detection, etc)

Should be getting Mark's book anyday now... that will get me started off in the right directions!

#34 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 26 January 2011 - 06:35 PM

darn! I was wrong... The dang book just shipped... haven't I been waiting for weeks already? sheesh! Guess its back to studying OpenGL crap... yuck... maybe I will just stick the AI sim into a 2.5D...arg!

#35 TechnoGoth   Crossbones+   -  Reputation: 2369

Like
0Likes
Like

Posted 27 January 2011 - 06:47 AM

Soooo, long story even longer, the past few days I have been forcing myself to learn OpenGL and dealing with 3D worlds. and in the process of trying to modify my sim (which was just 2D), I broke it, good and thorough, and all I had saved of past versions was just a basic 'tree' locator and basic influence map of forests testing thing.... very sad! Oh well, I probably needed to redesign my whole AI architecture from the ground up anyhow, but this time I will (A) have the sim output in 3D, and more importantly, (B) try to remember to keep multiple versions , or backups of my work as I go along - probably making a copy after every programming session or so.... argh!


sounds like you need to to get yourself some free souce control software. I recommend http://www.visualsvn.com/ if you check in your changes everyday then you can easily rollback to an old version should you break someting.

Writing Blog: The Aspiring Writer

 

Novels:
Legacy - Black Prince Saga Book One - By Alexander Ballard

Current Projects: Rags to Riches -prototype increment game - Design V1

Android Apps:


#36 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 27 January 2011 - 10:22 AM

sounds like you need to to get yourself some free souce control software. I recommend http://www.visualsvn.com/ if you check in your changes everyday then you can easily rollback to an old version should you break someting.


that sounds like something a bit too smart for me to do. LOL! thanks!

#37 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 03 June 2011 - 07:11 AM

Just wanted to provide an update:

In my quest for understanding and deciding how exactly to implement such a dynamic AI, I think I have settled on the GOAP system (Goal Oriented Action Planner). I have come across quite a few articles (and thesis papers) which have been detailed enough for me to grasp the actual possible programming of one. Here is the paper that really decided it for me (Enhanced Behaviors using GOAP). I also have come across quite a few articles by you, Mr. Dave Mark, and you continue to impress me with how you are able to instruct in an inviting and casual way - keep it up!

One of the advantages of the GOAP system is that the 'actions' are independent from the AI architecture which means once you have a GOAP setup, you can easily add new actions to it and it will incorporate such actions into its possible planning process - VERY slick and allows for a continual upgrade path, AND, perhaps more importantly, allows for the possibility of re-using the AI structure between games, even in different genres. Which leads me to my next question....

instead of re-inventing the wheel, does anyone know or have a GOAP implementation to which I could just focus on adding 'actions' and the world hooks (animations, etc)? If not, then wouldn't this be an IDEAL piece of middleware to develop for the AI community and Indie developer community in general? I could see very amateur programmers being able to use such a system and easily incorporate it into their games, just like how they currently are able to create pretty decent 3-D games without evening understanding all the math and algo's that go into the engine itself. Or is this beast out there somewhere already and I just haven't found it yet?

...just askin'!

BTW: dave Mark - I have really enjoyed your Behavioral Mathematics book and it has helped me understand some things and look at problems from sometimes totally different perspectives - Thanks! worth every penny!

ALSO: interesting GOAP implementation... but I don't get how GOAP is able to 'figure out' the guard patrol routes... anyone care to explain or theorize how this was accomplished? I don't see anything within standard GOAP that allows for predictive planning of other agents. (Watch the video)

#38 leopardpm   Members   -  Reputation: 148

Like
0Likes
Like

Posted 19 May 2012 - 06:28 PM

DaveMARK,
In regards to generating market pricing, supply, demand curves, etc... I came across this interesting thesis and I would like your opinion:

http://larc.unt.edu/techreports/LARC-2010-03.pdf

Also, any updates or tidbits regarding your own AI Sim Project that you have alluded to before? Any scraps of info would be great to read!

Thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS