Complex Systems Summer School 2000

StarLogo Project:  HomeWork Problem #2

One of the homework problems Ronnie gave us was to show that the unequal distribution of wealth phenomenon can be seen in an easy StarLogo simulation.  The turtles start out with the same amount of money, $100 for example.  When they meet each other, one randomly chosen gives the other a dollar if they have at least one to give.  The point of the exercise is that there occurs a considerable imbalance of wealth.

Java/StarLogo

In order to do this on my Linux system, I used the Java based version of StarLogo.  It was a somewhat painful process due to the combination of the Linux JDK and the StarLogo system.  Crashes were frequent and the UI was flaky.  It also proved frustrating for an experienced programmer to use a system designed for non-programmers!  The manual used an incremental learning technique which was hard for me to use.  I never could figure out how to have a procedure return a value, for example.  Similarly I could not construct a string composed of values of variables with interspersed text .. a "printf".

None the less, it was a LOT of fun!  The system really is simple and the simplicity makes the agent behavior all the more clear.

The Program

Because the StarLogo system is somewhat incomplete, I had to use a combination of gnuplot and StarLogo:  StarLogo would run the agent simulation, and the result of a manual "show money" command in the turtle's command window would be cut & paste into a file, which gnuplot would then graph.

Below is the startup configuration; the first with no steps taken by the turtles, the second with just 11 steps.  Note that they are all initially all yellow and the second window shows half yellow, half blue.  This is due to using four colors for the turtles, depending on their wealth: $0 -$50: Red, $50 -$100: Blue, $100 -$150: Yellow, above $150: Green.


Click for larger image





The associated graphs from gnuplot are here.  Note the first is simply a uniform $100 distribution.  After 11 steps, there is some slight difference of wealth.

The Results

After running for several thousand iterations, the disparity in wealth is pronounced.  The first snapshot is at 3600 iterations, and the second at 6000.
 
 

In the first case, there are a few folks with $0, and some with as many as around $280.  In the second, there are a few more $0 folks, and a few with as many as $325.