Mesa 3.0.0rc0__tar.gz → 3.0.2__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.

Files changed (201) hide show
  1. {mesa-3.0.0rc0 → mesa-3.0.2}/HISTORY.md +214 -0
  2. {mesa-3.0.0rc0 → mesa-3.0.2}/PKG-INFO +6 -8
  3. {mesa-3.0.0rc0 → mesa-3.0.2}/README.md +5 -5
  4. {mesa-3.0.0rc0 → mesa-3.0.2}/benchmarks/configurations.py +1 -4
  5. {mesa-3.0.0rc0 → mesa-3.0.2}/benchmarks/global_benchmark.py +8 -8
  6. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/experimental.md +10 -0
  7. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/visualization.md +1 -1
  8. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/best-practices.md +9 -5
  9. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/conf.py +5 -3
  10. mesa-3.0.2/docs/examples_overview_template.txt +13 -0
  11. mesa-3.0.0rc0/docs/overview.md → mesa-3.0.2/docs/getting_started.md +41 -12
  12. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/index.md +11 -11
  13. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/migration_guide.md +3 -3
  14. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/MoneyModel.py +3 -4
  15. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/visualization_tutorial.ipynb +1 -1
  16. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/__init__.py +1 -1
  17. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/agent.py +15 -3
  18. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/__init__.py +2 -2
  19. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/epstein_civil_violence/Readme.md +2 -4
  20. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/pd_grid/app.py +1 -1
  21. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/pd_grid/model.py +1 -1
  22. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/app.py +18 -2
  23. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/model.py +3 -1
  24. mesa-3.0.2/mesa/examples/advanced/wolf_sheep/agents.py +116 -0
  25. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/wolf_sheep/app.py +17 -6
  26. mesa-3.0.2/mesa/examples/advanced/wolf_sheep/model.py +131 -0
  27. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boid_flockers/agents.py +48 -16
  28. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boid_flockers/app.py +2 -5
  29. mesa-3.0.2/mesa/examples/basic/boid_flockers/model.py +105 -0
  30. mesa-3.0.2/mesa/examples/basic/boltzmann_wealth_model/agents.py +49 -0
  31. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boltzmann_wealth_model/app.py +8 -3
  32. mesa-3.0.2/mesa/examples/basic/boltzmann_wealth_model/model.py +78 -0
  33. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boltzmann_wealth_model/st_app.py +2 -2
  34. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/conways_game_of_life/app.py +25 -3
  35. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/conways_game_of_life/model.py +2 -2
  36. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/schelling/agents.py +9 -5
  37. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/schelling/app.py +1 -1
  38. mesa-3.0.2/mesa/examples/basic/schelling/model.py +81 -0
  39. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/virus_on_network/Readme.md +2 -13
  40. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/virus_on_network/app.py +1 -1
  41. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/cell_collection.py +14 -2
  42. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/discrete_space.py +16 -2
  43. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/devs/simulator.py +59 -14
  44. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/model.py +4 -4
  45. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/time.py +4 -4
  46. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/__init__.py +1 -1
  47. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/components/matplotlib_components.py +1 -2
  48. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/mpl_space_drawing.py +42 -7
  49. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/solara_viz.py +133 -54
  50. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_cell_space.py +66 -33
  51. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_components_matplotlib.py +83 -4
  52. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_devs.py +42 -2
  53. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_examples.py +41 -5
  54. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_solara_viz.py +19 -2
  55. mesa-3.0.0rc0/benchmarks/BoltzmannWealth/__init__.py +0 -1
  56. mesa-3.0.0rc0/benchmarks/BoltzmannWealth/boltzmann_wealth.py +0 -112
  57. mesa-3.0.0rc0/benchmarks/Flocking/__init__.py +0 -1
  58. mesa-3.0.0rc0/benchmarks/Flocking/flocking.py +0 -156
  59. mesa-3.0.0rc0/benchmarks/Schelling/__init__.py +0 -1
  60. mesa-3.0.0rc0/benchmarks/Schelling/schelling.py +0 -113
  61. mesa-3.0.0rc0/benchmarks/WolfSheep/__init__.py +0 -1
  62. mesa-3.0.0rc0/benchmarks/WolfSheep/wolf_sheep.py +0 -231
  63. mesa-3.0.0rc0/docs/examples_overview_template.txt +0 -3
  64. mesa-3.0.0rc0/docs/packages.md +0 -110
  65. mesa-3.0.0rc0/mesa/examples/advanced/wolf_sheep/agents.py +0 -102
  66. mesa-3.0.0rc0/mesa/examples/advanced/wolf_sheep/model.py +0 -137
  67. mesa-3.0.0rc0/mesa/examples/basic/boid_flockers/model.py +0 -69
  68. mesa-3.0.0rc0/mesa/examples/basic/boltzmann_wealth_model/agents.py +0 -31
  69. mesa-3.0.0rc0/mesa/examples/basic/boltzmann_wealth_model/model.py +0 -43
  70. mesa-3.0.0rc0/mesa/examples/basic/schelling/model.py +0 -59
  71. {mesa-3.0.0rc0 → mesa-3.0.2}/.codespellignore +0 -0
  72. {mesa-3.0.0rc0 → mesa-3.0.2}/.coveragerc +0 -0
  73. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
  74. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  75. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/ISSUE_TEMPLATE/feature-request.md +0 -0
  76. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/PULL_REQUEST_TEMPLATE/bug.md +0 -0
  77. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  78. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/dependabot.yml +0 -0
  79. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/pull_request_template.md +0 -0
  80. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/release.yml +0 -0
  81. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/workflows/benchmarks.yml +0 -0
  82. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/workflows/build_lint.yml +0 -0
  83. {mesa-3.0.0rc0 → mesa-3.0.2}/.github/workflows/release.yml +0 -0
  84. {mesa-3.0.0rc0 → mesa-3.0.2}/.gitignore +0 -0
  85. {mesa-3.0.0rc0 → mesa-3.0.2}/.pre-commit-config.yaml +0 -0
  86. {mesa-3.0.0rc0 → mesa-3.0.2}/.readthedocs.yml +0 -0
  87. {mesa-3.0.0rc0 → mesa-3.0.2}/CITATION.bib +0 -0
  88. {mesa-3.0.0rc0 → mesa-3.0.2}/CODE_OF_CONDUCT.md +0 -0
  89. {mesa-3.0.0rc0 → mesa-3.0.2}/CONTRIBUTING.md +0 -0
  90. {mesa-3.0.0rc0 → mesa-3.0.2}/Dockerfile +0 -0
  91. {mesa-3.0.0rc0 → mesa-3.0.2}/LICENSE +0 -0
  92. {mesa-3.0.0rc0 → mesa-3.0.2}/NOTICE +0 -0
  93. {mesa-3.0.0rc0 → mesa-3.0.2}/benchmarks/compare_timings.py +0 -0
  94. {mesa-3.0.0rc0 → mesa-3.0.2}/binder/environment.yml +0 -0
  95. {mesa-3.0.0rc0 → mesa-3.0.2}/codecov.yaml +0 -0
  96. {mesa-3.0.0rc0 → mesa-3.0.2}/docker-compose.yml +0 -0
  97. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/Makefile +0 -0
  98. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/README.md +0 -0
  99. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/_static/switcher.json +0 -0
  100. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/agent.md +0 -0
  101. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/api_main.md +0 -0
  102. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/batchrunner.md +0 -0
  103. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/datacollection.md +0 -0
  104. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/model.md +0 -0
  105. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/space.md +0 -0
  106. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/apis/time.md +0 -0
  107. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/example_template.txt +0 -0
  108. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/mesa_logo.ico +0 -0
  109. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/mesa_logo.png +0 -0
  110. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/br_ginis.png +0 -0
  111. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/dc_endwealth.png +0 -0
  112. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/dc_gini.png +0 -0
  113. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/dc_oneagent.png +0 -0
  114. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/first_hist.png +0 -0
  115. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/multirun_hist.png +0 -0
  116. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/numpy_grid.png +0 -0
  117. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/viz_chart.png +0 -0
  118. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/viz_empty.png +0 -0
  119. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/viz_greycircles.png +0 -0
  120. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/viz_histogram.png +0 -0
  121. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/tutorial/viz_redcircles.png +0 -0
  122. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/images/wolf_sheep.png +0 -0
  123. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/make.bat +0 -0
  124. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/mesa.md +0 -0
  125. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/files/viz_chart.png +0 -0
  126. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/files/viz_empty.png +0 -0
  127. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/files/viz_greycircles.png +0 -0
  128. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/files/viz_histogram.png +0 -0
  129. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/files/viz_redcircles.png +0 -0
  130. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/files/viz_slider.png +0 -0
  131. {mesa-3.0.0rc0 → mesa-3.0.2}/docs/tutorials/intro_tutorial.ipynb +0 -0
  132. {mesa-3.0.0rc0 → mesa-3.0.2}/maintenance/fetch_unlabeled_prs.py +0 -0
  133. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/batchrunner.py +0 -0
  134. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/datacollection.py +0 -0
  135. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/README.md +0 -0
  136. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/__init__.py +0 -0
  137. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb +0 -0
  138. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/epstein_civil_violence/__init__.py +0 -0
  139. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/epstein_civil_violence/agents.py +0 -0
  140. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/epstein_civil_violence/app.py +0 -0
  141. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/epstein_civil_violence/model.py +0 -0
  142. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/pd_grid/Readme.md +0 -0
  143. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/pd_grid/__init__.py +0 -0
  144. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/pd_grid/agents.py +0 -0
  145. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/pd_grid/analysis.ipynb +0 -0
  146. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/Readme.md +0 -0
  147. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/__init__.py +0 -0
  148. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/agents.py +0 -0
  149. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/sugar-map.txt +0 -0
  150. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/sugarscape_g1mt/tests.py +0 -0
  151. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/wolf_sheep/Readme.md +0 -0
  152. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/advanced/wolf_sheep/__init__.py +0 -0
  153. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/__init__.py +0 -0
  154. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boid_flockers/Readme.md +0 -0
  155. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boid_flockers/__init__.py +0 -0
  156. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boltzmann_wealth_model/Readme.md +0 -0
  157. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/boltzmann_wealth_model/__init__.py +0 -0
  158. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/conways_game_of_life/Readme.md +0 -0
  159. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/conways_game_of_life/__init__.py +0 -0
  160. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/conways_game_of_life/agents.py +0 -0
  161. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/conways_game_of_life/st_app.py +0 -0
  162. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/schelling/Readme.md +0 -0
  163. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/schelling/__init__.py +0 -0
  164. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/schelling/analysis.ipynb +0 -0
  165. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/virus_on_network/__init__.py +0 -0
  166. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/virus_on_network/agents.py +0 -0
  167. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/examples/basic/virus_on_network/model.py +0 -0
  168. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/UserParam.py +0 -0
  169. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/__init__.py +0 -0
  170. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/__init__.py +0 -0
  171. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/cell.py +0 -0
  172. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/cell_agent.py +0 -0
  173. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/grid.py +0 -0
  174. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/network.py +0 -0
  175. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/cell_space/voronoi.py +0 -0
  176. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/components/altair.py +0 -0
  177. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/components/matplotlib.py +0 -0
  178. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/devs/__init__.py +0 -0
  179. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/devs/eventlist.py +0 -0
  180. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/devs/examples/epstein_civil_violence.py +0 -0
  181. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/devs/examples/wolf_sheep.py +0 -0
  182. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/experimental/solara_viz.py +0 -0
  183. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/space.py +0 -0
  184. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/components/__init__.py +0 -0
  185. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/components/altair_components.py +0 -0
  186. /mesa-3.0.0rc0/mesa/visualization/UserParam.py → /mesa-3.0.2/mesa/visualization/user_param.py +0 -0
  187. {mesa-3.0.0rc0 → mesa-3.0.2}/mesa/visualization/utils.py +0 -0
  188. {mesa-3.0.0rc0 → mesa-3.0.2}/mypy.ini +0 -0
  189. {mesa-3.0.0rc0 → mesa-3.0.2}/pyproject.toml +0 -0
  190. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/__init__.py +0 -0
  191. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/read_requirements.py +0 -0
  192. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_agent.py +0 -0
  193. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_batch_run.py +0 -0
  194. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_datacollector.py +0 -0
  195. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_end_to_end_viz.sh +0 -0
  196. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_grid.py +0 -0
  197. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_import_namespace.py +0 -0
  198. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_lifespan.py +0 -0
  199. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_model.py +0 -0
  200. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_space.py +0 -0
  201. {mesa-3.0.0rc0 → mesa-3.0.2}/tests/test_time.py +0 -0
