Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.
The 2.3.0-rc1 release is our first release candidate pre-release, meant to test all the new features and enhancement for the upcoming 2.3.0 release.
There are two main new features:
CellAgent
. Its inspired by NetLogo's patches but extend and generalize this concept further.There are a lot of other features: The Jupyter visualisation now supports easier way to specify sliders, NetworkGrid.get_neighbors()
supports a radius, AgentSet.get()
can retrieve multiple attributes and there are now benchmarks to track Mesa performance during development.
Finally, 2.3.0 stabilizes the AgentSet
(including model.agents
), making it the first experimental Mesa feature that is taken out of it's experimental phase.
Install this pre-release with:
pip install --pre mesa
We would love feedback before we release 2.3.0 stable in ~1 week.
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.4...2.3.0-rc1
Model.agents
for now, but add warning by @quaquel in https://github.com/projectmesa/mesa/pull/1976
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.1...v2.2.5
Mesa v2.2.4 is a small but important bugfix release for the 2.2 release series. It fixes an essential bug in where agents weren't shuffled in the BaseScheduler
, affecting mainly the RandomActivation
scheduler (effectively making it sequential activation)(#2007). It also fixes a small behaviour change in RandomActivationByType.agents_by_type()
(#1996). Furthermore, this release adds an internal clock to the Model
, which allows to use a Mesa model without a scheduler (using the AgentSet
API)(#1942).
Updating from previous 2.2 releases is highly recommended, especially when using the RandomActivation
scheduler.
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.3...v2.2.4
Mesa 2.2.3 is a small release with two improvements to the experimental Solara visualisation, on request of one of our contributors. No stable features have changed.
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.2...v2.2.3
Mesa 2.2.2 is a small bugfix release, for models in which users had defined Model.agents
(self.agents
in a Model (sub)class). This is deprecated, but for now allowed. See #1919 (comment).
Model.agents
for now, but add warning by @quaquel in #1976
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.1...v2.2.2
After the substantive 2.2.0 release we are releasing 2.2.1 which addresses a few bugs, unintended behaviors and a performance regression. #1960 makes sure agent addition and removal is handled correct, #1965 fixed an unintended behavior change in RandomActivationByType.agents_by_type
and #1964 makes sure we're at least as fast as before 2.2.0, if not faster. The introduction tutorial is also extended with #1955.
We highly recommend updating to 2.2.1 if you're using 2.2.0.
pip install --upgrade mesa
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.2.0...v2.2.1
The 2.2.0 release of the Mesa library introduces several updates and new features for managing and scheduling agents and modelling the environment, along with an experimental release policy aimed at enhancing development speed and community feedback. Below are key highlights of the new (experimental) features in this release. Mesa 2.2.0 supports Python 3.9+.
Despite the minor version number, this is one of our biggest releases yet.
This release introduces an experimental feature policy aimed at accelerating development and gathering community feedback. Features like #1890, #1898, and #1916 are marked as experimental under this policy.
Policy overview:
This update introduces a agents
variable to the Mesa Model
class, offering a first step in supporting multiple agent types as first class citizens. Each Model
is now initialized with an self.agents
variable (an AgentSet
) in which all the agents are tracked. You can now always ask which agents are in the model with model.agents
. It's the foundation which will allow us to solve problems with scheduling, data collection and visualisation of multiple agent types in the future.
The new AgentSet
class encapsulates and manages collections of agents, streamlining the process of selecting, sorting, and applying actions to groups of agents.
Key features:
select
, shuffle
, sort
, and do
for intuitive operations.Example:
# Applying a method to each agent
model.agents.do('step')
# Filtering and shuffling agents
shuffled_agents = model.agents.select(lambda agent: agent.attribute > threshold).shuffle()
The AgentSet is an experimental feature. We would love feedback on it in #1919.
The introduction of PropertyLayer
and the extension of SingleGrid
and MultiGrid
classes to support cell properties mark a significant enhancement in Mesa's environmental modeling capabilities. It allows to add different layers of variables to grids, that can be used to represent spatial environmental properties, such as elevation, pollution, flood levels or foliage.
Key features:
Example:
from mesa.space import SingleGrid, PropertyLayer
grid = SingleGrid(10, 10, False)
property_layer = PropertyLayer("elevation", 10, 10, default_value=0)
grid.add_property_layer(property_layer)
# Modify multiple cells values
grid.properties["elevation"].modify_cells(np.multiply, 2)
# Select cells that have an elevation of at least 50
high_elevation_cells = grid.properties["elevation"].select_cells(condition=lambda x: x > 50)
The PropertyLayer is an experimental feature. We would love feedback on it in #1932.
The DiscreteEventScheduler
is an innovative addition to the Mesa time module, tailored for discrete event simulations. This scheduler advances simulations based on specific event timings rather than regular intervals, providing more flexibility in modeling complex systems.
Key Features:
The DiscreteEventScheduler is an experimental feature. We would love feedback on it in #1923.
Full Changelog: https://github.com/projectmesa/mesa/compare/v2.1.5...v2.2.0
This release has some critical fixes to JupyterViz/Solara frontend to prevent flickering and improve the display of the jupyter plots. It also has improvements to datacollection and the documentation.
Improvements
Docs and Tutorial
.rst
to .md
(#1881).rst
to .md
(#1873)mesa.time
(#1866)CI and WorkFlows
setup.py
to pyproject.toml
(#1870)Solara/JupyterViz
This release updates mesa-viz-tornado dependency v0.1.3. This removes the external JavaScript templates and prevents 404 errors
This release contains several improvements, fixes, and new features to the JupyterViz/Solara frontend. It's a patch release instead of a minor release because the JupyterViz frontend is still considered experimental.
Improvements
Docs and Tutorial
CI and WorkFlows
Solara/JupyterViz
This release updates mesa-viz-tornado dependency v0.1.3. This removes the external JavaScript templates and prevents 404 errors
This release contains several improvements, fixes, and new features to the JupyterViz/Solara frontend. It's a patch release instead of a minor release because the JupyterViz frontend is still considered experimental.
Improvements
Docs and Tutorial
CI and WorkFlows
Solara/JupyterViz
This release contains fixes, and several improvements and new features to the JupyterViz/Solara frontend. It's a patch release instead of a minor release because the JupyterViz frontend is still considered experimental.
Improvements
Solara/JupyterViz
Refactors
Fixes