New: Here is a slightly newer version, built using RePast 3.1 and
MacOSX XCode. Most of the parameters (see below) are the same, but
there is a slightly different user interface. The signed jar file is
about 1.5 megabytes . . .
WealthModel.jnlp (2006)
The Java source is here:
WealthModel Java source
There are two basic "wealth" models here (with an extra bonus of a "synchronization" model :-)
The first wealth model is a very simple (!!!) "exchange" model. Each agent starts with (essentially) the same amount of wealth (by default, about 100 "dollars"). Then, during each time step, each agent chooses another agent at random, and gives that agent a dollar. The only other rule is that agents are not allowed to go totally broke or into debt -- i.e., if an agent has only one dollar, they just sit and wait for someone else to give them a dollar. Then they proceed as before.
The second wealth model is a very simple (!!!) "investment" model.
Again, each agent starts with (essentially) the same amount of wealth.
Then, during each time step, each agent "invests" their entire wealth,
and makes a "return" r on their investment, which is normally distributed
around RoiM (Return on investment Mean -- detrended . . .)
with standard deviation RoiSD
(Return on investment Standard Deviation). Their new wealth is just:
wealth <- wealth * exp(r)
where r is their individual return on investment rate for this time step.
That's it for the wealth models. (With the "Both" option, each agent does both things each time step . . .)
(Sometime I'll get around to writing about the "Sync" model . . .)
// default and modifiable parameters of the model
boolean Both = true; // Combine exchange and investment economies
boolean DeathTax = false; // Implement "death tax"
int MaxAge = 1200; // Age for "death tax" (if turned on)
int MaxInitialWealth = 110; // Maximum initial wealth for agents
int MinInitialWealth = 90; // Minimum initial wealth for agents
double MinWealth = 1.0; // Minimum wealth
boolean Moving = false; // Do agents move (for exchange or "synch" models)
int NumAgents = 1500; // Total number of agents (must be <= 2500)
int NumLogLogBins = 20; // Number of bins for log:log plot
int NumPlainBins = 100; // Number of bins for plain plot
int PlainPlotXMax = 300.0; // Maximum X (wealth) plotted in plain plot (-1 = any)
int PlainPlotYMax = -1.0; // Maximum Y (P_i) plotted in plain plot (-1 = any)
boolean PlotLogLog = true; // Whether to display log:log plot
boolean PlotPlain = true; // Whether to display plain plot
boolean ROI = false; // Whether to do investment economy (only)
double ROIM = 0.00; // Mean return on investment
double ROISD = 0.05; // Standard deviation of normal dist. of return
boolean RandomWalk = false // Whether to do exchange or individual random walk
boolean Smarter = false; // Are some agents smarter?
int SmarterNum = 50; // 1 in SmarterNum is smarter.
boolean Sync = false; // Whether to run the sync model instead
double SyncLatency = 3.0; // Latency in sync mode after "flash"
int SyncMax = 150; // Max value in sync model
boolean SyncRegion = false // Do agents affect only nearbys or everybody (in sync model)
int TaxPCT = 10; // Tax rate for death tax
boolean ViewAvg = true; // Whether to show average wealth of all agents
boolean ViewStDAvg = true; // Whether to show moving average of Std. Dev. of wealth of all agents
boolean ViewStDev = true; // Whether to show standard deviation of wealth of all agents
boolean ViewStats = true; // Whether to show average wealth of all agents
boolean WriteStats = false // Whether to write stats out to a file on pause or stop
if (wealth > 250)
Color = magenta;
else if (wealth > 200)
Color = pink;
else if (wealth > 150)
Color = red);
else if (wealth > 125)
Color = orange;
else if (wealth > 100)
Color = yellow;
else if (wealth > 75)
Color = cyan;
else if (wealth > 50)
Color = blue;
else if (wealth > 40)
Color = green;
else if (wealth > 30)
Color = lightGray;
else if (wealth > 20)
Color = gray;
else if (wealth > 10)
Color = darkGray;
else
Color = black;