# CHARITY WORLD

## CONTENTS

## Demo

Coin's value = 0.4 | Coin's value = 1 (or 0.5, or 0.25) |

Initial wealth minus two coins. | Initial wealth. | Initial wealth plus two coins. | A transaction has taken place between the two agents on the bottom. |

Initial wealth minus one coin. | Initial wealth plus one coin. | ||

Initial wealth minus a fraction of a coin. | Initial wealth plus a fraction of a coin. |

## Explanation of Demo

The two movies above show the same model running with two different parameter settings. In this model, the square grid of size 50x50 is filled with 2500 stationary agents, one per cell. Agents are endowed with an initial wealth, which is **the same for all of them** and, in principle, not relevant for the model. The following might be easier to understand if you assume that agents' initial wealth is two coins.

At the beginning of the simulation agents participate in a lottery with jackpot 5000 coins, for what they have to pay 2 coins as the ticket-price. The agent at location [25,25] happens to be the winner of the lottery so, at cycle 0, its wealth has increased in 4998 coins (5000-2) while the other 2499 agents' wealth has decreased in 2 coins (see cycle 0 in the movies. Please, note that the winner is coloured in a different shade of green from that denoting 'Initial wealth plus two coins').

Our agents have a strong craving for equality, so if they are richer than their neighbourhood average, they are prepared to donate a coin to some of their poorer neighbours (an agent's neighbours are those with whom the agent shares an edge or a corner). More specifically, an agent considers its neighbours in ascending order of wealth, and gives a coin to each of them (one neighbour at a time) as long as the considered neighbour has less wealth than the donating agent's neighbourhood average and the donating agent has more wealth than its neighbourhood average. This process is called the * cycle of redistribution*.

Scheduling in the model is dynamic in that agents put themselves on a schedule-list of potential donors (or * donors list*) if they are richer than their neighbourhood average. Immediately after the lottery has taken place, each agent is asked to determine whether it is to be put on the donors list. At that time, only the jackpot winner joins the donors list.

The first cycle of redistribution in the above simulation runs consists of the lottery winner giving a coin to each of its neighbours. After this wealth exchange is completed, every agent involved in the cycle of redistribution is asked to determine whether it is to join the donors list.

From then on, an agent is selected randomly from the donors list and it is asked to perform a cycle of redistribution. Subsequently, the agents involved in the redistribution cycle are given the opportunity to join the donors list. This completes a * simulation cycle*. Since only agents who are richer than their neighbourhood average join the donors list, the lottery winner is the only one on the donors list for the first 357 cycles. At the end of cycle 358 the donors list is composed of the lottery winner and its corner neighbours.

The movie on the left shows a simulation run in which coins have a value of 0.4, whereas coins in the movie on the right have a value of 1 (or e.g. 0.5 or 0.25, since the three runs show exactly the same output). When coins have a value of 0.4 the simulation never finishes and agents keep exchanging coins forever. However, when coins have a value of 1 (or 0.5 or 0.25), the simulation terminates (the donors list is empty) at cycle 827,651 with all the agents having the initial wealth. In the former case wealth is never redistributed, whereas in the latter case wealth is successfully redistributed. However, the same initial seed has been used for both simulations. In terms of number of coins owned by each agent, donors list's contents and coin exchanges, both simulations should give exactly the same outcome at any time (as it happens with coins' value = 1, 0.5, and 0,25). In those terms the two simulation runs are mathematically equivalent. So what's wrong? The coins' value should not have any effect whatsoever on this model, but it does. What is happening here? Floating-point arithmetic is the answer to this question...

## Download section

From this page, you can download **CharityWorld** model source code.
This source code is released under the
GNU General Public Licence.
Clicking any of the **CharityWorld** model source download links will be taken as
an assertion that you agree to abide by the terms of this licence.
To use **CharityWorld**, you will need to download
Swarm,
an agent-based modelling toolkit. We use Swarm in Windows and Solaris
platforms, and the links to versions of Swarm are for those that the
model has been successfully compiled with.

Source | Parameter files | Windows Swarm version | Solaris Swarm version |
---|---|---|---|

CharityWorld ( 69K ) |
examples ( 15M ) |
Swarm 2.1.1 (binary) | Swarm snapshot 2001-12-18 (source) |

We'd really appreciate it if you would also be prepared to fill out the
form below, letting us know of your interest in **CharityWorld**, though you
are not obliged to do so.