saush

Utopia 2, or Why the rich gets richer and the poor gets poorer

Posted in Artificial life, java, Ruby, Sugarscape by sausheong on May 29, 2007

Some time back (more than 4 years ago) I experimented with Craig Reynold’s boids concept. I suppose everyone does boids some time or another. I called mine Utopia and wrote a simple simulation game around it, where two groups of opposing boids clashed with each other, try to eat each other up. Macabre, I know but it was pretty cool.

I was reading The Origin of Wealth by Eric Beinhocker recently. One of the chapters described Epstein and Axtell’s research in Sugarscape and it reminded me of Utopia. I thought why not to try reproduce it with some of what I did in Utopia but in Ruby? After some initial hiccups trying to find the best GUI toolkit to create Utopia2, I decided to use JRuby and Swing.

A bit of background on the subject matter. Joshua Epstein and Robert Axtell are researchers in the Brookings Institution, a public policy think-tank in US. The Sugarscape project was basically an attempt to use ideas from complexity theory and artificial life on to the social sciences. The goal is to see if behaviours we see in real societies can be modelled using just simple local rules, very much like the three basic rules used in modelling boids.

Sugarscape simulates the behavior of artificial people (agents) located on a landscape (50 x 50 grid) of a generalized resource (sugar, hence Sugarscape). Agents are born onto the Sugarscape with a vision, a metabolism, a speed, and other genetic attributes. Their movement is governed by a simple local rule: “look around as far as you can; find the spot with the most sugar; go there and eat the sugar.” Every time an agent moves, it burns sugar at an amount equal to its metabolic rate. Agents die if and when they burn up all their sugar.

So, at each turn the agents follow these basic rules:

  1. Look around itself, within the constraint of its scope of vision (north, south, east and west)
  2. Determine which direction has the most sugar
  3. Move to that square and if it has sugar, eat it
  4. When it eats some units of sugar, it gains that amount while the sugar on the square is decreased by the amount that is eaten
  5. Every turn the agent will consume a certain amount of sugar according to its metabolism
  6. If the agent runs out of sugar it will die. The agent also has a preset lifespan which is reduced every turn until it expires

Sugar is distributed unevenly in Sugarscape, some cells have higher concentration of sugar while others have lower and two sugar ‘mountains’ are formed at the top right and bottom left of the simulation. Sugar that is consumed is also grown back at the rate of one per unit of time, so the food never really runs out.

The simulation starts with 250 agents started at random places. The diagram below shows the output of the basic model, from Epstein and Axtell’s research.

Utopia2 follows a very similiar logic as with Sugarscape but instead of agents and sugar, I used the terms alf (Artificial Life Form) and food. There are also a number of differences:

  1. While Sugarscape is a 50 x 50 grid, with each agent occupying a cell, Utopia2 is a 600 x 600 canvas and each alf occupies a single point
  2. Instead of looking at the 4 directions only, each alf scans a radius of its vision scope to see if there is any food within its scope. If there is, it will move towards the nearest visible food, otherwise it will randomly wander to a direction. This differs from Sugarscape because the Sugarscape agent always goes to the direction where it is most likely to have food, whereas the Utopian alf has no idea where the most likely food is, beyond its scope of vision
  3. The alf also has a lifespan which amount is randomly assigned and is reduced every round. But more importantly if it runs out of sugar, it will not die immediately but it will increase its starvation rate. The alf’s starvation rate quickens the reduction of its lifespan and once its lifespan is 0 it will die
  4. Lastly, while the Sugarscape agent moves one cell per turn, the Utopian alf has different speeds which is also a randomly distributed endowment. This is actually why the alf is more life-like. Of course my alfs also have a cool-looking ‘tail’ :)

Besides this, in Utopia2 while food grows back, it doesn’t do so immediately but grows back at a different rate. The result is as shown in this YouTube clip.

Here are some still shots of the simulation and two charts that trace the the progress of the simulation.

The first chart shows the food level of each alf over the progression of the simulation. In t=0, the alfs’ food levels are evenly distributed, that is, some have more food than the others but overall, the gap is not large. As the simulation progresses, you’ll notice that the chart becomes a sort of power law graph, where there are some alfs with a lot of food, while most will eventually have either very little or none (dead).

The second chart shows the number of alfs compared with the amount of food (in ranges) it has. I took the food levels of all the alfs, and divided the difference between the most food with the least food with a 13 different ranges or food ‘bins’. Then I sorted the alfs accordingly into each bin. In t=0, the distribution, as expected is quite even, and it forms a sort of uneven bell curve. This is expected as the initial food levels of the alfs is a random distribution.

