You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use Pathlib
Code by Phil Robare (versilimidude2)
* Use pre-commit
* Dropped unused imports
* used pre-commit to run pyupgrade, trim whitespace
* Remove pathlib changes
These belong in a separate PR.
* remove redundant black, move comment
as per rht's suggestions
---------
Co-authored-by: Catherine Devlin <[email protected]>
Copy file name to clipboardExpand all lines: examples/caching_and_replay/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ It uses the [Mesa-Replay](https://github.com/Logende/mesa-replay) library and pu
9
9
From the user's perspective, the new model behaves the same way as the original Schelling model, but additionally supports caching.
10
10
11
11
Note that the main purpose of this example is to demonstrate that caching and replaying simulation runs is possible.
12
-
The example is designed to be accessible.
12
+
The example is designed to be accessible.
13
13
In practice, someone who wants to replay their simulation might not necessarily embed a replay button into the web view, but instead have a dedicated script to run a simulation that is being cached, separate from a script to replay a simulation run from a given cache file.
14
14
More examples of caching and replay can be found in the [Mesa-Replay Repository](https://github.com/Logende/mesa-replay/tree/main/examples).
15
15
@@ -31,7 +31,7 @@ To run the model interactively, run ``mesa runserver`` in this directory. e.g.
31
31
32
32
Then open your browser to [http://127.0.0.1:8521/](http://127.0.0.1:8521/) and press Reset, then Run.
33
33
34
-
First, run the **simulation** with the 'Replay' switch disabled.
34
+
First, run the **simulation** with the 'Replay' switch disabled.
35
35
When the simulation run is finished (e.g. all agents are happy, no more new steps are simulated), the run will automatically be stored in a cache file.
36
36
37
37
Next, **replay** your latest cached simulation run by enabling the Replay switch and then pressing Reset.
Copy file name to clipboardExpand all lines: examples/hex_snowflake/hex_snowflake/cell.py
+3-1
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,9 @@ def step(self):
36
36
changed here, but is just computed and stored in self._nextState,
37
37
because our current state may still be necessary for our neighbors
38
38
to calculate their next state.
39
-
When a cell is made alive, its neighbors are able to be considered in the next step. Only cells that are considered check their neighbors for performance reasons.
39
+
When a cell is made alive, its neighbors are able to be considered
40
+
in the next step. Only cells that are considered check their neighbors
-[Complexity Explorer Sugarscape with Traders Tutorial](https://www.complexityexplorer.org/courses/172-agent-based-models-with-python-an-introduction-to-mesa)
0 commit comments