forked from projectmesa/mesa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructured the Basic example as per convention of other examples.
- Loading branch information
Jeetu
committed
Jul 16, 2016
1 parent
da4c1b4
commit 007e6f4
Showing
6 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
# Example Code | ||
# Basic Grid with two agents | ||
|
||
This directory contains multiple examples of basic functionality of Mesa. | ||
## Summary | ||
|
||
## shapes | ||
A very basic example model to showcase the visulaization on web browser. | ||
|
||
Showcases following features: | ||
A simple grid is dispalyed on browesr with two agents. The example does not | ||
have any agent motion involved. This example does not have any movenment of | ||
agents so as to keep it to the simplest of level possible. | ||
|
||
This model showcases following features: | ||
|
||
* A rectangular grid | ||
* ArrowHead shaped agent for displaying heading of the agent on CanvasGrid | ||
* Text Overlay on the agent's shape on CanvasGrid | ||
* ArrowHead shaped agent for displaying heading of the agent on CanvasGrid | ||
|
||
## Installation | ||
|
||
To install the dependencies use pip and the requirements.txt in this directory. | ||
e.g. | ||
|
||
#### How to Run | ||
``` | ||
$ pip install -r requirements.txt | ||
``` | ||
|
||
## How to Run | ||
|
||
To run the model interactively, run ``run.py`` in this directory. e.g. | ||
|
||
``` | ||
$ python shapes_viz.py | ||
``` | ||
|
||
Then open your browser to [http://127.0.0.1:8889/](http://127.0.0.1:8889/) and | ||
Then open your browser to [http://127.0.0.1:8888/](http://127.0.0.1:8888/) and | ||
press Reset, then Run. | ||
|
||
## Files | ||
|
||
* ``basic/model.py: Defines the Basic model and agents. | ||
* ``basic/server.py``: Sets up the interactive visualization server. | ||
* ``run.py``: Launches a model visualization server. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mesa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from basic.server import launch_basic | ||
|
||
launch_basic() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters