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
Copy file name to clipboardExpand all lines: docs/best-practices.md
+15-18Lines changed: 15 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,21 @@ Here are some general principles that have proven helpful for developing models.
5
5
## Model Layout
6
6
7
7
A model should be contained in a folder named with lower-case letters and
8
-
underscores, such as `thunder_cats`. Within that directory:
9
-
10
-
-`README.md` describes the model, how to use it, and any other details.
11
-
Github will automatically show this file to anyone visiting the directory.
12
-
-`model.py` should contain the model class. If the file gets large, it may
13
-
make sense to move the complex bits into other files, but this is the first
14
-
place readers will look to figure out how the model works.
15
-
-`server.py` should contain the visualization support, including the server
16
-
class.
17
-
-`run.py` is a Python script that will run the model when invoked via
18
-
`mesa runserver`.
19
-
20
-
After the number of files grows beyond a half-dozen, try to use sub-folders to
21
-
organize them. For example, if the visualization uses image files, put those in
22
-
an `images` directory.
23
-
24
-
The [Schelling](https://github.com/projectmesa/mesa-examples/tree/main/examples/schelling) model is
25
-
a good example of a small well-packaged model.
8
+
underscores, such as `wolf_sheep`. Within that directory:
9
+
10
+
-`Readme.md` describes the model, how to use it, and any other details.
11
+
-`model.py` should contain the model class.
12
+
-`agents.py` should contain the agent class(es).
13
+
-`app.py` should contain the Solara-based visualization code (optional).
14
+
15
+
You can add more files as needed, for example:
16
+
-`run.py` could contain the code to run the model.
17
+
-`batch_run.py` could contain the code to run the model multiple times.
18
+
-`analysis.py` could contain any analysis code.
19
+
20
+
Input data can be stored in a `data` directory, output data in an `output`, processed results in a `results` directory, images in an `images` directory, etc.
0 commit comments