Other

项目介绍

mesa/mesa-examples 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 Other 许可证,目前获得 255 个 Star、275 次 Fork。

仓库全名
mesa/mesa-examples
开源许可证
Other
Star 数
255
Fork 数
275
未关闭 Issue
52

README 摘要

Mesa Examples Core Mesa examples The core Mesa examples are available at the main Mesa repository: https://github.com/mesa/mesa/tree/main/mesa/examples Those core examples are fully tested, updated and guaranteed to work with the Mesa release that they are included with. They are also included in the Mesa package, so you can access them directly from your Python environment. Mesa user examples This repository…

完整内容见 GitHub 原始 README 或本页 。

常见问题

mesa-examples 用什么语言开发?

主要使用 Python 编写,采用 Other 许可证,目前有 255 个 Star。

mesa-examples 可以免费商用吗?

仓库标注的许可证为 Other,商用前请先阅读仓库 LICENSE 文件确认授权范围。

如何获取 mesa-examples 的源码?

可以直接克隆仓库:git clone https://github.com/mesa/mesa-examples.git,默认分支为 main;安装与运行步骤见仓库 README。

mesa-examples 最近还在维护吗?

仓库最近一次更新为 5 天前,当前有 52 个未关闭 Issue;Star 数为 255,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

User and showcase agent-based models developed using Mesa

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
819
价值分
234
活跃状态
活跃

语言占比

Jupyter Notebook
NetLogo
Python

README

Mesa Examples

Core Mesa examples

The core Mesa examples are available at the main Mesa repository: https://github.com/mesa/mesa/tree/main/mesa/examples

Those core examples are fully tested, updated and guaranteed to work with the Mesa release that they are included with. They are also included in the Mesa package, so you can access them directly from your Python environment.

Mesa user examples

This repository contains user examples and showcases that illustrate different features of Mesa. For more information on each model, see its own Readme and documentation.

  • Mesa examples that work on the Mesa and Mesa-Geo main development branches are available here on the main branch.
  • Mesa examples that work with Mesa 3.x releases are available here on the mesa-3.x branch.
  • Mesa examples that work with Mesa 2.x releases and Mesa-Geo 0.8.x releases are available here on the mesa-2.x branch.

To contribute to this repository, see CONTRIBUTING.rst.

This repo also contains a package that readily lets you import and run some of the examples:

$ # This will install the "mesa_models" package
$ pip install -U -e git+https://github.com/mesa/mesa-examples#egg=mesa-models

For Mesa 3.x examples, install:

$ # This will install the "mesa_models" package
$ pip install -U -e git+https://github.com/mesa/[email protected]#egg=mesa-models

For Mesa 2.x examples, install:

$ # This will install the "mesa_models" package
$ pip install -U -e git+https://github.com/mesa/[email protected]#egg=mesa-models
from mesa_models.boltzmann_wealth_model.model import BoltzmannWealthModel

You can see the available models at setup.cfg.

Table of Contents

Grid Space Examples

Bank Reserves Model

A highly abstracted, simplified model of an economy, with only one type of agent and a single bank representing all banks in an economy.

Color Patches Model

A cellular automaton model where agents opinions are influenced by that of their neighbors. As the model evolves, color patches representing the prevailing opinion in a given area expand, contract, and sometimes disappear.

Conway’s Game Of “Life” Model (Fast)

A very fast performance optimized version of Conway’s Game of Life using the Mesa PropertyLayer. About 100x as fast as the regular versions, but limited visualisation (for now).

Conway’s Game Of “Life” Model on a Hexagonal Grid

Conway’s game of life on a hexagonal grid.

Hexagonal Ant Foraging Model

A simulation of ant foraging behavior on a hexagonal grid using pheromone trails and property layers.

Forest Fire Model

Simple cellular automata of a fire spreading through a forest of cells on a grid, based on the NetLogo Fire model.

Hotelling’s Law Model

This project is an agent-based model implemented using the Mesa framework in Python. It simulates market dynamics based on Hotelling’s Law, exploring the behavior of stores in a competitive market environment. Stores adjust their prices and locations if it’s increases market share to maximize revenue, providing insights into the effects of competition and customer behavior on market outcomes.

Emperor’s Dilemma

This project simulates how unpopular norms can dominate a society even when the vast majority of individuals privately reject them. It demonstrates the “illusion of consensus” where agents, driven by a fear of appearing disloyal, not only comply with a rule they hate but also aggressively enforce it on their neighbors. This phenomenon creates a “trap” of False Enforcement, where the loudest defenders of a norm are often its secret opponents.

Humanitarian Aid Distribution Model

This model simulates a humanitarian aid distribution scenario using a needs-based behavioral architecture. Beneficiaries have dynamic needs (water, food) and trucks distribute aid using a hybrid triage system.

Rumor Mill Model

A simple agent-based simulation showing how rumors spread through a population based on the spread chance and initial knowing percentage, implemented with the Mesa framework and adapted from NetLogo Rumor mill.

Axelrod Culture Model

An implementation of Axelrod’s model of cultural dissemination. Agents on a grid hold multi-feature cultural profiles and interact with neighbors based on cultural similarity, producing emergent cultural regions. Demonstrates how local convergence and global polarization can coexist.

Pathogen Outbreak Model

A fast-spreading pathogen outbreak model with no exposed/latency period inspired loosely from the game Plague Inc, though the goal here is containment rather than world domination. The model simulates how quarantine compliance rates at the population level affect outbreak dynamics, analyzing changes in infection, death and immunity rates.

Continuous Space Examples

No user examples available yet.

Network Examples

Boltzmann Wealth Model with Network

This is the same Boltzmann Wealth Model, but with a network grid implementation.

Ant System for Traveling Salesman Problem

This is based on Dorigo’s Ant System “Swarm Intelligence” algorithm for generating solutions for the Traveling Salesman Problem.

Dining Philosophers Model

A classic synchronization problem demonstrating resource contention, deadlock, and starvation on a network graph.

Visualization Examples

Charts Example

A modified version of the Bank Reserves example made to provide examples of Mesa’s charting tools.

Shape Example

Example of grid display and direction showing agents in the form of arrow-head shape.

GIS Examples

Vector Data

Raster Data

Raster and Vector Data Overlay

Other Examples

El Farol Model

This folder contains an implementation of El Farol restaurant model. Agents (restaurant customers) decide whether to go to the restaurant or not based on their memory and reward from previous trials. Implications from the model have been used to explain how individual decision-making affects overall performance and fluctuation.

Schelling Model with Caching and Replay

This example applies caching on the Mesa Schelling example. It enables a simulation run to be “cached” or in other words recorded. The recorded simulation run is persisted on the local file system and can be replayed at any later point.

Continuous Double Auction (ZI-C) Market Model

A continuous double-auction market with zero-intelligence traders. Buyers and sellers each have a private reservation price or cost, and submit randomized, budget-constrained bids and asks as they arrive asynchronously through Mesa’s event-driven scheduler. The order book matches on price-time priority and clears at the midpoint price, converging naturally toward the market’s theoretical equilibrium.

评论

暂无评论