Skip to content

Commit a10c81c

Browse files
authored
Merge pull request #25 from houssam7737/houssam/update_outdated_readme_tutorial_boltzmann
Update outdated readme for Boltmann example + trim requirements.txt
2 parents 024211d + 69dfce7 commit a10c81c

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

examples/boltzmann_wealth_model/Readme.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,36 @@
22

33
## Summary
44

5-
A simple model of agents exchanging wealth. All agents start with the same amount of money. Every step, each agent with one unit of money or more gives one unit of wealth to another random agent. This is the model described in the [Intro Tutorial](https://mesa.readthedocs.io/en/latest/tutorials/intro_tutorial.html).
5+
A simple model of agents exchanging wealth. All agents start with the same amount of money. Every step, each agent with one unit of money or more gives one unit of wealth to another random agent. This is the model described in the [Intro Tutorial](https://mesa.readthedocs.io/en/latest/tutorials/intro_tutorial.html), with the completed code.
6+
7+
If you want to go over the step-by-step tutorial, please go and run the [Jupyter Notebook](https://github.com/projectmesa/mesa/blob/main/docs/tutorials/intro_tutorial.ipynb). The code here runs the finalized code in the last cells directly.
68

79
As the model runs, the distribution of wealth among agents goes from being perfectly uniform (all agents have the same starting wealth), to highly skewed -- a small number have high wealth, more have none at all.
810

911
## How to Run
1012

11-
To follow the tutorial examples, launch the Jupyter Notebook and run the code in ``Introduction to Mesa Tutorial Code.ipynb``.
13+
To follow the tutorial example, launch the Jupyter Notebook and run the code in ``Introduction to Mesa Tutorial Code.ipynb`` which you can find in the main mesa repo [here](https://github.com/projectmesa/mesa/blob/main/docs/tutorials/intro_tutorial.ipynb)
1214

1315
To launch the interactive server, as described in the [last section of the tutorial](https://mesa.readthedocs.io/en/latest/tutorials/intro_tutorial.html#adding-visualization), run:
1416

1517
```
16-
$ python viz_money_model.py
18+
$ python server.py
19+
```
20+
21+
Make sure to install the requirements first:
22+
23+
```
24+
pip install -r requirements.txt
1725
```
1826

1927
If your browser doesn't open automatically, point it to [http://127.0.0.1:8521/](http://127.0.0.1:8521/). When the visualization loads, press Reset, then Run.
2028

2129

2230
## Files
2331

24-
* ``Introduction to Mesa Tutorial Code.ipynb``: Jupyter Notebook with all the steps as described in the tutorial.
25-
* ``money_model.py``: Final version of the model.
26-
* ``viz_money_model.py``: Creates and launches interactive visualization.
32+
* ``boltzmann_wealth_model/model.py``: Final version of the model.
33+
* ``boltzmann_wealth_model/server.py``: Code for the interactive visualization.
34+
* ``run.py``: Launches the server.
2735

2836
## Further Reading
2937

@@ -35,5 +43,3 @@ This model is drawn from econophysics and presents a statistical mechanics appro
3543
[Milakovic, M. A Statistical Equilibrium Model of Wealth Distribution. February, 2001.](https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=SCE2001&paper_id=214)
3644

3745
[Dragulescu, A and Yakovenko, V. Statistical Mechanics of Money, Income, and Wealth: A Short Survey. November, 2002](http://arxiv.org/pdf/cond-mat/0211175v1.pdf)
38-
____
39-
You will need to open the file as a Jupyter (aka iPython) notebook with an iPython 3 kernel. Required dependencies are listed in the provided `requirements.txt` file which can be installed by running `pip install -r requirements.txt`
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
jupyter
2-
matplotlib
31
mesa~=1.1
4-
numpy

0 commit comments

Comments
 (0)