Mesa 2.3.0rc1__tar.gz → 2.3.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.
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/workflows/build_lint.yml +3 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/workflows/release.yml +2 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/HISTORY.md +33 -7
- {mesa-2.3.0rc1 → mesa-2.3.2}/PKG-INFO +1 -1
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/api_main.md +1 -0
- mesa-2.3.2/docs/apis/experimental.md +60 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/__init__.py +1 -1
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/batchrunner.py +4 -4
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/datacollection.py +11 -6
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/components/matplotlib.py +1 -1
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/space.py +1 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.codespellignore +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.coveragerc +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/ISSUE_TEMPLATE/asking-help.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/ISSUE_TEMPLATE/bug-report.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/ISSUE_TEMPLATE/feature-request.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/dependabot.yml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/release.yml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.github/workflows/benchmarks.yml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.gitignore +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.pre-commit-config.yaml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/.readthedocs.yml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/CITATION.bib +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/CODE_OF_CONDUCT.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/CONTRIBUTING.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/Dockerfile +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/LICENSE +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/README.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/Flocking/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/Flocking/flocking.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/Schelling/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/Schelling/schelling.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/WolfSheep/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/WolfSheep/wolf_sheep.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/compare_timings.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/configurations.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/benchmarks/global_benchmark.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/codecov.yaml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docker-compose.yml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/Makefile +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/README.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/batchrunner.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/datacollection.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/init.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/space.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/time.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/apis/visualization.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/best-practices.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/conf.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/howto.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/Mesa_Screenshot.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/mesa_logo.ico +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/mesa_logo.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/br_ginis.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/dc_endwealth.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/dc_gini.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/dc_oneagent.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/first_hist.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/multirun_hist.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/numpy_grid.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/viz_chart.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/viz_empty.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/viz_greycircles.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/viz_histogram.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/images/tutorial/viz_redcircles.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/index.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/make.bat +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/mesa.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/mesa.visualization.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/mesa.visualization.modules.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/modular-visualization.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/overview.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/packages.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/MoneyModel.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/adv_tutorial_legacy.ipynb +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/files/viz_chart.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/files/viz_empty.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/files/viz_greycircles.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/files/viz_histogram.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/files/viz_redcircles.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/files/viz_slider.png +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/intro_tutorial.ipynb +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/docs/tutorials/visualization_tutorial.ipynb +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/agent.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/cookiecutter.json +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/hooks/post_gen_project.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/README.md +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/run.pytemplate +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/setup.pytemplate +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/model.pytemplate +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/server.pytemplate +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/UserParam.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/cell.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/cell_agent.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/cell_collection.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/discrete_space.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/grid.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/cell_space/network.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/components/altair.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/devs/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/devs/eventlist.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/devs/examples/epstein_civil_violence.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/devs/examples/wolf_sheep.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/devs/simulator.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/experimental/jupyter_viz.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/flat/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/flat/visualization.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/main.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/model.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/time.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/visualization/ModularVisualization.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/visualization/TextVisualization.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/visualization/UserParam.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/visualization/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mesa/visualization/modules.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/mypy.ini +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/pyproject.toml +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/__init__.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/read_requirements.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_agent.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_batch_run.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_cell_space.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_datacollector.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_devs.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_end_to_end_viz.sh +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_examples.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_grid.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_import_namespace.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_jupyter_viz.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_lifespan.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_main.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_model.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_scaffold.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_space.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_time.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_tornado.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_usersettableparam.py +0 -0
- {mesa-2.3.0rc1 → mesa-2.3.2}/tests/test_visualization.py +0 -0
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Release History
|
|
3
3
|
---
|
|
4
|
-
# 2.3.
|
|
4
|
+
# 2.3.2 (2024-07-22)
|
|
5
|
+
## Highlights
|
|
6
|
+
Mesa 2.3.2 is a small patch release which fixes two bugs, one to the batch_run function still depending on `schedule.steps`, and one in the agent marker visualisation.
|
|
7
|
+
|
|
8
|
+
## What's Changed
|
|
9
|
+
### 🐛 Bugs fixed
|
|
10
|
+
* fix: Render agent marker radius correctly by @rht in https://github.com/projectmesa/mesa/pull/2181
|
|
11
|
+
* fix: Use model.schedule.steps -> mode._steps for batch_run by @rht in https://github.com/projectmesa/mesa/pull/2183
|
|
12
|
+
|
|
13
|
+
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v2.3.1...v2.3.2
|
|
14
|
+
|
|
15
|
+
# 2.3.1 (2024-07-03)
|
|
16
|
+
## Highlights
|
|
17
|
+
Mesa 2.3.1 is a small patch release with a datacollector bug fixed and improved documentation.
|
|
18
|
+
|
|
19
|
+
## What's Changed
|
|
20
|
+
### 🐛 Bugs fixed
|
|
21
|
+
* datacollector: store separate snapshots of model data per step by @EwoutH in https://github.com/projectmesa/mesa/pull/2129
|
|
22
|
+
### 📜 Documentation improvements
|
|
23
|
+
* Add experimental features to documentation as per #2122 by @stephenfmann in https://github.com/projectmesa/mesa/pull/2154
|
|
24
|
+
|
|
25
|
+
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v2.3.0...v2.3.1
|
|
26
|
+
|
|
27
|
+
# 2.3.0 (2024-04-23)
|
|
5
28
|
## Highlights
|
|
6
|
-
|
|
29
|
+
Mesa 2.3.0 is a big feature release and the last feature release before 3.0.
|
|
7
30
|
|
|
8
31
|
There are two main new features:
|
|
9
32
|
- The experimental cell-centric discrete spaces, as added in #1994. It allows having cells with not only properties but also active behaviors: the `CellAgent`. Its inspired by NetLogo's [patches](https://ccl.northwestern.edu/netlogo/bind/primitive/patches.html) but extend and generalize this concept further.
|
|
@@ -13,11 +36,11 @@ There are a lot of other features: The Jupyter visualisation now supports easier
|
|
|
13
36
|
|
|
14
37
|
Finally, 2.3.0 stabilizes the `AgentSet` (including `model.agents`), making it the first experimental Mesa feature that is taken out of it's experimental phase.
|
|
15
38
|
|
|
16
|
-
Install this
|
|
39
|
+
Install this release with:
|
|
17
40
|
```
|
|
18
|
-
pip install --
|
|
41
|
+
pip install --upgrade mesa
|
|
19
42
|
```
|
|
20
|
-
|
|
43
|
+
The Mesa 2.3.x-series supports Python 3.9 to 3.12. The next major release will require Python 3.10.
|
|
21
44
|
|
|
22
45
|
## What's Changed
|
|
23
46
|
### 🧪 Experimental features
|
|
@@ -34,7 +57,7 @@ We would love feedback before we release 2.3.0 stable in ~1 week.
|
|
|
34
57
|
* feat: Let mesa runserver detect server.py as fallback by @rht in https://github.com/projectmesa/mesa/pull/2015
|
|
35
58
|
* JupyterViz: {Convert make_plot & prepare ColorCard} to become Solara component by @rht in https://github.com/projectmesa/mesa/pull/2020
|
|
36
59
|
* new feature: AgentSet.get can retrieve one or more then one attribute by @quaquel in https://github.com/projectmesa/mesa/pull/2044
|
|
37
|
-
* Update CODE_OF_CONDUCT.md to version 2+ of contrib
|
|
60
|
+
* Update CODE_OF_CONDUCT.md to version 2+ of contrib covenant by @jackiekazil in https://github.com/projectmesa/mesa/pull/2052
|
|
38
61
|
* Improve flocking benchmark by @coderbeta1 in https://github.com/projectmesa/mesa/pull/2054
|
|
39
62
|
* Remove JupyterViz Altair marker overlap for huge grid size by @rht in https://github.com/projectmesa/mesa/pull/2062
|
|
40
63
|
* Add tooltip option to Altair chart by @FoFFolo in https://github.com/projectmesa/mesa/pull/2082
|
|
@@ -87,7 +110,10 @@ We would love feedback before we release 2.3.0 stable in ~1 week.
|
|
|
87
110
|
* @FoFFolo made their first contribution in https://github.com/projectmesa/mesa/pull/2082
|
|
88
111
|
* @puer-robustus made their first contribution in https://github.com/projectmesa/mesa/pull/2083
|
|
89
112
|
|
|
90
|
-
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v2.2.4...2.3.0
|
|
113
|
+
**Full Changelog**: https://github.com/projectmesa/mesa/compare/v2.2.4...2.3.0
|
|
114
|
+
|
|
115
|
+
# 2.3.0-rc1 (2024-04-18)
|
|
116
|
+
Mesa 2.3.0-rc1 is pre-release in preparation for 2.3.0 stable. It had the same release notes as 2.3.0.
|
|
91
117
|
|
|
92
118
|
# 2.2.4 (2024-01-26)
|
|
93
119
|
## Highlights
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Experimental
|
|
2
|
+
|
|
3
|
+
```{eval-rst}
|
|
4
|
+
.. automodule:: experimental.__init__
|
|
5
|
+
:members:
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
## Cell Space
|
|
9
|
+
|
|
10
|
+
```{eval-rst}
|
|
11
|
+
.. automodule:: experimental.cell_space.__init__
|
|
12
|
+
:members:
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```{eval-rst}
|
|
16
|
+
.. automodule:: experimental.cell_space.cell
|
|
17
|
+
:members:
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```{eval-rst}
|
|
21
|
+
.. automodule:: experimental.cell_space.cell_agent
|
|
22
|
+
:members:
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```{eval-rst}
|
|
26
|
+
.. automodule:: experimental.cell_space.cell_collection
|
|
27
|
+
:members:
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```{eval-rst}
|
|
31
|
+
.. automodule:: experimental.cell_space.discrete_space
|
|
32
|
+
:members:
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```{eval-rst}
|
|
36
|
+
.. automodule:: experimental.cell_space.grid
|
|
37
|
+
:members:
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```{eval-rst}
|
|
41
|
+
.. automodule:: experimental.cell_space.network
|
|
42
|
+
:members:
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Devs
|
|
46
|
+
|
|
47
|
+
```{eval-rst}
|
|
48
|
+
.. automodule:: experimental.devs.__init__
|
|
49
|
+
:members:
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```{eval-rst}
|
|
53
|
+
.. automodule:: experimental.devs.eventlist
|
|
54
|
+
:members:
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```{eval-rst}
|
|
58
|
+
.. automodule:: experimental.devs.simulator
|
|
59
|
+
:members:
|
|
60
|
+
```
|
|
@@ -26,7 +26,7 @@ __all__ = [
|
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
__title__ = "mesa"
|
|
29
|
-
__version__ = "2.3.
|
|
29
|
+
__version__ = "2.3.2"
|
|
30
30
|
__license__ = "Apache 2.0"
|
|
31
31
|
_this_year = datetime.datetime.now(tz=datetime.timezone.utc).date().year
|
|
32
32
|
__copyright__ = f"Copyright {_this_year} Project Mesa Team"
|
|
@@ -132,14 +132,14 @@ def _model_run_func(
|
|
|
132
132
|
"""
|
|
133
133
|
run_id, iteration, kwargs = run
|
|
134
134
|
model = model_cls(**kwargs)
|
|
135
|
-
while model.running and model.
|
|
135
|
+
while model.running and model._steps <= max_steps:
|
|
136
136
|
model.step()
|
|
137
137
|
|
|
138
138
|
data = []
|
|
139
139
|
|
|
140
|
-
steps = list(range(0, model.
|
|
141
|
-
if not steps or steps[-1] != model.
|
|
142
|
-
steps.append(model.
|
|
140
|
+
steps = list(range(0, model._steps, data_collection_period))
|
|
141
|
+
if not steps or steps[-1] != model._steps - 1:
|
|
142
|
+
steps.append(model._steps - 1)
|
|
143
143
|
|
|
144
144
|
for step in steps:
|
|
145
145
|
model_data, all_agents_data = _collect_data(model, step)
|
|
@@ -36,6 +36,7 @@ The default DataCollector here makes several assumptions:
|
|
|
36
36
|
import contextlib
|
|
37
37
|
import itertools
|
|
38
38
|
import types
|
|
39
|
+
from copy import deepcopy
|
|
39
40
|
from functools import partial
|
|
40
41
|
|
|
41
42
|
with contextlib.suppress(ImportError):
|
|
@@ -197,17 +198,21 @@ class DataCollector:
|
|
|
197
198
|
for var, reporter in self.model_reporters.items():
|
|
198
199
|
# Check if lambda or partial function
|
|
199
200
|
if isinstance(reporter, (types.LambdaType, partial)):
|
|
200
|
-
|
|
201
|
+
# Use deepcopy to store a copy of the data,
|
|
202
|
+
# preventing references from being updated across steps.
|
|
203
|
+
self.model_vars[var].append(deepcopy(reporter(model)))
|
|
201
204
|
# Check if model attribute
|
|
202
205
|
elif isinstance(reporter, str):
|
|
203
|
-
self.model_vars[var].append(
|
|
206
|
+
self.model_vars[var].append(
|
|
207
|
+
deepcopy(getattr(model, reporter, None))
|
|
208
|
+
)
|
|
204
209
|
# Check if function with arguments
|
|
205
210
|
elif isinstance(reporter, list):
|
|
206
|
-
self.model_vars[var].append(reporter[0](*reporter[1]))
|
|
207
|
-
#
|
|
208
|
-
#
|
|
211
|
+
self.model_vars[var].append(deepcopy(reporter[0](*reporter[1])))
|
|
212
|
+
# Assume it's a callable otherwise (e.g., method)
|
|
213
|
+
# TODO: Check if method of a class explicitly
|
|
209
214
|
else:
|
|
210
|
-
self.model_vars[var].append(reporter())
|
|
215
|
+
self.model_vars[var].append(deepcopy(reporter()))
|
|
211
216
|
|
|
212
217
|
if self.agent_reporters:
|
|
213
218
|
agent_records = self._record_agents(model)
|
|
@@ -50,7 +50,7 @@ def _draw_grid(space, space_ax, agent_portrayal):
|
|
|
50
50
|
out = {"x": x, "y": y}
|
|
51
51
|
# This is the default value for the marker size, which auto-scales
|
|
52
52
|
# according to the grid area.
|
|
53
|
-
out["s"] = (180 /
|
|
53
|
+
out["s"] = (180 / max(g.width, g.height)) ** 2
|
|
54
54
|
if len(s) > 0:
|
|
55
55
|
out["s"] = s
|
|
56
56
|
if len(c) > 0:
|
|
@@ -461,6 +461,7 @@ class _Grid:
|
|
|
461
461
|
# Find the closest position without sorting all positions
|
|
462
462
|
closest_pos = None
|
|
463
463
|
min_distance = float("inf")
|
|
464
|
+
agent.random.shuffle(pos)
|
|
464
465
|
for p in pos:
|
|
465
466
|
distance = self._distance_squared(p, current_pos)
|
|
466
467
|
if distance < min_distance:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|