Mesa 3.0.0a5__tar.gz → 3.0.0b0__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 (144) hide show
  1. {mesa-3.0.0a5 → mesa-3.0.0b0}/.readthedocs.yml +1 -1
  2. {mesa-3.0.0a5 → mesa-3.0.0b0}/CONTRIBUTING.md +1 -1
  3. {mesa-3.0.0a5 → mesa-3.0.0b0}/HISTORY.md +55 -5
  4. mesa-3.0.0b0/LICENSE +202 -0
  5. mesa-3.0.0a5/LICENSE → mesa-3.0.0b0/NOTICE +2 -2
  6. {mesa-3.0.0a5 → mesa-3.0.0b0}/PKG-INFO +55 -13
  7. {mesa-3.0.0a5 → mesa-3.0.0b0}/README.md +15 -4
  8. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/BoltzmannWealth/boltzmann_wealth.py +1 -1
  9. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/Schelling/schelling.py +19 -7
  10. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/WolfSheep/wolf_sheep.py +18 -41
  11. mesa-3.0.0b0/docs/_static/switcher.json +12 -0
  12. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/conf.py +7 -1
  13. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/index.md +13 -3
  14. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/migration_guide.md +20 -1
  15. mesa-3.0.0b0/docs/overview.md +228 -0
  16. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/packages.md +2 -2
  17. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/intro_tutorial.ipynb +1 -1
  18. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/visualization_tutorial.ipynb +2 -2
  19. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/__init__.py +1 -1
  20. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/agent.py +12 -26
  21. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/batchrunner.py +7 -0
  22. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/cell_space/__init__.py +7 -1
  23. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/cell_space/cell.py +26 -6
  24. mesa-3.0.0b0/mesa/experimental/cell_space/cell_agent.py +133 -0
  25. mesa-3.0.0b0/mesa/experimental/cell_space/discrete_space.py +136 -0
  26. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/devs/examples/wolf_sheep.py +2 -1
  27. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/model.py +8 -9
  28. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/time.py +2 -2
  29. mesa-3.0.0b0/mesa/visualization/components/matplotlib.py +337 -0
  30. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/visualization/solara_viz.py +12 -3
  31. {mesa-3.0.0a5 → mesa-3.0.0b0}/pyproject.toml +21 -10
  32. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_agent.py +32 -45
  33. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_batch_run.py +2 -6
  34. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_cell_space.py +167 -0
  35. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_datacollector.py +8 -39
  36. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_lifespan.py +9 -9
  37. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_model.py +0 -1
  38. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_solara_viz.py +4 -1
  39. mesa-3.0.0a5/docs/overview.md +0 -116
  40. mesa-3.0.0a5/mesa/experimental/cell_space/cell_agent.py +0 -42
  41. mesa-3.0.0a5/mesa/experimental/cell_space/discrete_space.py +0 -75
  42. mesa-3.0.0a5/mesa/visualization/components/matplotlib.py +0 -248
  43. {mesa-3.0.0a5 → mesa-3.0.0b0}/.codespellignore +0 -0
  44. {mesa-3.0.0a5 → mesa-3.0.0b0}/.coveragerc +0 -0
  45. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
  46. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  47. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/ISSUE_TEMPLATE/feature-request.md +0 -0
  48. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/PULL_REQUEST_TEMPLATE/bug.md +0 -0
  49. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  50. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/dependabot.yml +0 -0
  51. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/release.yml +0 -0
  52. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/workflows/benchmarks.yml +0 -0
  53. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/workflows/build_lint.yml +0 -0
  54. {mesa-3.0.0a5 → mesa-3.0.0b0}/.github/workflows/release.yml +0 -0
  55. {mesa-3.0.0a5 → mesa-3.0.0b0}/.gitignore +0 -0
  56. {mesa-3.0.0a5 → mesa-3.0.0b0}/.pre-commit-config.yaml +0 -0
  57. {mesa-3.0.0a5 → mesa-3.0.0b0}/CITATION.bib +0 -0
  58. {mesa-3.0.0a5 → mesa-3.0.0b0}/CODE_OF_CONDUCT.md +0 -0
  59. {mesa-3.0.0a5 → mesa-3.0.0b0}/Dockerfile +0 -0
  60. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/BoltzmannWealth/__init__.py +0 -0
  61. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/Flocking/__init__.py +0 -0
  62. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/Flocking/flocking.py +0 -0
  63. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/Schelling/__init__.py +0 -0
  64. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/WolfSheep/__init__.py +0 -0
  65. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/compare_timings.py +0 -0
  66. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/configurations.py +0 -0
  67. {mesa-3.0.0a5 → mesa-3.0.0b0}/benchmarks/global_benchmark.py +0 -0
  68. {mesa-3.0.0a5 → mesa-3.0.0b0}/codecov.yaml +0 -0
  69. {mesa-3.0.0a5 → mesa-3.0.0b0}/docker-compose.yml +0 -0
  70. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/Makefile +0 -0
  71. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/README.md +0 -0
  72. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/agent.md +0 -0
  73. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/api_main.md +0 -0
  74. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/batchrunner.md +0 -0
  75. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/datacollection.md +0 -0
  76. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/experimental.md +0 -0
  77. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/model.md +0 -0
  78. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/space.md +0 -0
  79. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/time.md +0 -0
  80. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/apis/visualization.md +0 -0
  81. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/best-practices.md +0 -0
  82. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/howto.md +0 -0
  83. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/Mesa_Screenshot.png +0 -0
  84. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/mesa_logo.ico +0 -0
  85. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/mesa_logo.png +0 -0
  86. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/br_ginis.png +0 -0
  87. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/dc_endwealth.png +0 -0
  88. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/dc_gini.png +0 -0
  89. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/dc_oneagent.png +0 -0
  90. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/first_hist.png +0 -0
  91. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/multirun_hist.png +0 -0
  92. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/numpy_grid.png +0 -0
  93. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/viz_chart.png +0 -0
  94. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/viz_empty.png +0 -0
  95. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/viz_greycircles.png +0 -0
  96. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/viz_histogram.png +0 -0
  97. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/images/tutorial/viz_redcircles.png +0 -0
  98. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/make.bat +0 -0
  99. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/mesa.md +0 -0
  100. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/MoneyModel.py +0 -0
  101. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/files/viz_chart.png +0 -0
  102. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/files/viz_empty.png +0 -0
  103. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/files/viz_greycircles.png +0 -0
  104. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/files/viz_histogram.png +0 -0
  105. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/files/viz_redcircles.png +0 -0
  106. {mesa-3.0.0a5 → mesa-3.0.0b0}/docs/tutorials/files/viz_slider.png +0 -0
  107. {mesa-3.0.0a5 → mesa-3.0.0b0}/maintenance/fetch_unlabeled_prs.py +0 -0
  108. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/cookiecutter.json +0 -0
  109. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/hooks/post_gen_project.py +0 -0
  110. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/README.md +0 -0
  111. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/app.pytemplate +0 -0
  112. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/setup.pytemplate +0 -0
  113. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/__init__.py +0 -0
  114. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/model.pytemplate +0 -0
  115. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/datacollection.py +0 -0
  116. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/UserParam.py +0 -0
  117. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/__init__.py +0 -0
  118. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/cell_space/cell_collection.py +0 -0
  119. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/cell_space/grid.py +0 -0
  120. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/cell_space/network.py +0 -0
  121. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/cell_space/voronoi.py +0 -0
  122. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/components/altair.py +0 -0
  123. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/components/matplotlib.py +0 -0
  124. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/devs/__init__.py +0 -0
  125. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/devs/eventlist.py +0 -0
  126. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/devs/examples/epstein_civil_violence.py +0 -0
  127. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/devs/simulator.py +0 -0
  128. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/experimental/solara_viz.py +0 -0
  129. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/main.py +0 -0
  130. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/space.py +0 -0
  131. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/visualization/UserParam.py +0 -0
  132. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/visualization/__init__.py +0 -0
  133. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/visualization/components/altair.py +0 -0
  134. {mesa-3.0.0a5 → mesa-3.0.0b0}/mesa/visualization/utils.py +0 -0
  135. {mesa-3.0.0a5 → mesa-3.0.0b0}/mypy.ini +0 -0
  136. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/__init__.py +0 -0
  137. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/read_requirements.py +0 -0
  138. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_devs.py +0 -0
  139. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_end_to_end_viz.sh +0 -0
  140. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_examples.py +0 -0
  141. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_grid.py +0 -0
  142. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_import_namespace.py +0 -0
  143. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_scaffold.py +0 -0
  144. {mesa-3.0.0a5 → mesa-3.0.0b0}/tests/test_space.py +0 -0
