Mesa 3.0.0b1__tar.gz → 3.0.0rc0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Mesa might be problematic. Click here for more details.
- mesa-3.0.0rc0/.github/pull_request_template.md +4 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.gitignore +4 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.pre-commit-config.yaml +3 -3
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/HISTORY.md +64 -4
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/PKG-INFO +1 -3
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/Schelling/schelling.py +5 -7
- mesa-3.0.0rc0/binder/environment.yml +14 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/README.md +4 -5
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/experimental.md +0 -10
- mesa-3.0.0rc0/docs/apis/visualization.md +47 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/best-practices.md +15 -20
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/conf.py +77 -1
- mesa-3.0.0rc0/docs/example_template.txt +22 -0
- mesa-3.0.0rc0/docs/examples_overview_template.txt +3 -0
- mesa-3.0.0rc0/docs/images/wolf_sheep.png +0 -0
- mesa-3.0.0rc0/docs/index.md +101 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/migration_guide.md +29 -8
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/overview.md +10 -5
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/packages.md +2 -2
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/MoneyModel.py +2 -2
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/intro_tutorial.ipynb +663 -237
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/visualization_tutorial.ipynb +204 -69
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/__init__.py +1 -3
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/agent.py +23 -8
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/batchrunner.py +26 -1
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/README.md +11 -11
- mesa-3.0.0rc0/mesa/examples/__init__.py +21 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/epstein_civil_violence/Readme.md +3 -2
- mesa-3.0.0b1/examples/advanced/epstein_civil_violence/epstein_civil_violence/agent.py → mesa-3.0.0rc0/mesa/examples/advanced/epstein_civil_violence/agents.py +44 -38
- mesa-3.0.0rc0/mesa/examples/advanced/epstein_civil_violence/app.py +73 -0
- mesa-3.0.0rc0/mesa/examples/advanced/epstein_civil_violence/model.py +114 -0
- mesa-3.0.0b1/examples/advanced/pd_grid/readme.md → mesa-3.0.0rc0/mesa/examples/advanced/pd_grid/Readme.md +4 -3
- mesa-3.0.0rc0/mesa/examples/advanced/pd_grid/app.py +54 -0
- {mesa-3.0.0b1/examples/advanced/pd_grid → mesa-3.0.0rc0/mesa/examples/advanced}/pd_grid/model.py +1 -2
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/sugarscape_g1mt/Readme.md +6 -29
- mesa-3.0.0b1/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/trader_agents.py → mesa-3.0.0rc0/mesa/examples/advanced/sugarscape_g1mt/agents.py +26 -3
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/sugarscape_g1mt/app.py +19 -18
- {mesa-3.0.0b1/examples/advanced/sugarscape_g1mt → mesa-3.0.0rc0/mesa/examples/advanced}/sugarscape_g1mt/model.py +6 -6
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/sugarscape_g1mt/tests.py +3 -6
- mesa-3.0.0rc0/mesa/examples/advanced/wolf_sheep/app.py +84 -0
- {mesa-3.0.0b1/examples/advanced/wolf_sheep → mesa-3.0.0rc0/mesa/examples/advanced}/wolf_sheep/model.py +9 -8
- mesa-3.0.0rc0/mesa/examples/basic/boid_flockers/Readme.md +22 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boid_flockers/app.py +3 -4
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boid_flockers/model.py +1 -2
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boltzmann_wealth_model/Readme.md +1 -5
- mesa-3.0.0rc0/mesa/examples/basic/boltzmann_wealth_model/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boltzmann_wealth_model/app.py +15 -12
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boltzmann_wealth_model/model.py +3 -4
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/conways_game_of_life/Readme.md +11 -7
- mesa-3.0.0rc0/mesa/examples/basic/conways_game_of_life/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/conways_game_of_life/agents.py +8 -8
- mesa-3.0.0rc0/mesa/examples/basic/conways_game_of_life/app.py +51 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/conways_game_of_life/model.py +3 -4
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/conways_game_of_life/st_app.py +2 -1
- mesa-3.0.0b1/examples/basic/schelling/README.md → mesa-3.0.0rc0/mesa/examples/basic/schelling/Readme.md +2 -9
- mesa-3.0.0rc0/mesa/examples/basic/schelling/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/schelling/app.py +6 -7
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/schelling/model.py +1 -2
- mesa-3.0.0rc0/mesa/examples/basic/virus_on_network/__init__.py +0 -0
- mesa-3.0.0rc0/mesa/examples/basic/virus_on_network/app.py +114 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/virus_on_network/model.py +4 -7
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/discrete_space.py +6 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/devs/eventlist.py +6 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/model.py +13 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/space.py +70 -35
- mesa-3.0.0rc0/mesa/visualization/__init__.py +26 -0
- mesa-3.0.0rc0/mesa/visualization/components/__init__.py +83 -0
- mesa-3.0.0rc0/mesa/visualization/components/altair_components.py +188 -0
- mesa-3.0.0rc0/mesa/visualization/components/matplotlib_components.py +176 -0
- mesa-3.0.0rc0/mesa/visualization/mpl_space_drawing.py +558 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/visualization/solara_viz.py +30 -20
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/pyproject.toml +3 -4
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_agent.py +31 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_cell_space.py +20 -0
- mesa-3.0.0rc0/tests/test_components_matplotlib.py +158 -0
- mesa-3.0.0rc0/tests/test_examples.py +72 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_model.py +15 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_solara_viz.py +59 -11
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_space.py +21 -0
- mesa-3.0.0b1/docs/apis/visualization.md +0 -21
- mesa-3.0.0b1/docs/howto.md +0 -83
- mesa-3.0.0b1/docs/images/Mesa_Screenshot.png +0 -0
- mesa-3.0.0b1/docs/index.md +0 -115
- mesa-3.0.0b1/examples/advanced/epstein_civil_violence/epstein_civil_violence/model.py +0 -146
- mesa-3.0.0b1/examples/advanced/epstein_civil_violence/epstein_civil_violence/portrayal.py +0 -33
- mesa-3.0.0b1/examples/advanced/epstein_civil_violence/epstein_civil_violence/server.py +0 -81
- mesa-3.0.0b1/examples/advanced/epstein_civil_violence/requirements.txt +0 -3
- mesa-3.0.0b1/examples/advanced/epstein_civil_violence/run.py +0 -3
- mesa-3.0.0b1/examples/advanced/pd_grid/pd_grid/portrayal.py +0 -19
- mesa-3.0.0b1/examples/advanced/pd_grid/pd_grid/server.py +0 -21
- mesa-3.0.0b1/examples/advanced/pd_grid/requirements.txt +0 -3
- mesa-3.0.0b1/examples/advanced/pd_grid/run.py +0 -3
- mesa-3.0.0b1/examples/advanced/sugarscape_g1mt/requirements.txt +0 -6
- mesa-3.0.0b1/examples/advanced/sugarscape_g1mt/run.py +0 -105
- mesa-3.0.0b1/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py +0 -26
- mesa-3.0.0b1/examples/advanced/sugarscape_g1mt/sugarscape_g1mt/server.py +0 -61
- mesa-3.0.0b1/examples/advanced/wolf_sheep/requirements.txt +0 -1
- mesa-3.0.0b1/examples/advanced/wolf_sheep/run.py +0 -3
- mesa-3.0.0b1/examples/advanced/wolf_sheep/wolf_sheep/resources/sheep.png +0 -0
- mesa-3.0.0b1/examples/advanced/wolf_sheep/wolf_sheep/resources/wolf.png +0 -0
- mesa-3.0.0b1/examples/advanced/wolf_sheep/wolf_sheep/server.py +0 -78
- mesa-3.0.0b1/examples/basic/__init__.py +0 -13
- mesa-3.0.0b1/examples/basic/boid_flockers/Readme.md +0 -43
- mesa-3.0.0b1/examples/basic/conways_game_of_life/portrayal.py +0 -18
- mesa-3.0.0b1/examples/basic/conways_game_of_life/requirements.txt +0 -1
- mesa-3.0.0b1/examples/basic/conways_game_of_life/server.py +0 -11
- mesa-3.0.0b1/examples/basic/virus_on_network/app.py +0 -133
- mesa-3.0.0b1/mesa/cookiecutter-mesa/cookiecutter.json +0 -8
- mesa-3.0.0b1/mesa/cookiecutter-mesa/hooks/post_gen_project.py +0 -13
- mesa-3.0.0b1/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/README.md +0 -4
- mesa-3.0.0b1/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/app.pytemplate +0 -27
- mesa-3.0.0b1/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/setup.pytemplate +0 -11
- mesa-3.0.0b1/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/__init__.py +0 -1
- mesa-3.0.0b1/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/model.pytemplate +0 -60
- mesa-3.0.0b1/mesa/examples.py +0 -3
- mesa-3.0.0b1/mesa/main.py +0 -65
- mesa-3.0.0b1/mesa/visualization/__init__.py +0 -15
- mesa-3.0.0b1/mesa/visualization/components/altair.py +0 -88
- mesa-3.0.0b1/mesa/visualization/components/matplotlib.py +0 -342
- mesa-3.0.0b1/tests/test_examples.py +0 -88
- mesa-3.0.0b1/tests/test_scaffold.py +0 -21
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.codespellignore +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.coveragerc +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/ISSUE_TEMPLATE/feature-request.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/PULL_REQUEST_TEMPLATE/bug.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/dependabot.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/release.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/workflows/benchmarks.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/workflows/build_lint.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.github/workflows/release.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/.readthedocs.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/CITATION.bib +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/CODE_OF_CONDUCT.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/CONTRIBUTING.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/Dockerfile +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/LICENSE +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/NOTICE +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/README.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/BoltzmannWealth/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/BoltzmannWealth/boltzmann_wealth.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/Flocking/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/Flocking/flocking.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/Schelling/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/WolfSheep/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/WolfSheep/wolf_sheep.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/compare_timings.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/configurations.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/benchmarks/global_benchmark.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/codecov.yaml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docker-compose.yml +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/Makefile +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/_static/switcher.json +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/agent.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/api_main.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/batchrunner.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/datacollection.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/model.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/space.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/apis/time.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/mesa_logo.ico +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/mesa_logo.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/br_ginis.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/dc_endwealth.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/dc_gini.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/dc_oneagent.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/first_hist.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/multirun_hist.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/numpy_grid.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/viz_chart.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/viz_empty.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/viz_greycircles.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/viz_histogram.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/images/tutorial/viz_redcircles.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/make.bat +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/mesa.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/files/viz_chart.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/files/viz_empty.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/files/viz_greycircles.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/files/viz_histogram.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/files/viz_redcircles.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/docs/tutorials/files/viz_slider.png +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/maintenance/fetch_unlabeled_prs.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/datacollection.py +0 -0
- {mesa-3.0.0b1/examples → mesa-3.0.0rc0/mesa/examples/advanced}/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb +0 -0
- {mesa-3.0.0b1/examples/advanced → mesa-3.0.0rc0/mesa/examples/advanced/epstein_civil_violence}/__init__.py +0 -0
- {mesa-3.0.0b1/examples/advanced/epstein_civil_violence/epstein_civil_violence → mesa-3.0.0rc0/mesa/examples/advanced/pd_grid}/__init__.py +0 -0
- /mesa-3.0.0b1/examples/advanced/pd_grid/pd_grid/agent.py → /mesa-3.0.0rc0/mesa/examples/advanced/pd_grid/agents.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/pd_grid/analysis.ipynb +0 -0
- {mesa-3.0.0b1/examples/advanced/pd_grid/pd_grid → mesa-3.0.0rc0/mesa/examples/advanced/sugarscape_g1mt}/__init__.py +0 -0
- {mesa-3.0.0b1/examples/advanced/sugarscape_g1mt → mesa-3.0.0rc0/mesa/examples/advanced}/sugarscape_g1mt/sugar-map.txt +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/advanced/wolf_sheep/Readme.md +0 -0
- {mesa-3.0.0b1/examples/advanced/sugarscape_g1mt/sugarscape_g1mt → mesa-3.0.0rc0/mesa/examples/advanced/wolf_sheep}/__init__.py +0 -0
- {mesa-3.0.0b1/examples/advanced/wolf_sheep → mesa-3.0.0rc0/mesa/examples/advanced}/wolf_sheep/agents.py +0 -0
- {mesa-3.0.0b1/examples/advanced/wolf_sheep → mesa-3.0.0rc0/mesa/examples/basic}/__init__.py +0 -0
- {mesa-3.0.0b1/examples/advanced/wolf_sheep/wolf_sheep → mesa-3.0.0rc0/mesa/examples/basic/boid_flockers}/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boid_flockers/agents.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boltzmann_wealth_model/agents.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/boltzmann_wealth_model/st_app.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/schelling/agents.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/schelling/analysis.ipynb +0 -0
- /mesa-3.0.0b1/examples/basic/virus_on_network/README.md → /mesa-3.0.0rc0/mesa/examples/basic/virus_on_network/Readme.md +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0/mesa}/examples/basic/virus_on_network/agents.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/UserParam.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/cell.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/cell_agent.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/cell_collection.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/grid.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/network.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/cell_space/voronoi.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/components/altair.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/components/matplotlib.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/devs/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/devs/examples/epstein_civil_violence.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/devs/examples/wolf_sheep.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/devs/simulator.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/experimental/solara_viz.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/time.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/visualization/UserParam.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mesa/visualization/utils.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/mypy.ini +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/__init__.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/read_requirements.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_batch_run.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_datacollector.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_devs.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_end_to_end_viz.sh +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_grid.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_import_namespace.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_lifespan.py +0 -0
- {mesa-3.0.0b1 → mesa-3.0.0rc0}/tests/test_time.py +0 -0
|
@@ -4,7 +4,7 @@ ci:
|
|
|
4
4
|
repos:
|
|
5
5
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
6
6
|
# Ruff version.
|
|
7
|
-
rev: v0.
|
|
7
|
+
rev: v0.7.2
|
|
8
8
|
hooks:
|
|
9
9
|
# Run the linter.
|
|
10
10
|
- id: ruff
|
|
@@ -14,12 +14,12 @@ repos:
|
|
|
14
14
|
- id: ruff-format
|
|
15
15
|
types_or: [ python, pyi, jupyter ]
|
|
16
16
|
- repo: https://github.com/asottile/pyupgrade
|
|
17
|
-
rev: v3.
|
|
17
|
+
rev: v3.19.0
|
|
18
18
|
hooks:
|
|
19
19
|
- id: pyupgrade
|
|
20
20
|
args: [--py310-plus]
|
|
21
21
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
22
|
-
rev:
|
|
22
|
+
rev: v5.0.0 # Use the ref you want to point at
|
|
23
23
|
hooks:
|
|
24
24
|
- id: trailing-whitespace
|
|
25
25
|
- id: check-toml
|
|
@@ -1,15 +1,75 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Release History
|
|
3
3
|
---
|
|
4
|
+
# 3.0.0b2 (2024-10-26)
|
|
5
|
+
## Highlights
|
|
6
|
+
Mesa 3.0 beta 2 includes major work on the example models, docs, a new tutorial and visualisation.
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
The included example models are now part of the Mesa package itself and directly importable, using:
|
|
9
|
+
```Python
|
|
10
|
+
from mesa.examples import BoidFlockers, BoltzmannWealthModel, ConwaysGameOfLife, ...
|
|
11
|
+
```
|
|
12
|
+
The advanced examples were also restructured and cleaned up.
|
|
13
|
+
|
|
14
|
+
The tutorial was completely rewritten for Mesa 3.0, including it's latest features and practices. Many of our other docs also received some love, and almost everything is now ready for Mesa 3.0.
|
|
15
|
+
|
|
16
|
+
A new feature to remove all agents from the model was added, and the visualisation now supports drawing the experimental discrete spaces in both matplotlib and altair. All agents which are in a space can now conveniently be accessed with `.agents`.
|
|
6
17
|
|
|
18
|
+
The rarely used `mesa startproject` cookiecutter feature was removed. We updated our best-practice guide to include how to structure a modern Mesa project, which is now very straightforward.
|
|
19
|
+
|
|
20
|
+
## What's Changed
|
|
21
|
+
### ⚠️ Breaking changes
|
|
22
|
+
* remove cookiecutter by @quaquel in https://github.com/projectmesa/mesa/pull/2421
|
|
23
|
+
### 🧪 Experimental features
|
|
24
|
+
* Add support for drawing discrete grids by @quaquel in https://github.com/projectmesa/mesa/pull/2386
|
|
25
|
+
* Altair spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2397
|
|
26
|
+
### 🎉 New features added
|
|
27
|
+
* remove_all_agents method added to model by @quaquel in https://github.com/projectmesa/mesa/pull/2394
|
|
28
|
+
* Pass through model.rgn in agent analogous to model.random by @quaquel in https://github.com/projectmesa/mesa/pull/2400
|
|
29
|
+
* add agents property to all spaces by @quaquel in https://github.com/projectmesa/mesa/pull/2418
|
|
30
|
+
### 🛠 Enhancements made
|
|
31
|
+
* update_tutorial environment by @tpike3 in https://github.com/projectmesa/mesa/pull/2411
|
|
32
|
+
### 🐛 Bugs fixed
|
|
33
|
+
* Fix for mistaken removal of _draw_grid by @quaquel in https://github.com/projectmesa/mesa/pull/2398
|
|
34
|
+
* fixes weakref bug in shuffe_do by @quaquel in https://github.com/projectmesa/mesa/pull/2399
|
|
35
|
+
### 🔍 Examples updated
|
|
36
|
+
* refactor: Simplify Schelling code by @rht in https://github.com/projectmesa/mesa/pull/2353
|
|
37
|
+
* Move examples into mesa by @Corvince in https://github.com/projectmesa/mesa/pull/2387
|
|
38
|
+
* Explicitly test basic examples by @quaquel in https://github.com/projectmesa/mesa/pull/2390
|
|
39
|
+
* Make example import absolute by @quaquel in https://github.com/projectmesa/mesa/pull/2402
|
|
40
|
+
* Cleanup and restructure EpsteinCivilViolence and PdGrid examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2408
|
|
41
|
+
* Reorganize advanced examples: wolf_sheep and sugarscape_g1mt by @quaquel in https://github.com/projectmesa/mesa/pull/2410
|
|
42
|
+
* reactivate ruff for advanced examples and include them in tests by @quaquel in https://github.com/projectmesa/mesa/pull/2414
|
|
43
|
+
### 📜 Documentation improvements
|
|
44
|
+
* Include examples in readthedocs (port) by @EwoutH in https://github.com/projectmesa/mesa/pull/2392
|
|
45
|
+
* Update into_tutorial by @tpike3 in https://github.com/projectmesa/mesa/pull/2372
|
|
46
|
+
* Update Schelling Readme.md by @quaquel in https://github.com/projectmesa/mesa/pull/2406
|
|
47
|
+
* Update Conway example by @quaquel in https://github.com/projectmesa/mesa/pull/2403
|
|
48
|
+
* Boltzman readme by @quaquel in https://github.com/projectmesa/mesa/pull/2405
|
|
49
|
+
* Update Readme.md of Boid flockers by @quaquel in https://github.com/projectmesa/mesa/pull/2404
|
|
50
|
+
* add advanced examples to rtd by @quaquel in https://github.com/projectmesa/mesa/pull/2413
|
|
51
|
+
* Tutorial Improvements by @tpike3 in https://github.com/projectmesa/mesa/pull/2415
|
|
52
|
+
* space: Add note that Grids are maintenance only by @EwoutH in https://github.com/projectmesa/mesa/pull/2420
|
|
53
|
+
* Migration guide: Update automatic unique_id assignment examples by @EwoutH in https://github.com/projectmesa/mesa/pull/2419
|
|
54
|
+
* Update docstring of SimEvent by @quaquel in https://github.com/projectmesa/mesa/pull/2417
|
|
55
|
+
* best-practices: Update Model Layout section by @EwoutH in https://github.com/projectmesa/mesa/pull/2424
|
|
56
|
+
* docs: Clean-up index.md by @EwoutH in https://github.com/projectmesa/mesa/pull/2422
|
|
57
|
+
### 🔧 Maintenance
|
|
58
|
+
* Add empty `pull_request_template.md` to enable PR template chooser by @EwoutH in https://github.com/projectmesa/mesa/pull/2409
|
|
59
|
+
|
|
60
|
+
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.0.0b1...v3.0.0b2
|
|
61
|
+
|
|
62
|
+
# 3.0.0b1 (2024-10-17)
|
|
7
63
|
## Highlights
|
|
8
|
-
|
|
64
|
+
Mesa 3.0 beta 1 is our last beta release before the Mesa 3.0 stable release. We are restructuring our examples and have move 9 core examples from [mesa-examples](https://github.com/projectmesa/mesa-examples) to mesa itself ([#2358](https://github.com/projectmesa/mesa/pull/2358)). The 5 basic examples are now directly importable ([#2381](https://github.com/projectmesa/mesa/pull/2381)):
|
|
65
|
+
```Python
|
|
66
|
+
from examples.basic import BoidFlockers, BoltzmannWealthModel, ConwaysGameOfLife, Schelling, VirusOnNetwork
|
|
67
|
+
```
|
|
68
|
+
The 5 basic examples will always use stable Mesa features, we are also working on 4 more advanced example which can also include experimental features.
|
|
9
69
|
|
|
10
|
-
|
|
70
|
+
All our core examples can now be viewed in the [`examples`](https://github.com/projectmesa/mesa/tree/main/examples) folder. [mesa-examples](https://github.com/projectmesa/mesa-examples) will continue to exists for user showcases. We're also working on making the examples visible in the ReadtheDocs ([#2382](https://github.com/projectmesa/mesa/pull/2382)) and on an website ([mesa-examples#139](https://github.com/projectmesa/mesa-examples/issues/139)). Follow all our work on the examples in this tracking issue [#2364](https://github.com/projectmesa/mesa/issues/2364).
|
|
11
71
|
|
|
12
|
-
|
|
72
|
+
Furthermore, the visualizations are improved by making visualization elements scalable and more clearly labeling the plots, and the Model now has an `rng` argument for an [SPEC 7](https://scientific-python.org/specs/spec-0007/) compliant NumPy random number generator ([#2352](https://github.com/projectmesa/mesa/pull/2352)). Following SPEC 7, you have to pass either `seed` or `rng`. Whichever one you pass will be used to seed both `random.Random`, and `numpy.random.Generator.`
|
|
13
73
|
|
|
14
74
|
## What's Changed
|
|
15
75
|
### ⚠️ Breaking changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: Mesa
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0rc0
|
|
4
4
|
Summary: Agent-based modeling (ABM) in Python
|
|
5
5
|
Project-URL: homepage, https://github.com/projectmesa/mesa
|
|
6
6
|
Project-URL: repository, https://github.com/projectmesa/mesa
|
|
@@ -27,7 +27,6 @@ Requires-Dist: numpy
|
|
|
27
27
|
Requires-Dist: pandas
|
|
28
28
|
Requires-Dist: tqdm
|
|
29
29
|
Provides-Extra: all
|
|
30
|
-
Requires-Dist: cookiecutter; extra == 'all'
|
|
31
30
|
Requires-Dist: ipython; extra == 'all'
|
|
32
31
|
Requires-Dist: matplotlib; extra == 'all'
|
|
33
32
|
Requires-Dist: myst-nb; extra == 'all'
|
|
@@ -43,7 +42,6 @@ Requires-Dist: seaborn; extra == 'all'
|
|
|
43
42
|
Requires-Dist: solara; extra == 'all'
|
|
44
43
|
Requires-Dist: sphinx; extra == 'all'
|
|
45
44
|
Provides-Extra: dev
|
|
46
|
-
Requires-Dist: cookiecutter; extra == 'dev'
|
|
47
45
|
Requires-Dist: matplotlib; extra == 'dev'
|
|
48
46
|
Requires-Dist: networkx; extra == 'dev'
|
|
49
47
|
Requires-Dist: pytest; extra == 'dev'
|
|
@@ -34,11 +34,10 @@ class SchellingAgent(CellAgent):
|
|
|
34
34
|
|
|
35
35
|
def step(self):
|
|
36
36
|
"""Run one step of the agent."""
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
similar += 1
|
|
37
|
+
neighbors = self.cell.get_neighborhood(radius=self.radius).agents
|
|
38
|
+
similar = len(
|
|
39
|
+
[neighbor for neighbor in neighbors if neighbor.type == self.type]
|
|
40
|
+
)
|
|
42
41
|
|
|
43
42
|
# If unhappy, move:
|
|
44
43
|
if similar < self.homophily:
|
|
@@ -76,7 +75,6 @@ class Schelling(Model):
|
|
|
76
75
|
"""
|
|
77
76
|
super().__init__(seed=seed)
|
|
78
77
|
self.simulator = simulator
|
|
79
|
-
self.minority_pc = minority_pc
|
|
80
78
|
self.happy = 0
|
|
81
79
|
|
|
82
80
|
self.grid = OrthogonalMooreGrid(
|
|
@@ -92,7 +90,7 @@ class Schelling(Model):
|
|
|
92
90
|
# its contents. (coord_iter)
|
|
93
91
|
for cell in self.grid:
|
|
94
92
|
if self.random.random() < density:
|
|
95
|
-
agent_type = 1 if self.random.random() <
|
|
93
|
+
agent_type = 1 if self.random.random() < minority_pc else 0
|
|
96
94
|
SchellingAgent(self, agent_type, radius, homophily, cell)
|
|
97
95
|
|
|
98
96
|
def step(self):
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
Docs for Mesa
|
|
2
|
-
=============
|
|
1
|
+
# Docs for Mesa
|
|
3
2
|
|
|
4
3
|
The readable version of the docs is hosted at [mesa.readthedocs.org](http://mesa.readthedocs.org/).
|
|
5
4
|
|
|
6
5
|
This folder contains the docs that build the docs for the core mesa code on readthdocs.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## How to publish updates to the docs
|
|
9
8
|
|
|
10
9
|
Updating docs can be confusing. Here are the basic setups.
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
#### Submit a pull request with updates
|
|
13
12
|
1. Create branch (either via branching or fork of repo) -- try to use a descriptive name.
|
|
14
13
|
* `git checkout -b doc-updates`
|
|
15
14
|
1. Update the docs. Save.
|
|
@@ -23,7 +22,7 @@ Updating docs can be confusing. Here are the basic setups.
|
|
|
23
22
|
* `git push origin doc-updates`
|
|
24
23
|
1. From here you will want to submit a pull request to main.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
#### Update read the docs
|
|
27
26
|
|
|
28
27
|
From this point, you will need to find someone that has access to readthedocs. Currently, that is [@jackiekazil](https://github.com/jackiekazil), [@rht](https://github.com/rht), and [@tpike3](https://github.com/dmasad).
|
|
29
28
|
|
|
@@ -3,11 +3,6 @@ This namespace contains experimental features. These are under development, and
|
|
|
3
3
|
|
|
4
4
|
## Cell Space
|
|
5
5
|
|
|
6
|
-
```{eval-rst}
|
|
7
|
-
.. automodule:: experimental.cell_space.__init__
|
|
8
|
-
:members:
|
|
9
|
-
```
|
|
10
|
-
|
|
11
6
|
```{eval-rst}
|
|
12
7
|
.. automodule:: experimental.cell_space.cell
|
|
13
8
|
:members:
|
|
@@ -40,11 +35,6 @@ This namespace contains experimental features. These are under development, and
|
|
|
40
35
|
|
|
41
36
|
## Devs
|
|
42
37
|
|
|
43
|
-
```{eval-rst}
|
|
44
|
-
.. automodule:: experimental.devs.__init__
|
|
45
|
-
:members:
|
|
46
|
-
```
|
|
47
|
-
|
|
48
38
|
```{eval-rst}
|
|
49
39
|
.. automodule:: experimental.devs.eventlist
|
|
50
40
|
:members:
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Visualization
|
|
2
|
+
|
|
3
|
+
For a detailed tutorial, please refer to our [Visualization Tutorial](../tutorials/visualization_tutorial.ipynb).
|
|
4
|
+
|
|
5
|
+
## Jupyter Visualization
|
|
6
|
+
|
|
7
|
+
```{eval-rst}
|
|
8
|
+
.. automodule:: mesa.visualization.solara_viz
|
|
9
|
+
:members:
|
|
10
|
+
:undoc-members:
|
|
11
|
+
:show-inheritance:
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## User Parameters
|
|
15
|
+
|
|
16
|
+
```{eval-rst}
|
|
17
|
+
.. automodule:: mesa.visualization.UserParam
|
|
18
|
+
:members:
|
|
19
|
+
:undoc-members:
|
|
20
|
+
:show-inheritance:
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Matplotlib-based visualizations
|
|
25
|
+
|
|
26
|
+
```{eval-rst}
|
|
27
|
+
.. automodule:: mesa.visualization.components.matplotlib_components
|
|
28
|
+
:members:
|
|
29
|
+
:undoc-members:
|
|
30
|
+
:show-inheritance:
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```{eval-rst}
|
|
34
|
+
.. automodule:: mesa.visualization.mpl_space_drawing
|
|
35
|
+
:members:
|
|
36
|
+
:undoc-members:
|
|
37
|
+
:show-inheritance:
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Altair-based visualizations
|
|
41
|
+
|
|
42
|
+
```{eval-rst}
|
|
43
|
+
.. automodule:: mesa.visualization.components.altair_components
|
|
44
|
+
:members:
|
|
45
|
+
:undoc-members:
|
|
46
|
+
:show-inheritance:
|
|
47
|
+
```
|
|
@@ -5,26 +5,21 @@ Here are some general principles that have proven helpful for developing models.
|
|
|
5
5
|
## Model Layout
|
|
6
6
|
|
|
7
7
|
A model should be contained in a folder named with lower-case letters and
|
|
8
|
-
underscores, such as `
|
|
9
|
-
|
|
10
|
-
- `
|
|
11
|
-
|
|
12
|
-
- `
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- `
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
The [Schelling](https://github.com/projectmesa/mesa-examples/tree/main/examples/schelling) model is
|
|
25
|
-
a good example of a small well-packaged model.
|
|
26
|
-
|
|
27
|
-
It's easy to create a cookiecutter mesa model by running `mesa startproject`
|
|
8
|
+
underscores, such as `wolf_sheep`. Within that directory:
|
|
9
|
+
|
|
10
|
+
- `Readme.md` describes the model, how to use it, and any other details.
|
|
11
|
+
- `model.py` should contain the model class.
|
|
12
|
+
- `agents.py` should contain the agent class(es).
|
|
13
|
+
- `app.py` should contain the Solara-based visualization code (optional).
|
|
14
|
+
|
|
15
|
+
You can add more files as needed, for example:
|
|
16
|
+
- `run.py` could contain the code to run the model.
|
|
17
|
+
- `batch_run.py` could contain the code to run the model multiple times.
|
|
18
|
+
- `analysis.py` could contain any analysis code.
|
|
19
|
+
|
|
20
|
+
Input data can be stored in a `data` directory, output data in an `output`, processed results in a `results` directory, images in an `images` directory, etc.
|
|
21
|
+
|
|
22
|
+
All our [examples](examples) follow this layout.
|
|
28
23
|
|
|
29
24
|
## Randomization
|
|
30
25
|
|
|
@@ -14,14 +14,17 @@
|
|
|
14
14
|
# serve to show the default.
|
|
15
15
|
|
|
16
16
|
import os
|
|
17
|
+
import os.path as osp
|
|
18
|
+
import pathlib
|
|
17
19
|
import sys
|
|
20
|
+
import string
|
|
18
21
|
from datetime import date
|
|
19
22
|
|
|
20
23
|
# If extensions (or modules to document with autodoc) are in another directory,
|
|
21
24
|
# add these directories to sys.path here. If the directory is relative to the
|
|
22
25
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
26
|
+
HERE = osp.abspath(osp.dirname(__file__))
|
|
23
27
|
sys.path.insert(0, os.path.abspath("."))
|
|
24
|
-
sys.path.insert(0, "../examples")
|
|
25
28
|
sys.path.insert(0, "../mesa")
|
|
26
29
|
|
|
27
30
|
|
|
@@ -289,3 +292,76 @@ texinfo_documents = [
|
|
|
289
292
|
|
|
290
293
|
# Example configuration for intersphinx: refer to the Python standard library.
|
|
291
294
|
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def write_example_md_file(agent_filename, model_filename, readme_filename, app_filename, md_filepath, template):
|
|
299
|
+
with open(agent_filename) as content_file:
|
|
300
|
+
agent_file = content_file.read()
|
|
301
|
+
with open(model_filename) as content_file:
|
|
302
|
+
model_file = content_file.read()
|
|
303
|
+
with open(readme_filename) as content_file:
|
|
304
|
+
readme_file = content_file.read()
|
|
305
|
+
with open(app_filename) as content_file:
|
|
306
|
+
app_file = content_file.read()
|
|
307
|
+
|
|
308
|
+
with open(md_filepath, "w") as fh:
|
|
309
|
+
content = template.substitute(
|
|
310
|
+
dict(agent_file=agent_file, model_file=model_file,
|
|
311
|
+
readme_file=readme_file, app_file=app_file)
|
|
312
|
+
)
|
|
313
|
+
fh.write(content)
|
|
314
|
+
|
|
315
|
+
def setup_examples_pages():
|
|
316
|
+
# create md files for all examples
|
|
317
|
+
# check what examples exist
|
|
318
|
+
examples_folder = osp.abspath(osp.join(HERE, "..", "mesa", "examples"))
|
|
319
|
+
basic_examples = [("basic", f.path) for f in os.scandir(osp.join(examples_folder, "basic")) if f.is_dir() and not f.name.startswith("__") ]
|
|
320
|
+
advanced_examples = [("advanced", f.path) for f in os.scandir(osp.join(examples_folder, "advanced")) if f.is_dir() and not f.name.startswith("__")]
|
|
321
|
+
examples = basic_examples + advanced_examples
|
|
322
|
+
|
|
323
|
+
with open(os.path.join(HERE, "example_template.txt")) as fh:
|
|
324
|
+
template = string.Template(fh.read())
|
|
325
|
+
|
|
326
|
+
root_folder = pathlib.Path(os.path.join(HERE, "examples"))
|
|
327
|
+
root_folder.mkdir(parents=True, exist_ok=True)
|
|
328
|
+
pathlib.Path(os.path.join(root_folder, "basic")).mkdir(parents=True, exist_ok=True)
|
|
329
|
+
pathlib.Path(os.path.join(root_folder, "advanced")).mkdir(parents=True, exist_ok=True)
|
|
330
|
+
|
|
331
|
+
examples_md = []
|
|
332
|
+
for kind, example in examples:
|
|
333
|
+
base_name = os.path.basename(os.path.normpath(example))
|
|
334
|
+
|
|
335
|
+
agent_filename = os.path.join(example, "agents.py")
|
|
336
|
+
model_filename = os.path.join(example, "model.py")
|
|
337
|
+
readme_filename = os.path.join(example, "Readme.md")
|
|
338
|
+
app_filename = os.path.join(example, "app.py")
|
|
339
|
+
|
|
340
|
+
md_filename = f"{base_name}.md"
|
|
341
|
+
examples_md.append(base_name)
|
|
342
|
+
|
|
343
|
+
md_filepath = os.path.join(HERE, "examples", kind, md_filename)
|
|
344
|
+
write_example_md_file(agent_filename, model_filename, readme_filename, app_filename, md_filepath, template)
|
|
345
|
+
|
|
346
|
+
# create overview of examples.md
|
|
347
|
+
with open(os.path.join(HERE, "examples_overview_template.txt")) as fh:
|
|
348
|
+
template = string.Template(fh.read())
|
|
349
|
+
|
|
350
|
+
with open(os.path.join(examples_folder, "README.md")) as fh:
|
|
351
|
+
readme_md = fh.read()
|
|
352
|
+
|
|
353
|
+
with open(os.path.join(HERE, "examples.md"), "w") as fh:
|
|
354
|
+
content = template.substitute(
|
|
355
|
+
dict(
|
|
356
|
+
readme=readme_md,
|
|
357
|
+
# examples="\n".join([f"{' '.join(base_name.split('_'))} </examples/{base_name}>" for base_name in examples_md]),
|
|
358
|
+
)
|
|
359
|
+
)
|
|
360
|
+
fh.write(content)
|
|
361
|
+
|
|
362
|
+
def setup(app):
|
|
363
|
+
setup_examples_pages()
|
|
364
|
+
|
|
365
|
+
#
|
|
366
|
+
if __name__ == "__main__":
|
|
367
|
+
setup_examples_pages()
|
|
Binary file
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Mesa: Agent-based modeling in Python
|
|
2
|
+
|
|
3
|
+
```{image} https://github.com/projectmesa/mesa/workflows/build/badge.svg
|
|
4
|
+
:target: https://github.com/projectmesa/mesa/actions
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
```{image} https://codecov.io/gh/projectmesa/mesa/branch/main/graph/badge.svg
|
|
8
|
+
:target: https://codecov.io/gh/projectmesa/mesa
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```{image} https://img.shields.io/badge/code%20style-black-000000.svg
|
|
12
|
+
:target: https://github.com/psf/black
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```{image} https://img.shields.io/matrix/project-mesa:matrix.org?label=chat&logo=Matrix
|
|
16
|
+
:target: https://matrix.to/#/#project-mesa:matrix.org
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
[Mesa] is an Apache2 licensed agent-based modeling (or ABM) framework in Python.
|
|
20
|
+
|
|
21
|
+
Mesa allows users to quickly create agent-based models using built-in core components (such as spatial grids and agent schedulers) or customized implementations; visualize them using a browser-based interface; and analyze their results using Python's data analysis tools. Its goal is to be the Python-based counterpart to NetLogo, Repast, or MASON.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
*A visualisation of the Wolf Sheep model build with Mesa.*
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Built-in core modeling components
|
|
29
|
+
- Flexible agent and model management through AgentSet
|
|
30
|
+
- Browser-based Solara visualization
|
|
31
|
+
- Built-in tools for data collection and analysis
|
|
32
|
+
- Example model library
|
|
33
|
+
|
|
34
|
+
## Using Mesa
|
|
35
|
+
### Installation Options
|
|
36
|
+
|
|
37
|
+
To install our latest stable release (2.4.x), run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install -U mesa
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
To install our latest Mesa 3.0 beta with recommended dependencies:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pip install -U --pre mesa[rec]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Resources
|
|
50
|
+
|
|
51
|
+
For help getting started with Mesa, check out these resources:
|
|
52
|
+
|
|
53
|
+
- [Mesa Overview] - Learn about Mesa's core concepts and components
|
|
54
|
+
- [Mesa Introductory Tutorial] - Build your first agent-based model
|
|
55
|
+
- [Mesa Visualization Tutorial] - Learn how to create interactive visualizations with Solara
|
|
56
|
+
- [Migration Guide] - Upgrade to Mesa 3.0
|
|
57
|
+
- [Mesa Examples] - Browse user-contributed models and implementations
|
|
58
|
+
- [GitHub Discussions] - Ask questions and discuss Mesa
|
|
59
|
+
- [Matrix Chat Room] - Real-time chat with the Mesa community
|
|
60
|
+
|
|
61
|
+
### Development and Support
|
|
62
|
+
|
|
63
|
+
Mesa is an open source project and welcomes contributions:
|
|
64
|
+
|
|
65
|
+
- [GitHub Repository] - Access the source code
|
|
66
|
+
- [Issue Tracker] - Report bugs or suggest features
|
|
67
|
+
- [Contributors Guide] - Learn how to contribute
|
|
68
|
+
|
|
69
|
+
The original Mesa conference paper is [available here](http://conference.scipy.org.s3-website-us-east-1.amazonaws.com/proceedings/scipy2015/jacqueline_kazil.html).
|
|
70
|
+
|
|
71
|
+
```{toctree}
|
|
72
|
+
:hidden: true
|
|
73
|
+
:maxdepth: 7
|
|
74
|
+
|
|
75
|
+
Mesa Overview <overview>
|
|
76
|
+
tutorials/intro_tutorial
|
|
77
|
+
tutorials/visualization_tutorial
|
|
78
|
+
Examples <examples>
|
|
79
|
+
Migration guide <migration_guide>
|
|
80
|
+
Best Practices <best-practices>
|
|
81
|
+
API Documentation <apis/api_main>
|
|
82
|
+
Mesa Packages <packages>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
# Indices and tables
|
|
86
|
+
|
|
87
|
+
- {ref}`genindex`
|
|
88
|
+
- {ref}`modindex`
|
|
89
|
+
- {ref}`search`
|
|
90
|
+
|
|
91
|
+
[contributors guide]: https://github.com/projectmesa/mesa/blob/main/CONTRIBUTING.md
|
|
92
|
+
[github repository]: https://github.com/projectmesa/mesa/
|
|
93
|
+
[github discussions]: https://github.com/projectmesa/mesa/discussions
|
|
94
|
+
[issue tracker]: https://github.com/projectmesa/mesa/issues
|
|
95
|
+
[matrix chat room]: https://matrix.to/#/#project-mesa:matrix.org
|
|
96
|
+
[mesa]: https://github.com/projectmesa/mesa/
|
|
97
|
+
[mesa overview]: overview
|
|
98
|
+
[mesa examples]: https://github.com/projectmesa/mesa-examples
|
|
99
|
+
[mesa introductory tutorial]: tutorials/intro_tutorial
|
|
100
|
+
[mesa visualization tutorial]: tutorials/visualization_tutorial
|
|
101
|
+
[migration guide]: migration_guide
|
|
@@ -74,15 +74,32 @@ In Mesa 3.0, `unique_id` for agents is now automatically assigned, simplifying a
|
|
|
74
74
|
1. Remove `unique_id` from agent initialization:
|
|
75
75
|
```python
|
|
76
76
|
# Old
|
|
77
|
+
agent = MyAgent(unique_id=unique_id, model=self, ...)
|
|
78
|
+
agent = MyAgent(unique_id, self, ...)
|
|
77
79
|
agent = MyAgent(self.next_id(), self, ...)
|
|
78
80
|
|
|
79
81
|
# New
|
|
82
|
+
agent = MyAgent(model=self, ...)
|
|
80
83
|
agent = MyAgent(self, ...)
|
|
81
84
|
```
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
|
|
86
|
+
2. Remove `unique_id` from Agent super() call:
|
|
87
|
+
```python
|
|
88
|
+
# Old
|
|
89
|
+
class MyAgent(Agent):
|
|
90
|
+
def __init__(self, unique_id, model, ...):
|
|
91
|
+
super().__init__(unique_id, model)
|
|
92
|
+
|
|
93
|
+
# New
|
|
94
|
+
class MyAgent(Agent):
|
|
95
|
+
def __init__(self, model, ...):
|
|
96
|
+
super().__init__(model)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
3. Important notes:
|
|
100
|
+
- `unique_id` is now automatically assigned relative to a Model instance and starts from 1
|
|
101
|
+
- `Model.next_id()` is removed
|
|
102
|
+
- If you previously used custom `unique_id` values, store that information in a separate attribute
|
|
86
103
|
|
|
87
104
|
- Ref: [PR #2226](https://github.com/projectmesa/mesa/pull/2226), [PR #2260](https://github.com/projectmesa/mesa/pull/2260), Mesa-examples [PR #194](https://github.com/projectmesa/mesa-examples/pull/194), [Issue #2213](https://github.com/projectmesa/mesa/issues/2213)
|
|
88
105
|
|
|
@@ -236,6 +253,8 @@ Ref: Original discussion [#1912](https://github.com/projectmesa/mesa/discussions
|
|
|
236
253
|
Mesa has adopted a new API for our frontend. If you already migrated to the experimental new SolaraViz you can still use
|
|
237
254
|
the import from mesa.experimental. Otherwise here is a list of things you need to change.
|
|
238
255
|
|
|
256
|
+
> **Note:** SolaraViz is experimental and still in active development for Mesa 3.0. While we attempt to minimize them, there might be API breaking changes between Mesa 3.0 and 3.1. There won't be breaking changes between Mesa 3.0.x patch releases.
|
|
257
|
+
|
|
239
258
|
#### Model Initialization
|
|
240
259
|
|
|
241
260
|
Previously SolaraViz was initialized by providing a `model_cls` and a `model_params`. This has changed to expect a model instance `model`. You can still provide (user-settable) `model_params`, but only if users should be able to change them. It is now also possible to pass in a "reactive model" by first calling `model = solara.reactive(model)`. This is useful for notebook environments. It allows you to pass the model to the SolaraViz Module, but continue to use the model. For example calling `model.value.step()` (notice the extra .value) will automatically update the plots. This currently only automatically works for the step method, you can force visualization updates by calling `model.value.force_update()`.
|
|
@@ -251,9 +270,9 @@ from mesa.experimental import SolaraViz
|
|
|
251
270
|
SolaraViz(model_cls, model_params, agent_portrayal=agent_portrayal)
|
|
252
271
|
|
|
253
272
|
# new
|
|
254
|
-
from mesa.visualization import SolaraViz,
|
|
273
|
+
from mesa.visualization import SolaraViz, make_space_component
|
|
255
274
|
|
|
256
|
-
SolaraViz(model, components=[
|
|
275
|
+
SolaraViz(model, components=[make_space_component(agent_portrayal)])
|
|
257
276
|
```
|
|
258
277
|
|
|
259
278
|
#### Plotting "measures"
|
|
@@ -264,15 +283,17 @@ SolaraViz(model, components=[make_space_matplotlib(agent_portrayal)])
|
|
|
264
283
|
# old
|
|
265
284
|
from mesa.experimental import SolaraViz
|
|
266
285
|
|
|
286
|
+
|
|
267
287
|
def make_plot(model):
|
|
268
288
|
...
|
|
269
289
|
|
|
290
|
+
|
|
270
291
|
SolaraViz(model_cls, model_params, measures=[make_plot, "foo", ["bar", "baz"]])
|
|
271
292
|
|
|
272
293
|
# new
|
|
273
|
-
from mesa.visualization import SolaraViz,
|
|
294
|
+
from mesa.visualization import SolaraViz, make_plot_component
|
|
274
295
|
|
|
275
|
-
SolaraViz(model, components=[make_plot,
|
|
296
|
+
SolaraViz(model, components=[make_plot, make_plot_component("foo"), make_plot_component("bar", "baz")])
|
|
276
297
|
```
|
|
277
298
|
|
|
278
299
|
#### Plotting text
|