Mesa is a Python framework for agent-based modeling. I created example application simulation in Python and Bokeh and attached below.
Dictionary:
Agent class in Mesa - designed for movable objects across patterns investigations. Base class for a model agent. E.g. to create a new agent.
Agent files - model.py (agent class definition), run.py (server import ), server.py (statement to import all needed modules), mesa.py (all other statements)
Agent Based Modelling - (ABM) computational model for simulating the actions and interactions of autonomous agents (both individual or collective entities such as organisations or groups) in order to understand the behaviour of a system and what governs its outcomes.complexity.
Canvas grid - CanvasGrid works by looping over every cell in a grid, and generating a portrayal for every agent it finds.
Chart module in Mesa - A visualization is built up of a few different modules: for example, a module for drawing agents on a grid, and another one for drawing a chart of some variable,...
Continuous space - measures the distance for agents in cells intersecting with a circle of the given radius.
Data Collection module - DataCollector is meant to provide a simple, standard way to collect data generated by a Mesa model. It collects three types of data: model-level data, agent-level data, and tables. It stores the data in dictionaries afterwards.
Diffusion-limited aggregation - (DLA) is a growth process of clusters of aggregated particles driven by their random diffusion.
FPS - frames per second.
Grid - base class for square grid.
Mesh - in CppyABM discrete representation of the geometry containing spatial coordinates and connectivity is encapsulated in a Mesh object. For regular 2D and 3D geometries, the library provides the essential tools to generate Mesh objects.
Mistic - software package to view multiple multiplexed 2D images using pre-defined coordinates (e.g. t-SNE or UMAP), randomly generated coordinates, or as vertical grids to provide an overall visual preview of the entire multiplexed image dataset.
Model class in Mesa - Base class for models. Create a new model. Overload this method with the actual code to start the model.
Model.py file - the purpose is save file to server in write inside the commands e.g. to initialize the Agent class, create a step function, calculate the number of similar neighbors, move the agent to a empty location if the agent is unhappy.
Modular server - A visualization server which renders a model via one or more elements.
Modules in Mesa - Modeling (time, space, models), analysis (data collection, batch runner), visualisation (Canvasgrid, Modularserver ).
Multigrid in Mesa - extension to Grid where each cell is a set of objects.
Neighbors - neighbors to a certain point in space module.
Patch - in CppyABM patch is designed to simulate the properties of non-movable elements. A Patch object can accommodate agents as well as heterogeneous variables across the domain.
Rendering in Mesa - method, to get data out of the model object and into a JSON-ready format.
Run.py file - basic .py file to save script to server, run it afterwards and manage agents. It is linked to the main .py code and launches the server if you are using the front end. Example of content is: from server import server, server.launch()
Self variable in Mesa - This variable enables conditional shut off of the model once a condition is met.
Server.py file - this file contains the commands about import and installation of libraries after the file is called from server (other files to be saved on server are: __init__.py, agents.py, model.py, resources.py, server.py, utils.py)
Scheduler in Mesa - The scheduler is a special model component which controls the order in which agents are activated.
Shelling - Schelling’s segregation model, widely known as the very first ABM proposed in the early 1970s by Thomas Schelling, the 2005 Nobel Laureate in Economics. Schelling created this model in order to provide an explanation for why people with different ethnic backgrounds tend to segregate geographically.
SIR model - Susceptible-Infected-Recovered Model for Spread of Disease.
Space module - module has objects used to add a spatial component to a model. ( Grid: base grid, a simple list-of-lists. SingleGrid: grid which strictly enforces one object per cell. MultiGrid: extension to Grid where each cell is a set of objects. )
Related Python libraries :
AgentPy - open-source framework for the development and analysis of agent-based models in Python designed in 2020.
Bokeh - interactive “what if” scenarios or drill-down into the details of your data in python.
CppyABM - provides 2D and 3D modelling on any arbitrary shape.
Dash - Dash is a python framework created by plotly for creating interactive web applications. Dash is written on the top of Flask, Plotly. js and React. js.
Dask - Dask is a tool for scaling out PyData projects like NumPy, Pandas, Scikit-Learn, and RAPIDS.
Flask - Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries.
LibreTexts - they provide 3D video for ABM.
Mason - fast discrete-event multiagent simulation library core in Java, designed to be the foundation for large custom-purpose Java simulations in 2003.
Mesa - in 1976 ALGOL-like language with strong support for modular programming developed at Xerox. Python framework for creating agent-based models (ABM), 2D.
Networkx - python library to work with ABM.
Netlogo - NetLogo is a multi-agent programmable modeling environment. It was used by students, established in 1999.
Panel - python library for visualisation. E.g. to make two bokeh panes and update them at each step.
Plotly - Plotly's Python graphing library makes interactive, publication-quality graphs.
Pynsim - open-source library for building simulation models of networked systems.
Repast - The Recursive Porous Agent Simulation Toolkit (Repast) is a widely used free and open-source, cross-platform, agent-based modelling and simulation toolkit designed in 2006.
References:
https://youtu.be/D9iD72cuh98
http://www.agent-based-models.com/blog/
https://dmnfarrell.github.io/bioinformatics/abm-mesa-python
http://www.behaviorsearch.org/documentation/tutorial.html
https://dhh.uni.lu/2020/06/08/agent-based-modelling-with-netlogo/
http://www.behaviorsearch.org
http://www.agent-based-models.com/blog/resources/agent-based-models/
https://sweetcode.io/agent-based-modeling-netlogo/
https://github.com/projectmesa/mesa/tree/main/examples
https://math.libretexts.org/Bookshelves/Scientific_Computing_Simulations_and_Modeling/Book%3A_Introduction_to_the_Modeling_and_Analysis_of_Complex_Systems_(Sayama)/19%3A_AgentBased_Models/19.02%3A_Building_an_Agent-Based_Model
https://github.com/ncsa/COVID19-mesa
https://mesa.readthedocs.io/en/main/index.html
https://ccl.northwestern.edu/netlogo/models/UrbanSuite-Pollution
https://onlinelibrary.wiley.com/doi/full/10.1002/spe.3067
https://libretexts.org
https://pypi.org/project/Mesa/
https://plotly.com/dash/
https://github.com/dmnfarrell/teaching/tree/master/SIR_modelling
https://dash.gallery/Portal/
https://mesa.readthedocs.io/en/main/index.html
http://www.netlogoweb.org/launch#http://ccl.northwestern.edu/netlogo/models/models/Curricular%20Models/Urban%20Suite/Urban%20Suite%20-%20Pollution.nlogo
https://towardsdatascience.com/social-network-analysis-from-theory-to-applications-with-python-d12e9a34c2c7
https://www.youtube.com/watch?v=xaAzALyP6Ss
https://link.springer.com/article/10.1007/s40747-021-00532-5
https://towardsdatascience.com/introduction-to-mesa-agent-based-modeling-in-python-bcb0596e1c9a
https://ccl.northwestern.edu/netlogo/
https://repast.github.io
https://cs.gmu.edu/~eclab/projects/mason/
http://www.agent-based-models.com/blog/abm-with-mason-2/
https://www.youtube.com/watch?v=u-XeFNeImyk
https://www.researchgate.net/publication/346976207_Agentpy_-_Agent-based_modeling_in_Python
https://en.wikipedia.org/wiki/Mesa_(programming_language)
https://lrdegeest.github.io/blog/faster-abms-python
https://dadaromeo.github.io/posts/mesa-a-library-for-agent-based-modeling-in-python/
https://pythonlang.dev/repo/vaikkunth-privacyfl/
https://towardsdatascience.com/web-visualization-with-plotly-and-flask-3660abf9c946
https://realpython.com/python-dash/
https://towardsdatascience.com/dash-for-beginners-create-interactive-python-dashboards-338bfcb6ffa4
https://towardsdatascience.com/build-a-machine-learning-simulation-tool-with-dash-b3f6fd512ad6
https://pierpaolo28.github.io/blog/blog53/
https://www.sciencedirect.com/science/article/pii/S1364815217312136
https://towardsdatascience.com/agent-based-model-visualization-cb5648db51f4
https://pythonlang.dev/repo/jetnew-covid-resource-allocation-simulator/
https://github.com/projectmesa/mesa
https://www.researchgate.net/profile/Jacqueline-Kazil/publication/328774079_Mesa_An_Agent-Based_Modeling_Framework/links/5cc7632192851c8d220e5897/Mesa-An-Agent-Based-Modeling-Framework.pdf?origin=publication_detail
https://dash-agents.github.io/
https://realpython.com/simpy-simulating-with-python/
https://bokeh.org
Comments