However, as the simulation progresses you’ll notice the chart starts to skew towards the left, with few very ‘rich’ alfs with a lot of food to the right, a long tail of ‘middle class’ alfs and a lot of alfs with little or no food (dead). In fact, in certain simulations, while the alfs start of with a random food level of between 0 – 100, the super-rich alfs can reach levels of more than 7,000!

You’re right if you notice that these two charts basically potray the same thing, and in fact it is the same results that Epstein and Axtell came up with from their Sugarscape model.

So what does Epstein and Axtell’s research show?

In 1895, Italian economist Vilfredo Pareto collected income data from a number of countries and created a distribution chart called the Pareto distribution. Rather than a bell-shaped curve, which it will be if it is a normal distribution, it was one with a few very rich people, a wide range of middle class people and a large number of poor people, what is sometimes also known as power law distribution. In fact you’d probably have heard of this one before – this is the 80-20 rule, where 20% of the people owns 80% of the wealth.

And the Sugarscape (and Utopia2) simulation model shows this.

The question is, why does this happen? Why does the rich get richer and the poor gets poorer? Two obivious answers to this question are:

  1. Because of their genetic predisposition (nature) i.e. because they were ‘born’ with better endowments – with more scope of vision, with larger appetites, with faster speed etc
  2. Because of their location (born with a silver spoon) i.e. because they were born at the right place at the right time

However if we dig deeper, both answers are not right, because in each case the distribution is random and therefore bell-curve distribution, if these are the reasons then the final distribution of wealth should also be bell-curve.

The real answer, apparently is described in complexity theory. The skewed Pareto distribution we see is an emergent property of the system, and not because of a single cause. Without going in depth, what it means is that from a simple set of rules rises a new complexity that cannot be easily derived from the existing set of rules.

If we apply it to the real world, the parallels can be that there is no single easy cause of why the rich gets richer and the poor gets poorer, not only because of oppressive explotation by the rich, or globalization, or protectionist policies or the laziness of the people or the color of the skin or whichever the cause of the day is.

If you want to try out Utopia2, I’m making it available here, under Apache 2 license. You’re free to take it up and do whatever pleases you, but I’d appreciate it if you reference me if you do use it. You’ll need JRuby, of course, and JFreeChart.

By the way, this model of the Sugarscape simulation that I have just described is just the basic model. The full work done by Epstein and Axtell is described in their 1996 book Growing Artificial Societies: social science from the bottom up from MIT Press. Utopia2’s implementation to date follows this basic model only, however it is really quite simple to program the other more complex models. Let me know if you use Utopia2 to do this, I’ll be interested in knowing how you do it.

About these ads

11 Responses

Subscribe to comments with RSS.

  1. [...] post by sausheong and software by Elliott [...]

  2. Patxi Bonel said, on May 30, 2007 at 8:32 am

    This is a very interesting post. I’ve enjoyed it very much. I keep reading everything I can about power laws, and Utopia2 is one of the most innovative approaches to this topic I’ve ever found so long in Internet.

    Best regards from Madrid (Spain)

  3. sausheong said, on May 30, 2007 at 11:28 am

    Hi Patxi, thanks for your comments, I’m glad you liked it.

  4. Mohan said, on June 20, 2007 at 11:24 pm

    I like this article very much :)

    Mohan

  5. Mohan said, on June 20, 2007 at 11:36 pm

    Your video shows that there is typo (2 at in title) error.

  6. Steven said, on April 22, 2011 at 5:26 pm

    Hi,

    I recently discovered your blog and started reading from the first posts on. I enjoyed reading this post a lot but the screenshots are not available anymore.
    Do you see a chance to put them online again?

    Thanks,

    Steven

  7. sausheong said, on April 22, 2011 at 8:18 pm

    Hi Steven,

    The reason why the screenshots were lost was because my older WP site was hacked and I lost the entire site. I had to restore from an XML backup that didn’t have any images and I had to manually reload all the images from my other backups. Anyway they are up again, at least for this post. Thks for reading!

    I will post my code up to Github later instead of zipping it up.

  8. Steven said, on April 22, 2011 at 8:31 pm

    Thank you for your prompt response (and action :-) )!

  9. sausheong said, on April 22, 2011 at 9:08 pm

    Not a problem. The sourcce code is now in Github. The link to the source code should be correct now.

  10. Jeffrey 'jf' Lim said, on April 22, 2011 at 9:30 pm

    :) guess this post just came back to life again…

    I dont know how much this approximates life, but life definitely is complex… :) I would at least take into consideration the factor of influence (alfs influencing each other) to consider it more life-like. One question about utopia2 without getting into the code – does it have the two mountains too?

  11. sausheong said, on April 23, 2011 at 6:56 am

    Jeff, yes it does have the 2 ‘mountains’ — check out the YouTube video.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 446 other followers

%d bloggers like this: