forked from projectmesa/mesa-examples
-
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.
Move examples from mesa repo to mesa-examples repo.
- Loading branch information
1 parent
b3760b5
commit 3aa8185
Showing
151 changed files
with
4,907 additions
and
5,969 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
examples/Boltzmann_Wealth_Model/boltzmann_wealth_model/server.py
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,40 @@ | ||
import mesa | ||
|
||
from .model import BoltzmannWealthModel | ||
|
||
|
||
def agent_portrayal(agent): | ||
portrayal = {"Shape": "circle", "Filled": "true", "r": 0.5} | ||
|
||
if agent.wealth > 0: | ||
portrayal["Color"] = "red" | ||
portrayal["Layer"] = 0 | ||
else: | ||
portrayal["Color"] = "grey" | ||
portrayal["Layer"] = 1 | ||
portrayal["r"] = 0.2 | ||
return portrayal | ||
|
||
|
||
grid = mesa.visualization.CanvasGrid(agent_portrayal, 10, 10, 500, 500) | ||
chart = mesa.visualization.ChartModule( | ||
[{"Label": "Gini", "Color": "#0000FF"}], data_collector_name="datacollector" | ||
) | ||
|
||
model_params = { | ||
"N": mesa.visualization.Slider( | ||
"Number of agents", | ||
100, | ||
2, | ||
200, | ||
1, | ||
description="Choose how many agents to include in the model", | ||
), | ||
"width": 10, | ||
"height": 10, | ||
} | ||
|
||
server = mesa.visualization.ModularServer( | ||
BoltzmannWealthModel, [grid, chart], "Money Model", model_params | ||
) | ||
server.port = 8521 |
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 boltzmann_wealth_model.server import server | ||
|
||
server.launch() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
132 changes: 0 additions & 132 deletions
132
examples/EpsteinCivilViolence/.ipynb_checkpoints/Epstein Civil Violence-checkpoint.ipynb
This file was deleted.
Oops, something went wrong.
133 changes: 0 additions & 133 deletions
133
examples/EpsteinCivilViolence/Epstein Civil Violence.ipynb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.