File tree Expand file tree Collapse file tree 2 files changed +5
-36
lines changed Expand file tree Collapse file tree 2 files changed +5
-36
lines changed Original file line number Diff line number Diff line change 33A simple implementation of a Schelling segregation model.
44
55
6- Implemented here to test / demonstrate several Mesa concepts and features:
7- - This version demonstrates the ASCII renderer.
8-
6+ Implemented here to test / demonstrate several Mesa concepts and features.
97
108### To run this example
119
12- * Launch the model
13- ``` python
14- python Schelling .py
10+ * Launch the model with the browser visualization:
11+ ``` sh
12+ python SchellingModular .py
1513```
16- * Visit your browser: http://127.0.0.1:8888/
14+ * Open your browser to : http://127.0.0.1:8888/
1715* In your browser hit * reset* , then * run*
18-
19-
20- To use with iPython, run this code from the command line, e.g.
21- $ ipython -i Schelling.py
22-
23- viz is the visualization wrapper around
24- To print the current state of the model:
25- viz.render()
26-
27- To advance the model by one step and print the new state:
28- viz.step()
29-
30- To advance the model by e.g. 10 steps and print the new state:
31- viz.step_forward(10)
Original file line number Diff line number Diff line change 33=========================================
44
55A simple implementation of a Schelling segregation model.
6-
7- This version demonstrates the ASCII renderer.
8- To use, run this code from the command line, e.g.
9- $ ipython -i Schelling.py
10-
11- viz is the visualization wrapper around
12- To print the current state of the model:
13- viz.render()
14-
15- To advance the model by one step and print the new state:
16- viz.step()
17-
18- To advance the model by e.g. 10 steps and print the new state:
19- viz.step_forward(10)
20-
216'''
227
238from __future__ import division # For Python 2.x compatibility
You can’t perform that action at this time.
0 commit comments