Py.Cafe

tpike3/

wealth-inequality-simulation

Wealth Inequality Simulation

DocsPricing
  • app.py
  • model.py
  • requirements.txt
  • utilities.py
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 10 06:43:47 2024

@author: thoma
"""

from model import WealthModel
from model import Histogram, Churn, Wealth
from mesa.visualization import SolaraViz,make_plot_component


model = WealthModel()
model_params = {
    "policy": {
        "type": "Select",
        "value": "econophysics",
        "values": ["econophysics", "powerful leaders","equal wealth distribution", "innovation"],
        "text": "Select Policy"
    }
}

wealth_plot = make_plot_component("Gini")

Page = SolaraViz(
    model, 
    components=[Churn, wealth_plot, Wealth, Histogram],
    model_params=model_params,
)