@@ -1,6 +1,220 @@
1
1
  ---
2
2
  title: Release History
3
3
  ---
4
+ # 3.0.2 (2024-11-11)
5
+ ## Highlighst
6
+ Mesa 3.0.2 is a small follow-up patch release, in which we fixed a lot of small bugs in the example models their visualisation, and improved their testing.
7
+
8
+ ## What's Changed
9
+ ### 🐛 Bugs fixed
10
+ * allow components as a positional argument again by @Corvince in https://github.com/projectmesa/mesa/pull/2488
11
+ ### 🔍 Examples updated
12
+ * examples: Add required components keyword by @EwoutH in https://github.com/projectmesa/mesa/pull/2485
13
+ * examples: Fix boid_flockers viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2492
14
+ * examples: Fix schelling viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2490
15
+ * example: Add input sliders to Sugerscape viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2487
16
+ * examples/gol: Add initial fraction alive, add sliders to viz by @EwoutH in https://github.com/projectmesa/mesa/pull/2489
17
+ ### 🔧 Maintenance
18
+ * test app init of examples by @Corvince in https://github.com/projectmesa/mesa/pull/2491
19
+
20
+ **Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.0.1...v3.0.2
21
+
22
+ # 3.0.1 (2024-11-11)
23
+ ## Highlights
24
+ After our huge [3.0.0 release](https://github.com/projectmesa/mesa/releases/tag/v3.0.0), Mesa 3.0.1 follows up with two improvements to experimental features, examples and docs.
25
+
26
+ ## What's Changed
27
+ ### 🧪 Experimental features
28
+ * Bugfixes to DEVS by @quaquel in https://github.com/projectmesa/mesa/pull/2478
29
+ * Support simulators in SolaraViz by @quaquel in https://github.com/projectmesa/mesa/pull/2470
30
+ ### 🛠 Enhancements made
31
+ * issue a user warning if random is None by @quaquel in https://github.com/projectmesa/mesa/pull/2479
32
+ ### 🔍 Examples updated
33
+ * Integrate benchmarks and example models by @EwoutH in https://github.com/projectmesa/mesa/pull/2473
34
+ ### 📜 Documentation improvements
35
+ * docs/tutorial: Replace scheduler in MoneyModel by @EwoutH in https://github.com/projectmesa/mesa/pull/2475
36
+ * docs: update migration_guide.md by @eltociear in https://github.com/projectmesa/mesa/pull/2480
37
+ * Update some DeprecationWarnings to note they are removed in Mesa 3.1 by @EwoutH in https://github.com/projectmesa/mesa/pull/2481
38
+
39
+ ## New Contributors
40
+ * @eltociear made their first contribution in https://github.com/projectmesa/mesa/pull/2480
41
+
42
+ **Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.0.0...v3.0.1
43
+
44
+ # 3.0.0 (2024-11-09)
45
+ ## Highlights
46
+ Mesa 3.0 brings major improvements to agent-based modeling, making it more intuitive and powerful while reducing complexity. This release modernizes core functionalities and introduces new capabilities for both beginners and advanced users.
47
+
48
+ ### Streamlined agent management
49
+ The centerpiece of Mesa 3.0 is its new agent management system. Agents are now automatically tracked and assigned unique IDs, eliminating common boilerplate code. The new AgentSet functionality provides an elegant and flexible way to work with agents, for example:
50
+
51
+ ```python
52
+ # Find agents meeting specific criteria
53
+ wealthy_agents = model.agents.select(lambda a: a.wealth > 1000)
54
+
55
+ # Group and analyze agents
56
+ grouped = model.agents.groupby("state")
57
+ state_stats = grouped.agg({
58
+ "count": len,
59
+ "avg_age": ("age", np.mean),
60
+ "total_wealth": ("wealth", sum)
61
+ })
62
+
63
+ # Activate agents in different patterns
64
+ model.agents.shuffle_do("step") # Random activation
65
+ model.agents.select(lambda a: a.energy > 0).do("move") # Conditional activation
66
+ ```
67
+
68
+ The AgentSet provides powerful methods for filtering, grouping, and analyzing agents, making it easier to express complex model logic. Each model automatically maintains an AgentSet containing all agents (`model.agents`) and separate AgentSets for each agent type (`model.agents_by_type`). See the full [AgentSet docs](https://mesa.readthedocs.io/latest/apis/agent.html#mesa.agent.AgentSet) here.
69
+
70
+ ### Modern Visualization with SolaraViz
71
+ Mesa 3.0's new experimental visualization system, SolaraViz, provides a modern, interactive interface for model exploration:
72
+
73
+ ```python
74
+ from mesa.visualization import SolaraViz, make_space_component, make_plot_component
75
+
76
+ visualization = SolaraViz(
77
+ model,
78
+ [
79
+ make_space_component(agent_portrayal),
80
+ make_plot_component(["population", "average_wealth"]),
81
+ lambda m: f"Step {m.steps}: {len(m.agents)} agents" # Custom text component
82
+ ],
83
+ model_params=parameter_controls
84
+ )
85
+ ```
86
+
87
+ Key visualization features:
88
+ - Interactive browser-based interface with real-time updates
89
+ - Support for both grid-based and network models
90
+ - Visualization of PropertyLayers and hexagonal grids
91
+ - Custom components using Matplotlib or text
92
+ - Improved performance and responsiveness
93
+
94
+ Check out the [Visualization Tutorial](https://mesa.readthedocs.io/latest/tutorials/visualization_tutorial.html) to get started.
95
+
96
+ *Note: SolaraViz is in active development. We might make API breaking changes between Mesa 3.0 and 3.1.*
97
+
98
+ ### Enhanced data collection
99
+ The DataCollector now supports collecting different metrics for different agent types, using `agenttype_reporters`:
100
+
101
+ ```python
102
+ self.datacollector = DataCollector(
103
+ model_reporters={"total_wealth": lambda m: m.agents.agg("wealth", sum)},
104
+ agent_reporters={"age": "age", "wealth": "wealth"},
105
+ agenttype_reporters={
106
+ Predator: {"kills": "kills_count"},
107
+ Prey: {"distance_fled": "total_flight_distance"}
108
+ }
109
+ )
110
+ ```
111
+
112
+ ### Experimental features
113
+ Mesa 3.0 introduces several experimental features for advanced modeling:
114
+ - [Cell Space](https://mesa.readthedocs.io/latest/apis/experimental.html#module-experimental.cell_space.cell) with integrated PropertyLayers and improved agent movement capabilities
115
+ - Voronoi grid implementation
116
+ - [Event-scheduling simulation](https://mesa.readthedocs.io/latest/apis/experimental.html#module-experimental.devs.eventlist) capabilities
117
+
118
+ These experimental features are in active development and might break API between releases.
119
+
120
+ ## Breaking changes
121
+ _See our [Mesa 3.0 migration guide](https://mesa.readthedocs.io/latest/migration_guide.html#mesa-3-0) for a full overview._
122
+
123
+ If you want to move existing models from Mesa 2.x to 3.0, there are a few things you have to change.
124
+
125
+ 1. Models must explicitly initialize the Mesa base class:
126
+ ```python
127
+ class MyModel(mesa.Model):
128
+ def __init__(self, n_agents, seed=None):
129
+ super().__init__(seed=seed) # Required in Mesa 3.0
130
+ ```
131
+
132
+ 2. Agents are created without manual ID assignment:
133
+ ```python
134
+ # Old
135
+ agent = MyAgent(unique_id=1, model=self)
136
+ # New
137
+ agent = MyAgent(model=self)
138
+ ```
139
+
140
+ 3. Scheduler replacement with AgentSet operations:
141
+ ```python
142
+ # Old (RandomActivation)
143
+ self.schedule = RandomActivation(self)
144
+ self.schedule.step()
145
+
146
+ # New
147
+ self.agents.shuffle_do("step")
148
+
149
+ # Old (SimultaneousActivation)
150
+ self.schedule = SimultaneousActivation(self)
151
+ self.schedule.step()
152
+
153
+ # New
154
+ self.agents.do("step")
155
+ self.agents.do("advance")
156
+ ```
157
+
158
+ Furthermore:
159
+ - Steps counter automatically increments
160
+ - `mesa.flat` namespace removed
161
+ - Python 3.10+ required
162
+ - Reserved model variables (`agents`, `steps`, etc.) protected
163
+ - Simplified DataCollector initialization
164
+ - Old visualization system replaced by SolaraViz
165
+
166
+ ## Getting Started
167
+ Install Mesa 3.0:
168
+ ```bash
169
+ pip install --upgrade mesa
170
+ ```
171
+
172
+ If building a new model, we recommend checking out the updated [Mesa Overview](https://mesa.readthedocs.io/latest/overview.html) and [Introductory Tutorial](https://mesa.readthedocs.io/latest/tutorials/intro_tutorial.html).
173
+
174
+ For updating existing models, we recommend upgrading in steps:
175
+ 1. Update to latest Mesa 2.x
176
+ 2. Address deprecation warnings
177
+ 3. Upgrade to Mesa 3.0
178
+ 4. Replace schedulers with AgentSet functionality
179
+
180
+ A detailed [migration guide](https://mesa.readthedocs.io/latest/migration_guide.html#mesa-3-0) is available to help moving to Mesa 3.0. For questions or support, join our [GitHub Discussions](https://github.com/projectmesa/mesa/discussions) or [Matrix Chat](https://matrix.to/#/#project-mesa:matrix.org).
181
+
182
+ We would love to hear what you think about Mesa 3.0! [Say hello here](https://github.com/projectmesa/mesa/discussions/2465) and leave any [feedback on 3.0 here](https://github.com/projectmesa/mesa/discussions/2338).
183
+
184
+ # 3.0.0rc0 (2024-11-06)
185
+ ## Highlights
186
+ We're releasing the Mesa 3.0 Release Candidate, ready for final testing before we release Mesa 3.0 later this week!
187
+
188
+ In this last 3.0 pre-release, the visualisation has been thoroughly updated, with a brand new API. Visualizing the experimental Cell Space, including PropertyLayers and hexogonal grids, is now also supported.
189
+
190
+ We're still working very active on the visualisation, so we have marked that experimental for Mesa 3.0. We will stabilize SolaraViz in Mesa 3.1.
191
+
192
+ Any feedback and last-minute bug reports are welcome [here](https://github.com/projectmesa/mesa/discussions/2338).
193
+
194
+ ## What's Changed
195
+ ### ⚠️ Breaking changes
196
+ * Viz: Refactor Matplotlib plotting by @quaquel in https://github.com/projectmesa/mesa/pull/2430
197
+ * api reorganization by @quaquel in https://github.com/projectmesa/mesa/pull/2447
198
+ ### 🧪 Experimental features
199
+ * Mark SolaraViz as experimental for Mesa 3.0 by @EwoutH in https://github.com/projectmesa/mesa/pull/2459
200
+ ### 🛠 Enhancements made
201
+ * expand ax.scatter kwargs that can be used by @quaquel in https://github.com/projectmesa/mesa/pull/2445
202
+ ### 🐛 Bugs fixed
203
+ * Fix #2452 - handle solara viz model params better by @Corvince in https://github.com/projectmesa/mesa/pull/2454
204
+ * Update MoneyModel.py by @quaquel in https://github.com/projectmesa/mesa/pull/2458
205
+ ### 🔍 Examples updated
206
+ * Updates to Epstein example by @quaquel in https://github.com/projectmesa/mesa/pull/2429
207
+ * Update examples to use updated space drawing by @quaquel in https://github.com/projectmesa/mesa/pull/2442
208
+ ### 📜 Documentation improvements
209
+ * Update wolf-sheep png and fix typo in file name by @quaquel in https://github.com/projectmesa/mesa/pull/2444
210
+ * Include main examples readme in docs by @quaquel in https://github.com/projectmesa/mesa/pull/2448
211
+ * remove how-to guide and update docs in places by @quaquel in https://github.com/projectmesa/mesa/pull/2449
212
+ ### 🔧 Maintenance
213
+ * remove deprecated HexGrid class by @quaquel in https://github.com/projectmesa/mesa/pull/2441
214
+ * rename make_plot_measure to make_plot_component and add some kwargs by @quaquel in https://github.com/projectmesa/mesa/pull/2446
215
+
216
+ **Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.0.0b2...v3.0.0rc0
217
+
4
218
  # 3.0.0b2 (2024-10-26)
5
219
  ## Highlights
6
220
  Mesa 3.0 beta 2 includes major work on the example models, docs, a new tutorial and visualisation.
@@ -1,13 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: Mesa
3
- Version: 3.0.0rc0
3
+ Version: 3.0.2
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
7
7
  Author-email: Project Mesa Team <projectmesa@googlegroups.com>
8
8
  License: Apache 2.0
9
- License-File: LICENSE
10
- License-File: NOTICE
11
9
  Keywords: ABM,agent,based,model,modeling,multi-agent,simulation
12
10
  Classifier: Development Status :: 3 - Alpha
13
11
  Classifier: Intended Audience :: Science/Research
@@ -93,9 +91,9 @@ interface; and analyze their results using Python's data analysis
93
91
  tools. Its goal is to be the Python-based alternative to NetLogo,
94
92
  Repast, or MASON.
95
93
 
96
- ![A screenshot of the Schelling Model in Mesa](https://raw.githubusercontent.com/projectmesa/mesa/main/docs/images/Mesa_Screenshot.png)
94
+ ![A screenshot of the WolfSheep Model in Mesa](https://raw.githubusercontent.com/projectmesa/mesa/main/docs/images/wolf_sheep.png)
97
95
 
98
- *Above: A Mesa implementation of the Schelling segregation model, this
96
+ *Above: A Mesa implementation of the WolfSheep model, this
99
97
  can be displayed in browser windows or Jupyter.*
100
98
 
101
99
  ## Features
@@ -107,18 +105,18 @@ can be displayed in browser windows or Jupyter.*
107
105
 
108
106
  ## Using Mesa
109
107
 
110
- To install our latest stable release (2.4.x), run:
108
+ To install our latest stable release (3.0.x), run:
111
109
 
112
110
  ``` bash
113
111
  pip install -U mesa
114
112
  ```
115
113
 
116
- To install our latest pre-release (3.0.0 alpha), run:
114
+ To install our latest pre-release, run:
117
115
 
118
116
  ``` bash
119
117
  pip install -U --pre mesa
120
118
  ```
121
- With Mesa 3.0, we don't install all our dependencies anymore by default.
119
+ Starting with Mesa 3.0, we don't install all our dependencies anymore by default.
122
120
  ```bash
123
121
  # You can customize the additional dependencies you need, if you want. Available are:
124
122
  pip install -U --pre mesa[network,viz]
@@ -14,9 +14,9 @@ interface; and analyze their results using Python's data analysis
14
14
  tools. Its goal is to be the Python-based alternative to NetLogo,
15
15
  Repast, or MASON.
16
16
 
17
- ![A screenshot of the Schelling Model in Mesa](https://raw.githubusercontent.com/projectmesa/mesa/main/docs/images/Mesa_Screenshot.png)
17
+ ![A screenshot of the WolfSheep Model in Mesa](https://raw.githubusercontent.com/projectmesa/mesa/main/docs/images/wolf_sheep.png)
18
18
 
19
- *Above: A Mesa implementation of the Schelling segregation model, this
19
+ *Above: A Mesa implementation of the WolfSheep model, this
20
20
  can be displayed in browser windows or Jupyter.*
21
21
 
22
22
  ## Features
@@ -28,18 +28,18 @@ can be displayed in browser windows or Jupyter.*
28
28
 
29
29
  ## Using Mesa
30
30
 
31
- To install our latest stable release (2.4.x), run:
31
+ To install our latest stable release (3.0.x), run:
32
32
 
33
33
  ``` bash
34
34
  pip install -U mesa
35
35
  ```
36
36
 
37
- To install our latest pre-release (3.0.0 alpha), run:
37
+ To install our latest pre-release, run:
38
38
 
39
39
  ``` bash
40
40
  pip install -U --pre mesa
41
41
  ```
42
- With Mesa 3.0, we don't install all our dependencies anymore by default.
42
+ Starting with Mesa 3.0, we don't install all our dependencies anymore by default.
43
43
  ```bash
44
44
  # You can customize the additional dependencies you need, if you want. Available are:
45
45
  pip install -U --pre mesa[network,viz]
@@ -1,9 +1,6 @@
1
1
  """configurations for benchmarks."""
2
2
 
3
- from BoltzmannWealth.boltzmann_wealth import BoltzmannWealth
4
- from Flocking.flocking import BoidFlockers
5
- from Schelling.schelling import Schelling
6
- from WolfSheep.wolf_sheep import WolfSheep
3
+ from mesa.examples import BoidFlockers, BoltzmannWealth, Schelling, WolfSheep
7
4
 
8
5
  configurations = {
9
6
  # Schelling Model Configurations
@@ -28,21 +28,21 @@ def run_model(model_class, seed, parameters):
28
28
  Returns:
29
29
  startup time and run time
30
30
  """
31
- no_simulator = ["BoltzmannWealth"]
31
+ uses_simulator = ["WolfSheep"]
32
32
  start_init = timeit.default_timer()
33
- if model_class.__name__ in no_simulator:
34
- model = model_class(seed=seed, **parameters)
35
- else:
33
+ if model_class.__name__ in uses_simulator:
36
34
  simulator = ABMSimulator()
37
35
  model = model_class(simulator=simulator, seed=seed, **parameters)
38
- simulator.setup(model)
36
+ else:
37
+ model = model_class(seed=seed, **parameters)
39
38
 
40
39
  end_init_start_run = timeit.default_timer()
41
40
 
42
- if model_class.__name__ in no_simulator:
43
- model.run_model(config["steps"])
44
- else:
41
+ if model_class.__name__ in uses_simulator:
45
42
  simulator.run_for(config["steps"])
43
+ else:
44
+ for _ in range(config["steps"]):
45
+ model.step()
46
46
 
47
47
  end_run = timeit.default_timer()
48
48
 
@@ -3,6 +3,11 @@ 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
+
6
11
  ```{eval-rst}
7
12
  .. automodule:: experimental.cell_space.cell
8
13
  :members:
@@ -33,6 +38,11 @@ This namespace contains experimental features. These are under development, and
33
38
  :members:
34
39
  ```
35
40
 
41
+ ```{eval-rst}
42
+ .. automodule:: experimental.cell_space.voronoi
43
+ :members:
44
+ ```
45
+
36
46
  ## Devs
37
47
 
38
48
  ```{eval-rst}
@@ -14,7 +14,7 @@ For a detailed tutorial, please refer to our [Visualization Tutorial](../tutoria
14
14
  ## User Parameters
15
15
 
16
16
  ```{eval-rst}
17
- .. automodule:: mesa.visualization.UserParam
17
+ .. automodule:: mesa.visualization.user_param
18
18
  :members:
19
19
  :undoc-members:
20
20
  :show-inheritance:
@@ -24,7 +24,7 @@ All our [examples](examples) follow this layout.
24
24
  ## Randomization
25
25
 
26
26
  If your model involves some random choice, you can use the built-in `random`
27
- property that Mesa `Model` and `Agent` objects have. This works exactly
27
+ property that many Mesa objects have, including `Model`, `Agent`, and `AgentSet`. This works exactly
28
28
  like the built-in `random` library.
29
29
 
30
30
  ```python
@@ -45,20 +45,24 @@ class AwesomeAgent(Agent):
45
45
  random_number = self.random.randint(0, 100)
46
46
  ```
47
47
 
48
- (The agent's random property is just a reference to its parent model's
49
- `random` property).
48
+ `Agent.random` is just a convenient shorthand in the Agent class to `self.model.random`. If you create your own `AgentSet`
49
+ instances, you have to pass `random` explicitly. Typically, you can simply do, in a Model instance,
50
+ `my_agentset = AgentSet([], random=self.random)`. This ensures that `my_agentset` uses the same random
51
+ number generator as the rest of the model.
52
+
50
53
 
51
54
  When a model object is created, its random property is automatically seeded
52
55
  with the current time. The seed determines the sequence of random numbers; if
53
56
  you instantiate a model with the same seed, you will get the same results.
54
57
  To allow you to set the seed, make sure your model has a `seed` argument in its
55
- constructor.
58
+ `__init__`.
56
59
 
57
60
  ```python
58
61
  class AwesomeModel(Model):
59
62
 
60
63
  def __init__(self, seed=None):
61
- pass
64
+ super().__init__(seed=seed)
65
+ ...
62
66
 
63
67
  def cool_method(self):
64
68
  interesting_number = self.random.random()
@@ -175,7 +175,9 @@ html_static_path = ["_static"]
175
175
  # html_use_smartypants = True
176
176
 
177
177
  # Custom sidebar templates, maps document names to template names.
178
- # html_sidebars = {}
178
+ html_sidebars = {
179
+ 'migration_guide': [], # No sidebar migration
180
+ }
179
181
 
180
182
  # Additional templates that should be rendered to pages, maps page names to
181
183
  # template names.
@@ -338,7 +340,7 @@ def setup_examples_pages():
338
340
  app_filename = os.path.join(example, "app.py")
339
341
 
340
342
  md_filename = f"{base_name}.md"
341
- examples_md.append(base_name)
343
+ examples_md.append((base_name, f"{kind}/{base_name}"))
342
344
 
343
345
  md_filepath = os.path.join(HERE, "examples", kind, md_filename)
344
346
  write_example_md_file(agent_filename, model_filename, readme_filename, app_filename, md_filepath, template)
@@ -354,7 +356,7 @@ def setup_examples_pages():
354
356
  content = template.substitute(
355
357
  dict(
356
358
  readme=readme_md,
357
- # examples="\n".join([f"{' '.join(base_name.split('_'))} </examples/{base_name}>" for base_name in examples_md]),
359
+ example_paths="\n".join([f"{' '.join(a.split('_'))} </examples/{b}>" for a, b in examples_md]),
358
360
  )
359
361
  )
360
362
  fh.write(content)
@@ -0,0 +1,13 @@
1
+
2
+ $readme
3
+
4
+
5
+
6
+ ```{toctree}
7
+ :hidden: true
8
+ :maxdepth: 2
9
+
10
+ $example_paths
11
+
12
+
13
+ ```
@@ -1,9 +1,20 @@
1
- # Mesa Overview
1
+ # Getting started
2
2
  Mesa is a modular framework for building, analyzing and visualizing agent-based models.
3
3
 
4
4
  **Agent-based models** are computer simulations involving multiple entities (the agents) acting and interacting with one another based on their programmed behavior. Agents can be used to represent living cells, animals, individual humans, even entire organizations or abstract entities. Sometimes, we may have an understanding of how the individual components of a system behave, and want to see what system-level behaviors and effects emerge from their interaction. Other times, we may have a good idea of how the system overall behaves, and want to figure out what individual behaviors explain it. Or we may want to see how to get agents to cooperate or compete most effectively. Or we may just want to build a cool toy with colorful little dots moving around.
5
5
 
6
- ## Mesa Modules
6
+
7
+ ## Tutorials
8
+ If you want to get a quick start on how to build agent based models with MESA, check the tutorials:
9
+
10
+ - [Introductory Tutorial](tutorials/intro_tutorial): Learn how to create your first Mesa model.
11
+ - [Visualization Tutorial](tutorials/visualization_tutorial): Learn how to create interactive visualizations for your models.
12
+
13
+ ## Examples
14
+ Mesa ships with a collection of example models. These are classic ABMs, so if you are familiar with ABMs and want to get a quick sense of how MESA works, these examples are great place to start. You can find them [here](examples).
15
+
16
+
17
+ ## Overview of the MESA library
7
18
 
8
19
  Mesa is modular, meaning that its modeling, analysis and visualization components are kept separate but intended to work together. The modules are grouped into three categories:
9
20
 
@@ -165,10 +176,14 @@ results = mesa.batch_run(
165
176
  The results are returned as a list of dictionaries, which can be easily converted to a pandas DataFrame for further analysis.
166
177
 
167
178
  ### Visualization
168
- Mesa now uses a new browser-based visualization system called SolaraViz. This allows for interactive, customizable visualizations of your models. Here's a basic example of how to set up a visualization:
179
+ Mesa now uses a new browser-based visualization system called SolaraViz. This allows for interactive, customizable visualizations of your models.
169
180
 
170
181
  > **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.
171
182
 
183
+ The core functionality for building your own visualizations resides in the [`mesa.visualization`](apis/visualization) namespace
184
+
185
+ Here's a basic example of how to set up a visualization:
186
+
172
187
  ```python
173
188
  from mesa.visualization import SolaraViz, make_space_component, make_plot_component
174
189
 
@@ -206,28 +221,42 @@ This will create an interactive visualization of your model, including:
206
221
 
207
222
  You can also create custom visualization components using Matplotlib. For more advanced usage and customization options, please refer to the [visualization tutorial](tutorials/visualization_tutorial).
208
223
 
209
- ### Further resources
224
+ ## Further resources
210
225
  To further explore Mesa and its features, we have the following resources available:
211
226
 
212
- #### Tutorials
213
- - [Introductory Tutorial](tutorials/intro_tutorial): Learn how to create your first Mesa model.
214
- - [Visualization Tutorial](tutorials/visualization_tutorial.html): Learn how to create interactive visualizations for your models.
227
+ ### Best practices
228
+ - [Mesa best practices](best-practices): an overview of tips and guidelines for using MESA.
215
229
 
216
- #### API documentation
230
+ ### API documentation
217
231
  - [Mesa API reference](apis): Detailed documentation of Mesa's classes and functions.
218
232
 
219
- #### Example models
233
+ ### Repository of models built using MESA
220
234
  - [Mesa Examples repository](https://github.com/projectmesa/mesa-examples): A collection of example models demonstrating various Mesa features and modeling techniques.
221
235
 
222
- #### Migration guide
236
+ ### Migration guide
223
237
  - [Mesa 3.0 Migration guide](migration_guide): If you're upgrading from an earlier version of Mesa, this guide will help you navigate the changes in Mesa 3.0.
224
238
 
225
- #### Source Ccode and development
239
+ ### Source Ccode and development
226
240
  - [Mesa GitHub repository](https://github.com/projectmesa/mesa): Access the full source code of Mesa, contribute to its development, or report issues.
227
241
  - [Mesa release notes](https://github.com/projectmesa/mesa/releases): View the detailed changelog of Mesa, including all past releases and their features.
228
242
 
229
- #### Community and support
243
+ ### Community and support
230
244
  - [Mesa GitHub Discussions](https://github.com/projectmesa/mesa/discussions): Join discussions, ask questions, and connect with other Mesa users.
231
245
  - [Matrix Chat](https://matrix.to/#/#project-mesa:matrix.org): Real-time chat for quick questions and community interaction.
232
246
 
233
247
  Enjoy modelling with Mesa, and feel free to reach out!
248
+
249
+
250
+
251
+
252
+
253
+ ```{toctree}
254
+ :hidden: true
255
+ :maxdepth: 7
256
+
257
+ tutorials/intro_tutorial
258
+ tutorials/visualization_tutorial
259
+ Best Practices <best-practices>
260
+
261
+
262
+ ```
@@ -33,14 +33,17 @@ Mesa allows users to quickly create agent-based models using built-in core compo
33
33
 
34
34
  ## Using Mesa
35
35
  ### Installation Options
36
-
37
- To install our latest stable release (2.4.x), run:
36
+ To install our latest stable release (3.0.x), run:
38
37
 
39
38
  ```bash
40
39
  pip install -U mesa
41
40
  ```
41
+ To also install our recommended dependencies:
42
+ ```bash
43
+ pip install -U mesa[rec]
44
+ ```
42
45
 
43
- To install our latest Mesa 3.0 beta with recommended dependencies:
46
+ To install our latest pre-release:
44
47
 
45
48
  ```bash
46
49
  pip install -U --pre mesa[rec]
@@ -50,9 +53,7 @@ pip install -U --pre mesa[rec]
50
53
 
51
54
  For help getting started with Mesa, check out these resources:
52
55
 
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
+ - [Getting started] - Learn about Mesa's core concepts and components
56
57
  - [Migration Guide] - Upgrade to Mesa 3.0
57
58
  - [Mesa Examples] - Browse user-contributed models and implementations
58
59
  - [GitHub Discussions] - Ask questions and discuss Mesa
@@ -72,14 +73,11 @@ The original Mesa conference paper is [available here](http://conference.scipy.o
72
73
  :hidden: true
73
74
  :maxdepth: 7
74
75
 
75
- Mesa Overview <overview>
76
- tutorials/intro_tutorial
77
- tutorials/visualization_tutorial
76
+ Getting started <getting_started>
78
77
  Examples <examples>
79
78
  Migration guide <migration_guide>
80
- Best Practices <best-practices>
81
79
  API Documentation <apis/api_main>
82
- Mesa Packages <packages>
80
+
83
81
  ```
84
82
 
85
83
  # Indices and tables
@@ -99,3 +97,5 @@ Mesa Packages <packages>
99
97
  [mesa introductory tutorial]: tutorials/intro_tutorial
100
98
  [mesa visualization tutorial]: tutorials/visualization_tutorial
101
99
  [migration guide]: migration_guide
100
+ [Getting started]: getting_started
101
+
@@ -12,8 +12,8 @@ _This guide is a work in progress. The development of it is tracked in [Issue #2
12
12
 
13
13
  ### Upgrade strategy
14
14
  We recommend the following upgrade strategy:
15
- - Update the the latest Mesa 2.x release (`mesa<3`).
16
- - Update the the latest Mesa 3.0.x release (`mesa<3.1`).
15
+ - Update to the latest Mesa 2.x release (`mesa<3`).
16
+ - Update to the latest Mesa 3.0.x release (`mesa<3.1`).
17
17
  - Update to the latest Mesa 3.x release (`mesa<4`).
18
18
 
19
19
  With each update, resolve all errors and warnings, before updating to the next one.
@@ -146,7 +146,7 @@ You can access it by `Model.steps`, and it's internally in the datacollector, ba
146
146
  - The `Model._advance_time()` method is removed. This now happens automatically.
147
147
 
148
148
  #### Replacing Schedulers with AgentSet functionality
149
- The whole Time module in Mesa is deprecated, and all schedulers are being replaced with AgentSet functionality and the internal `Model.steps` counter. This allows much more flexibility in how to activate Agents and makes it explicit what's done exactly.
149
+ The whole Time module in Mesa is deprecated and will be removed in Mesa 3.1. All schedulers should be replaced with AgentSet functionality and the internal `Model.steps` counter. This allows much more flexibility in how to activate Agents and makes it explicit what's done exactly.
150
150
 
151
151
  Here's how to replace each scheduler:
152
152
 
@@ -4,7 +4,7 @@ import mesa
4
4
 
5
5
 
6
6
  def compute_gini(model):
7
- agent_wealths = [agent.wealth for agent in model.schedule.agents]
7
+ agent_wealths = [agent.wealth for agent in model.agents]
8
8
  x = sorted(agent_wealths)
9
9
  N = model.num_agents
10
10
  B = sum(xi * (N - i) for i, xi in enumerate(x)) / (N * sum(x))
@@ -60,12 +60,10 @@ class MoneyModel(mesa.Model):
60
60
  super().__init__(seed=seed)
61
61
  self.num_agents = n
62
62
  self.grid = mesa.space.MultiGrid(width, height, True)
63
- self.schedule = mesa.time.RandomActivation(self)
64
63
 
65
64
  # Create agents
66
65
  for _ in range(self.num_agents):
67
66
  a = MoneyAgent(self)
68
- self.schedule.add(a)
69
67
  # Add the agent to a random grid cell
70
68
  x = self.random.randrange(self.grid.width)
71
69
  y = self.random.randrange(self.grid.height)
@@ -74,8 +72,9 @@ class MoneyModel(mesa.Model):
74
72
  self.datacollector = mesa.DataCollector(
75
73
  model_reporters={"Gini": compute_gini}, agent_reporters={"Wealth": "wealth"}
76
74
  )
75
+ self.datacollector.collect(self)
77
76
 
78
77
  def step(self):
79
78
  """do one step of the model"""
79
+ self.agents.shuffle_do("step")
80
80
  self.datacollector.collect(self)
81
- self.schedule.step()