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: mesa/examples/basic/boid_flockers/Readme.md
+5-26Lines changed: 5 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,17 @@
4
4
5
5
An implementation of Craig Reynolds's Boids flocker model. Agents (simulated birds) try to fly towards the average position of their neighbors and in the same direction as them, while maintaining a minimum distance. This produces flocking behavior.
6
6
7
-
This model tests Mesa's continuous space feature, and uses numpy arrays to represent vectors. It also demonstrates how to create custom visualization components.
8
-
9
-
## Installation
10
-
11
-
To install the dependencies use pip and the requirements.txt in this directory. e.g.
12
-
13
-
```
14
-
$ pip install -r requirements.txt
15
-
```
7
+
This model tests Mesa's continuous space feature, and uses numpy arrays to represent vectors.
16
8
17
9
## How to Run
18
10
19
-
* To launch the visualization interactively, run ``mesa runserver`` in this directory. e.g.
20
-
21
-
```
22
-
$ mesa runserver
23
-
```
24
-
25
-
or
26
-
27
-
Directly run the file ``run.py`` in the terminal. e.g.
28
-
29
-
```
30
-
$ python run.py
31
-
```
32
-
33
-
* Then open your browser to [http://127.0.0.1:8521/](http://127.0.0.1:8521/) and press Reset, then Run.
11
+
* To launch the visualization interactively, run ``solara run app.py`` in this directory.It will automatically open a browser page.
34
12
35
13
## Files
36
14
37
-
*[model.py](model.py): Core model file; contains the Boid Model and Boid Agent class.
38
-
*[app.py](app.py): Visualization code.
15
+
*[model.py](model.py): Ccntains the Boid Model
16
+
*[agents.py](agents.py): Contains the Boid agent
17
+
*[app.py](app.py): Solara based Visualization code.
0 commit comments