@@ -1,5 +1,5 @@
1
1
  # Read the Docs configuration file
2
- # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2
+ # See https://docs.readthedocs.io/stable/config-file/v2.html for details
3
3
 
4
4
  # Required
5
5
  version: 2
@@ -53,7 +53,7 @@ Learn the tools, talk to us about what you want to change, and open a small PR.
53
53
  Awesome! You have the basics of open-source software development (if not check above), but not much modelling experience.
54
54
 
55
55
  First step is to start thinking like a modeller. To understand the fine details about our library and contribute meaningfully, get some modelling experience:
56
- - Go though our [Introductory Tutorial](https://mesa.readthedocs.io/en/latest/tutorials/intro_tutorial.html) and [Visualization Tutorial](https://mesa.readthedocs.io/en/latest/tutorials/visualization_tutorial.html). While going through them, dive into the source code to really see what everything does.
56
+ - Go though our [Introductory Tutorial](https://mesa.readthedocs.io/latest/tutorials/intro_tutorial.html) and [Visualization Tutorial](https://mesa.readthedocs.io/latest/tutorials/visualization_tutorial.html). While going through them, dive into the source code to really see what everything does.
57
57
  - Follow an ABM course (if possible). They might be a bit outdated programming language wise, but conceptual they're sound.
58
58
  - This MOOC on ABM concepts: [Agent Based Modeling](https://ocw.tudelft.nl/course-lectures/agent-based-modeling/)
59
59
  - This MOOC on practical ABM modelling: [Agent-Based Models with Python: An Introduction to Mesa](https://www.complexityexplorer.org/courses/172-agent-based-models-with-python-an-introduction-to-mesa)
@@ -1,11 +1,55 @@
1
1
  ---
2
2
  title: Release History
3
3
  ---
4
+ # 3.0.0b0 (2024-10-04)
5
+ ## Highlights
6
+ We're proud to release the first Mesa 3.0 beta! This pre-release announces that we're ready for Mesa 3.0 to be tested by all our regular users. We try to not making breaking changes anymore, but focus on resolving bugs and imperfections.
7
+
8
+ In this beta, not so much has changed as in the alphas (we're stabilizing, that's a good sign), but there are still a few notable things:
9
+ - Agents now have to be initialized without their `unique_id`. See [#2328](https://github.com/projectmesa/mesa/pull/2328) and the [Migration guide](https://mesa.readthedocs.io/latest/migration_guide.html#automatic-assignment-of-unique-id-to-agents).
10
+ - PropertyLayers can now be visualized! See [#2336](https://github.com/projectmesa/mesa/pull/2336) for details and some examples, and [mesa-examples#214](https://github.com/projectmesa/mesa-examples/pull/214) as a simple example model.
11
+ - We reduced the core dependencies of Mesa, so that's a lighter and simpler install. You can now use extras to install the dependencies, for example add `[viz]` to install all visualisation dependencies: `pip install -U --pre mesa[viz]`. See [#2265](https://github.com/projectmesa/mesa/pull/2265) for details.
12
+ - The [Mesa Overview](https://mesa.readthedocs.io/latest/overview.html) as fully updated for 3.0. We highly recommend reading though it!
13
+ - We made some more progress on the experimental Cell Space, adding movement and integrating the PropertyLayer. Among others, Agents have nu initial movement capabilities for grids. Development continues during the betas and
14
+
15
+ We plan to release one or two more beta's in the coming weeks, and tag a release candidate and Mesa 3.0 late October. In the [v3.0 milestone](https://github.com/projectmesa/mesa/milestone/43) are the critical items on our todo-list.
16
+
17
+ You can install this pre-release as usual with:
18
+
19
+ ```bash
20
+ pip install --upgrade --pre mesa
21
+ ```
22
+ We're very curious what you think, try it out and ask any questions or share any feedback [here](https://github.com/projectmesa/mesa/discussions/2338)!
23
+
24
+ ## What's Changed
25
+ ### ⚠️ Breaking changes
26
+ * update `Agent.__init__` to remove deprecation warning by @quaquel in https://github.com/projectmesa/mesa/pull/2328
27
+ ### 🎉 New features added
28
+ * Visualize PropertyLayers by @EwoutH in https://github.com/projectmesa/mesa/pull/2336
29
+ ### 🧪 Experimental features
30
+ * Encapsulate cell movement in properties by @quaquel in https://github.com/projectmesa/mesa/pull/2333
31
+ * experimental: Integrate PropertyLayers into cell space by @EwoutH in https://github.com/projectmesa/mesa/pull/2319
32
+ * Generalize CellAgent by @Corvince in https://github.com/projectmesa/mesa/pull/2292
33
+ ### 🛠 Enhancements made
34
+ * Reduce core dependencies, split in optional dependencies by @EwoutH in https://github.com/projectmesa/mesa/pull/2265
35
+ ### 🐛 Bugs fixed
36
+ * viz: stop running and disable buttons when model.running is False by @wang-boyu in https://github.com/projectmesa/mesa/pull/2332
37
+ ### 📜 Documentation improvements
38
+ * docs: Update overview for Mesa 3.0 by @EwoutH in https://github.com/projectmesa/mesa/pull/2317
39
+ * Readthedocs: Add version switch and update URL by @EwoutH in https://github.com/projectmesa/mesa/pull/2324
40
+ ### 🔧 Maintenance
41
+ * tests: Resolve warnings by removing scheduler and updating arguments by @EwoutH in https://github.com/projectmesa/mesa/pull/2329
42
+ * add super call to Model and remove self.schedule by @quaquel in https://github.com/projectmesa/mesa/pull/2334
43
+ ### Other changes
44
+ * Deprecate `initialize_data_collector` by @EwoutH in https://github.com/projectmesa/mesa/pull/2327
45
+
46
+ **Full Changelog**: https://github.com/projectmesa/mesa/compare/v3.0.0a5...v3.0.0b0
47
+
4
48
  # 3.0.0a5 (2024-09-21)
5
49
  ## Highlights
6
50
  Mesa v3.0 alpha 5 release contains many quality of life updates, a big new feature for the DataCollector and a major deprecation.
7
51
 
8
- The entire `mesa.time` module, including all schedulers, has been deprecated ([#2306](https://github.com/projectmesa/mesa/pull/2306)). Users are encouraged to transition to AgentSet functionality for more flexible and explicit agent activation patterns. Check the [migration guide](https://mesa.readthedocs.io/en/latest/migration_guide.html#time-and-schedulers) on how to upgrade.
52
+ The entire `mesa.time` module, including all schedulers, has been deprecated ([#2306](https://github.com/projectmesa/mesa/pull/2306)). Users are encouraged to transition to AgentSet functionality for more flexible and explicit agent activation patterns. Check the [migration guide](https://mesa.readthedocs.io/latest/migration_guide.html#time-and-schedulers) on how to upgrade.
9
53
 
10
54
  The DataCollector now supports collecting data from specific Agent subclasses using the new `agenttype_reporters` parameter ([#2300](https://github.com/projectmesa/mesa/pull/2300)). This allows collecting different metrics for different agent types. For example:
11
55
 
@@ -18,7 +62,9 @@ self.datacollector = DataCollector(
18
62
  )
19
63
  ```
20
64
 
21
- Furthermore, a new `shuffle_do()` method for AgentSets provides a faster way to perform `shuffle().do()` ([#2283](https://github.com/projectmesa/mesa/pull/2283)). The GroupBy class gained `count()` and `agg()` methods to count the number of agents in groups and aggregate variables of them ([#2290](https://github.com/projectmesa/mesa/pull/2290)). The `CellCollection.select` method was updated to use `at_most` instead of `n`, aligning with the AgentSet API ([#2307](https://github.com/projectmesa/mesa/pull/2307)). Additionally, the Cell class now features a dedicated `neighborhood` property for direct neighbors (default radius=1) and a `get_neighborhood` method for larger radii ([#2309](https://github.com/projectmesa/mesa/pull/2309)).
65
+ Furthermore, a new `shuffle_do()` method for AgentSets provides a faster way to perform `shuffle().do()` ([#2283](https://github.com/projectmesa/mesa/pull/2283)). The GroupBy class gained `count()` and `agg()` methods to count the number of agents in groups and aggregate variables of them ([#2290](https://github.com/projectmesa/mesa/pull/2290)).
66
+
67
+ In the experimental Cell Space, the `CellCollection.select` method was updated to use `at_most` instead of `n`, aligning with the AgentSet API ([#2307](https://github.com/projectmesa/mesa/pull/2307)). Additionally, the Cell class now features a dedicated `neighborhood` property for direct neighbors (default radius=1) and a `get_neighborhood` method for larger radii ([#2309](https://github.com/projectmesa/mesa/pull/2309)).
22
68
 
23
69
  Finally, SolaraViz received updates improving its interface and performance ([#2299](https://github.com/projectmesa/mesa/pull/2299), [#2304](https://github.com/projectmesa/mesa/pull/2304)). Cell connections in grids and networks are now public and named for more intuitive agent movements ([#2296](https://github.com/projectmesa/mesa/pull/2296)). The Model class initialization process was simplified by moving random seed and random object creation to `__init__` ([#1940](https://github.com/projectmesa/mesa/pull/1940)). Documentation has been extensively updated, including enforcing Google docstrings ([#2294](https://github.com/projectmesa/mesa/pull/2294)) and reorganizing the API documentation ([#2298](https://github.com/projectmesa/mesa/pull/2298)) for better clarity and navigation.
24
70
 
@@ -33,13 +79,17 @@ While the Mesa 3.0 timeline is still being discussed, we're aiming at the first
33
79
  * Make cell connections public and named by @Corvince in https://github.com/projectmesa/mesa/pull/2296
34
80
  * SolaraViz Updates by @Corvince in https://github.com/projectmesa/mesa/pull/2299
35
81
  * Solara viz: use_task for non-threaded continuous play by @Corvince in https://github.com/projectmesa/mesa/pull/2304
82
+ ### 🧪 Experimental features
36
83
  * Update to CellCollection.select by @quaquel in https://github.com/projectmesa/mesa/pull/2307
84
+ * Have a dedicated neighborhood property and a get_neighborhood method on Cell by @quaquel in https://github.com/projectmesa/mesa/pull/2309
37
85
  ### 📜 Documentation improvements
38
86
  * Enforce google docstrings by @quaquel in https://github.com/projectmesa/mesa/pull/2294
39
87
  * Api docs by @quaquel in https://github.com/projectmesa/mesa/pull/2298
40
88
  * update migration guide to describe solaraviz updates by @Corvince in https://github.com/projectmesa/mesa/pull/2297
41
89
  * Migration Guide: Add Model initialization requirement and automatic Agent.unique_id assignment by @EwoutH in https://github.com/projectmesa/mesa/pull/2302
42
90
  * Deprecate Time module and all its Schedulers by @EwoutH in https://github.com/projectmesa/mesa/pull/2306
91
+ * intro_tutorial: Don't initialize agents with an unique_id by @EwoutH in https://github.com/projectmesa/mesa/pull/2315
92
+ * Migration guide: Intro, upgrade strategy, model.agents, headers by @EwoutH in https://github.com/projectmesa/mesa/pull/2314
43
93
  ### 🔧 Maintenance
44
94
  * make typing behavior of AgentSet.get explicit by @quaquel in https://github.com/projectmesa/mesa/pull/2293
45
95
  * model: Move random seed and random to __init__ by @rht in https://github.com/projectmesa/mesa/pull/1940
@@ -65,7 +115,7 @@ Mesa 3.0.0a4 contains two major breaking changes:
65
115
  Example models were updated in [mesa-examples#194](https://github.com/projectmesa/mesa-examples/pull/194), which shows more examples on how to update existing models.
66
116
 
67
117
  2. Our visualisation API is being overhauled, to be more flexible and powerful. For more details, see [#2278](https://github.com/projectmesa/mesa/pull/2278).
68
- - An initial update to the tutorial was made in [#2289](https://github.com/projectmesa/mesa/pull/2289) and is [available here](https://mesa.readthedocs.io/en/latest/tutorials/visualization_tutorial.html).
118
+ - An initial update to the tutorial was made in [#2289](https://github.com/projectmesa/mesa/pull/2289) and is [available here](https://mesa.readthedocs.io/latest/tutorials/visualization_tutorial.html).
69
119
  - An initial example model was updated in [mesa-examples#195](https://github.com/projectmesa/mesa-examples/pull/195), and more examples will be updated in [mesa-examples#195](https://github.com/projectmesa/mesa-examples/pull/193).
70
120
  - The old SolaraViz API is still available at `mesa.experimental`, but might be removed in future releases.
71
121
 
@@ -116,7 +166,7 @@ Our example models also got more love: We removed the `RandomActivation` schedul
116
166
 
117
167
  Finally, we have two brand new examples: An Ant Colony Optimization model using an Ant System approach to the Traveling Salesman problem, a Mesa NetworkGrid, and a custom visualisation with SolaraViz ([examples#157](https://github.com/projectmesa/mesa-examples/pull/157) by @zjost). The first example using the `PropertyLayer` was added, a very fast implementation of Conway's Game of Life ([examples#182](https://github.com/projectmesa/mesa-examples/pull/182)).
118
168
 
119
- To help the transition to Mesa 3.0, we started writing a [migration guide](https://mesa.readthedocs.io/en/latest/migration_guide.html). Progress is tracked in #2233, feedback and help is appreciated! Finally, we also added a new section to our [contributor guide](https://github.com/projectmesa/mesa/blob/main/CONTRIBUTING.md#i-have-no-idea-where-to-start) to get new contributors up to speed.
169
+ To help the transition to Mesa 3.0, we started writing a [migration guide](https://mesa.readthedocs.io/latest/migration_guide.html). Progress is tracked in #2233, feedback and help is appreciated! Finally, we also added a new section to our [contributor guide](https://github.com/projectmesa/mesa/blob/main/CONTRIBUTING.md#i-have-no-idea-where-to-start) to get new contributors up to speed.
120
170
 
121
171
  This pre-release can be installed as always with `pip install --pre mesa`
122
172
 
@@ -207,7 +257,7 @@ This is the first pre-release in the Mesa 3.0 series, which is still in active d
207
257
  Since it's in active development, more breaking changes may follow and it's not recommended for general usage.
208
258
 
209
259
  There are two major breaking changes at this point:
210
- - The old visualisation is removed, in favor of the new, Solara based, Jupyter Viz. This was already available in the 2.3.x release series, but is now stabilized. Checkout out our new [Visualization Tutorial](https://mesa.readthedocs.io/en/latest/tutorials/visualization_tutorial.html). More examples and a migration guide will follow later in the Mesa 3.0 development.
260
+ - The old visualisation is removed, in favor of the new, Solara based, Jupyter Viz. This was already available in the 2.3.x release series, but is now stabilized. Checkout out our new [Visualization Tutorial](https://mesa.readthedocs.io/latest/tutorials/visualization_tutorial.html). More examples and a migration guide will follow later in the Mesa 3.0 development.
211
261
  - The `mesa.flat` namespace is removed, since was not used very often.
212
262
 
213
263
  Mesa 3.0 will require Python 3.10+.
mesa-3.0.0b0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -1,10 +1,10 @@
1
- Copyright 2023 Core Mesa Team and contributors
1
+ Copyright 2014-2024 Core Mesa Team and contributors
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
5
5
  You may obtain a copy of the License at
6
6
 
7
- http://www.apache.org/licenses/LICENSE-2.0
7
+ https://www.apache.org/licenses/LICENSE-2.0
8
8
 
9
9
  Unless required by applicable law or agreed to in writing, software
10
10
  distributed under the License is distributed on an "AS IS" BASIS,
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: Mesa
3
- Version: 3.0.0a5
3
+ Version: 3.0.0b0
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
9
  License-File: LICENSE
10
+ License-File: NOTICE
10
11
  Keywords: ABM,agent,based,model,modeling,multi-agent,simulation
11
12
  Classifier: Development Status :: 3 - Alpha
12
13
  Classifier: Intended Audience :: Science/Research
@@ -22,30 +23,60 @@ Classifier: Topic :: Scientific/Engineering
22
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
24
  Classifier: Topic :: Scientific/Engineering :: Artificial Life
24
25
  Requires-Python: >=3.10
25
- Requires-Dist: click
26
- Requires-Dist: cookiecutter
27
- Requires-Dist: matplotlib
28
- Requires-Dist: networkx
29
26
  Requires-Dist: numpy
30
27
  Requires-Dist: pandas
31
- Requires-Dist: solara
32
28
  Requires-Dist: tqdm
29
+ Provides-Extra: all
30
+ Requires-Dist: cookiecutter; extra == 'all'
31
+ Requires-Dist: ipython; extra == 'all'
32
+ Requires-Dist: matplotlib; extra == 'all'
33
+ Requires-Dist: myst-nb; extra == 'all'
34
+ Requires-Dist: myst-parser; extra == 'all'
35
+ Requires-Dist: networkx; extra == 'all'
36
+ Requires-Dist: pydata-sphinx-theme; extra == 'all'
37
+ Requires-Dist: pytest; extra == 'all'
38
+ Requires-Dist: pytest-cov; extra == 'all'
39
+ Requires-Dist: pytest-mock; extra == 'all'
40
+ Requires-Dist: ruff; extra == 'all'
41
+ Requires-Dist: scipy; extra == 'all'
42
+ Requires-Dist: seaborn; extra == 'all'
43
+ Requires-Dist: solara; extra == 'all'
44
+ Requires-Dist: sphinx; extra == 'all'
33
45
  Provides-Extra: dev
46
+ Requires-Dist: cookiecutter; extra == 'dev'
47
+ Requires-Dist: matplotlib; extra == 'dev'
48
+ Requires-Dist: networkx; extra == 'dev'
49
+ Requires-Dist: pytest; extra == 'dev'
34
50
  Requires-Dist: pytest-cov; extra == 'dev'
35
51
  Requires-Dist: pytest-mock; extra == 'dev'
36
- Requires-Dist: pytest>=4.6; extra == 'dev'
37
- Requires-Dist: ruff~=0.1.1; extra == 'dev'
52
+ Requires-Dist: ruff; extra == 'dev'
53
+ Requires-Dist: solara; extra == 'dev'
38
54
  Requires-Dist: sphinx; extra == 'dev'
39
55
  Provides-Extra: docs
40
56
  Requires-Dist: ipython; extra == 'docs'
57
+ Requires-Dist: matplotlib; extra == 'docs'
41
58
  Requires-Dist: myst-nb; extra == 'docs'
42
59
  Requires-Dist: myst-parser; extra == 'docs'
60
+ Requires-Dist: networkx; extra == 'docs'
43
61
  Requires-Dist: pydata-sphinx-theme; extra == 'docs'
44
62
  Requires-Dist: seaborn; extra == 'docs'
63
+ Requires-Dist: solara; extra == 'docs'
45
64
  Requires-Dist: sphinx; extra == 'docs'
46
65
  Provides-Extra: examples
47
- Requires-Dist: pytest>=4.6; extra == 'examples'
66
+ Requires-Dist: matplotlib; extra == 'examples'
67
+ Requires-Dist: networkx; extra == 'examples'
68
+ Requires-Dist: pytest; extra == 'examples'
48
69
  Requires-Dist: scipy; extra == 'examples'
70
+ Requires-Dist: solara; extra == 'examples'
71
+ Provides-Extra: network
72
+ Requires-Dist: networkx; extra == 'network'
73
+ Provides-Extra: rec
74
+ Requires-Dist: matplotlib; extra == 'rec'
75
+ Requires-Dist: networkx; extra == 'rec'
76
+ Requires-Dist: solara; extra == 'rec'
77
+ Provides-Extra: viz
78
+ Requires-Dist: matplotlib; extra == 'viz'
79
+ Requires-Dist: solara; extra == 'viz'
49
80
  Description-Content-Type: text/markdown
50
81
 
51
82
  # Mesa: Agent-based modeling in Python
@@ -78,7 +109,7 @@ can be displayed in browser windows or Jupyter.*
78
109
 
79
110
  ## Using Mesa
80
111
 
81
- To install our latest stable release (2.3.x), run:
112
+ To install our latest stable release (2.4.x), run:
82
113
 
83
114
  ``` bash
84
115
  pip install -U mesa
@@ -89,6 +120,17 @@ To install our latest pre-release (3.0.0 alpha), run:
89
120
  ``` bash
90
121
  pip install -U --pre mesa
91
122
  ```
123
+ With Mesa 3.0, we don't install all our dependencies anymore by default.
124
+ ```bash
125
+ # You can customize the additional dependencies you need, if you want. Available are:
126
+ pip install -U --pre mesa[network,viz]
127
+
128
+ # This is equivalent to our recommended dependencies:
129
+ pip install -U --pre mesa[rec]
130
+
131
+ # To install all, including developer, dependencies:
132
+ pip install -U --pre mesa[all]
133
+ ```
92
134
 
93
135
  You can also use `pip` to install the latest GitHub version:
94
136
 
@@ -107,13 +149,13 @@ For resources or help on using Mesa, check out the following:
107
149
 
108
150
  - [Intro to Mesa Tutorial](http://mesa.readthedocs.org/en/stable/tutorials/intro_tutorial.html) (An introductory model, the Boltzmann
109
151
  Wealth Model, for beginners or those new to Mesa.)
110
- - [Visualization Tutorial](https://mesa.readthedocs.io/en/stable/tutorials/visualization_tutorial.html) (An introduction into our Solara visualization)
152
+ - [Visualization Tutorial](https://mesa.readthedocs.io/stable/tutorials/visualization_tutorial.html) (An introduction into our Solara visualization)
111
153
  - [Complexity Explorer Tutorial](https://www.complexityexplorer.org/courses/172-agent-based-models-with-python-an-introduction-to-mesa) (An advanced-beginner model,
112
154
  SugarScape with Traders, with instructional videos)
113
- - [Mesa Examples](https://github.com/projectmesa/mesa-examples/tree/main/examples) (A repository of seminal ABMs using Mesa and
155
+ - [Mesa Examples](https://github.com/projectmesa/mesa-examples) (A repository of seminal ABMs using Mesa and
114
156
  examples of employing specific Mesa Features)
115
157
  - [Docs](http://mesa.readthedocs.org/) (Mesa's documentation, API and useful snippets)
116
- - [Development version docs](https://mesa.readthedocs.io/en/latest/) (the latest version docs if you're using a pre-release Mesa version)
158
+ - [Development version docs](https://mesa.readthedocs.io/latest/) (the latest version docs if you're using a pre-release Mesa version)
117
159
  - [Discussions](https://github.com/projectmesa/mesa/discussions) (GitHub threaded discussions about Mesa)
118
160
  - [Matrix Chat](https://matrix.to/#/#project-mesa:matrix.org) (Chat Forum via Matrix to talk about Mesa)
119
161
 
@@ -28,7 +28,7 @@ can be displayed in browser windows or Jupyter.*
28
28
 
29
29
  ## Using Mesa
30
30
 
31
- To install our latest stable release (2.3.x), run:
31
+ To install our latest stable release (2.4.x), run:
32
32
 
33
33
  ``` bash
34
34
  pip install -U mesa
@@ -39,6 +39,17 @@ To install our latest pre-release (3.0.0 alpha), run:
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.
43
+ ```bash
44
+ # You can customize the additional dependencies you need, if you want. Available are:
45
+ pip install -U --pre mesa[network,viz]
46
+
47
+ # This is equivalent to our recommended dependencies:
48
+ pip install -U --pre mesa[rec]
49
+
50
+ # To install all, including developer, dependencies:
51
+ pip install -U --pre mesa[all]
52
+ ```
42
53
 
43
54
  You can also use `pip` to install the latest GitHub version:
44
55
 
@@ -57,13 +68,13 @@ For resources or help on using Mesa, check out the following:
57
68
 
58
69
  - [Intro to Mesa Tutorial](http://mesa.readthedocs.org/en/stable/tutorials/intro_tutorial.html) (An introductory model, the Boltzmann
59
70
  Wealth Model, for beginners or those new to Mesa.)
60
- - [Visualization Tutorial](https://mesa.readthedocs.io/en/stable/tutorials/visualization_tutorial.html) (An introduction into our Solara visualization)
71
+ - [Visualization Tutorial](https://mesa.readthedocs.io/stable/tutorials/visualization_tutorial.html) (An introduction into our Solara visualization)
61
72
  - [Complexity Explorer Tutorial](https://www.complexityexplorer.org/courses/172-agent-based-models-with-python-an-introduction-to-mesa) (An advanced-beginner model,
62
73
  SugarScape with Traders, with instructional videos)
63
- - [Mesa Examples](https://github.com/projectmesa/mesa-examples/tree/main/examples) (A repository of seminal ABMs using Mesa and
74
+ - [Mesa Examples](https://github.com/projectmesa/mesa-examples) (A repository of seminal ABMs using Mesa and
64
75
  examples of employing specific Mesa Features)
65
76
  - [Docs](http://mesa.readthedocs.org/) (Mesa's documentation, API and useful snippets)
66
- - [Development version docs](https://mesa.readthedocs.io/en/latest/) (the latest version docs if you're using a pre-release Mesa version)
77
+ - [Development version docs](https://mesa.readthedocs.io/latest/) (the latest version docs if you're using a pre-release Mesa version)
67
78
  - [Discussions](https://github.com/projectmesa/mesa/discussions) (GitHub threaded discussions about Mesa)
68
79
  - [Matrix Chat](https://matrix.to/#/#project-mesa:matrix.org) (Chat Forum via Matrix to talk about Mesa)
69
80
 
@@ -40,7 +40,7 @@ class BoltzmannWealth(mesa.Model):
40
40
  width: the width of the grid
41
41
  height: the height of the grid
42
42
  """
43
- super().__init__(seed)
43
+ super().__init__(seed=seed)
44
44
  self.num_agents = n
45
45
  self.grid = mesa.space.MultiGrid(width, height, True)
46
46
  self.datacollector = mesa.DataCollector(
@@ -1,13 +1,22 @@
1
1
  """Schelling separation for performance benchmarking."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from mesa import Model
4
- from mesa.experimental.cell_space import CellAgent, OrthogonalMooreGrid
6
+ from mesa.experimental.cell_space import Cell, CellAgent, OrthogonalMooreGrid
5
7
 
6
8
 
7
9
  class SchellingAgent(CellAgent):
8
10
  """Schelling segregation agent."""
9
11
 
10
- def __init__(self, model, agent_type, radius, homophily):
12
+ def __init__(
13
+ self,
14
+ model: Schelling,
15
+ agent_type: int,
16
+ radius: int,
17
+ homophily: float,
18
+ cell: Cell,
19
+ ):
11
20
  """Create a new Schelling agent.
12
21
 
13
22
  Args:
@@ -15,11 +24,13 @@ class SchellingAgent(CellAgent):
15
24
  agent_type: type of agent (minority=1, majority=0)
16
25
  radius: size of neighborhood of agent
17
26
  homophily: fraction of neighbors of the same type that triggers movement
27
+ cell: the cell in which the agent is located
18
28
  """
19
29
  super().__init__(model)
20
30
  self.type = agent_type
21
31
  self.radius = radius
22
32
  self.homophily = homophily
33
+ self.cell = cell
23
34
 
24
35
  def step(self):
25
36
  """Run one step of the agent."""
@@ -31,7 +42,7 @@ class SchellingAgent(CellAgent):
31
42
 
32
43
  # If unhappy, move:
33
44
  if similar < self.homophily:
34
- self.move_to(self.model.grid.select_random_empty_cell())
45
+ self.cell = self.model.grid.select_random_empty_cell()
35
46
  else:
36
47
  self.model.happy += 1
37
48
 
@@ -41,6 +52,7 @@ class Schelling(Model):
41
52
 
42
53
  def __init__(
43
54
  self,
55
+ simulator=None,
44
56
  height=40,
45
57
  width=40,
46
58
  homophily=3,
@@ -48,11 +60,11 @@ class Schelling(Model):
48
60
  density=0.8,
49
61
  minority_pc=0.5,
50
62
  seed=None,
51
- simulator=None,
52
63
  ):
53
64
  """Create a new Schelling model.
54
65
 
55
66
  Args:
67
+ simulator: simulator instance
56
68
  height: height of the grid
57
69
  width: width of the grid
58
70
  homophily: Minimum number of agents of same class needed to be happy
@@ -63,8 +75,9 @@ class Schelling(Model):
63
75
  simulator: a simulator instance
64
76
  """
65
77
  super().__init__(seed=seed)
66
- self.minority_pc = minority_pc
67
78
  self.simulator = simulator
79
+ self.minority_pc = minority_pc
80
+ self.happy = 0
68
81
 
69
82
  self.grid = OrthogonalMooreGrid(
70
83
  [height, width],
@@ -80,8 +93,7 @@ class Schelling(Model):
80
93
  for cell in self.grid:
81
94
  if self.random.random() < density:
82
95
  agent_type = 1 if self.random.random() < self.minority_pc else 0
83
- agent = SchellingAgent(self, agent_type, radius, homophily)
84
- agent.move_to(cell)
96
+ SchellingAgent(self, agent_type, radius, homophily, cell)
85
97
 
86
98
  def step(self):
87
99
  """Run one step of the model."""