[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-mesa--mesa":3,"tool-mesa--mesa":62},[4,18,26,36,46,54],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",158594,2,"2026-04-16T23:34:05",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":42,"last_commit_at":43,"category_tags":44,"status":17},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[13,45],"插件",{"id":47,"name":48,"github_repo":49,"description_zh":50,"stars":51,"difficulty_score":32,"last_commit_at":52,"category_tags":53,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":55,"name":56,"github_repo":57,"description_zh":58,"stars":59,"difficulty_score":32,"last_commit_at":60,"category_tags":61,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[45,13,15,14],{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":65,"owner_name":73,"owner_avatar_url":74,"owner_bio":66,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":75,"owner_url":76,"languages":77,"stars":90,"forks":91,"last_commit_at":92,"license":93,"difficulty_score":42,"env_os":94,"env_gpu":94,"env_ram":94,"env_deps":95,"category_tags":101,"github_topics":103,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":114,"updated_at":115,"faqs":116,"releases":145},8204,"mesa\u002Fmesa","mesa","Mesa is an open-source Python library for agent-based modeling, ideal for simulating complex systems and exploring emergent behaviors.","Mesa 是一个基于 Python 的开源库，专为构建“基于智能体”的模型（Agent-Based Modeling）而设计。它帮助用户轻松模拟由多个独立个体组成的复杂系统，例如生态系统中的狼与羊、城市交通流或金融市场动态，从而观察这些个体互动如何涌现出宏观层面的有趣现象。\n\n过去，进行此类模拟往往依赖 NetLogo 等专用软件，而 Mesa 填补了 Python 生态在这一领域的空白。它让研究人员和开发者能够直接利用 Python 强大的数据分析和可视化生态来创建、运行并分析模型，无需在不同工具间切换。无论是学术研究者探索社会动力学，还是数据科学家模拟业务场景，都能通过 Mesa 高效验证假设。\n\nMesa 的核心亮点在于其模块化设计：内置了空间网格、智能体调度器等常用组件，支持快速搭建模型；同时提供基于浏览器的交互式可视化界面，让用户能直观地看到模拟过程的动态变化。此外，它还拥有丰富的示例模型库和完善的教程，降低了入门门槛。目前 Mesa 正处于活跃开发阶段（Mesa 4），持续优化性能与功能，是希望用代码驱动复杂系统研究的理想选择。","\u003Cp align=\"center\">\u003Cem>Mesa 4 is in active development! Checkout our latest \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Freleases\">pre-releases\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues\u002F3132\">issue tracker\u003C\u002Fa>.\n\u003Cbr>For GSoC, checkout our \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fwiki\u002FGoogle-Summer-of-Code-2026\">Google Summer of Code 2026\u003C\u002Fa> guide.\u003C\u002Fem>\u003C\u002Fp>\n\n# Mesa: Agent-based modeling in Python\n\n|         | |\n|---------| --- |\n| CI\u002FCD   | [![GitHub Actions build status](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fworkflows\u002Fbuild\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Factions) [![Coverage status](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fmesa\u002Fmesa\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fmesa\u002Fmesa) |\n| Package | [![PyPI - Version](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fmesa.svg?logo=pypi&label=PyPI&logoColor=gold)](https:\u002F\u002Fpypi.org\u002Fproject\u002FMesa\u002F) [![PyPI - Downloads](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Fmesa.svg?color=blue&label=Downloads&logo=pypi&logoColor=gold)](https:\u002F\u002Fpypi.org\u002Fproject\u002FMesa\u002F) [![PyPI - Python Version](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fmesa.svg?logo=python&label=Python&logoColor=gold)](https:\u002F\u002Fpypi.org\u002Fproject\u002FMesa\u002F) |\n| Meta    | [![linting - Ruff](https:\u002F\u002Fimg.shields.io\u002Fendpoint?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fastral-sh\u002Fruff\u002Fmain\u002Fassets\u002Fbadge\u002Fv2.json)](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fruff) [![code style: black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack) [![Hatch project](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A5%9A-Hatch-4051b5.svg)](https:\u002F\u002Fgithub.com\u002Fpypa\u002Fhatch) [![SPEC 0 — Minimum Supported Dependencies](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSPEC-0-green?labelColor=%23004811&color=%235CA038)](https:\u002F\u002Fscientific-python.org\u002Fspecs\u002Fspec-0000\u002F) |\n| Chat    | [![chat](https:\u002F\u002Fimg.shields.io\u002Fmatrix\u002Fproject-mesa:matrix.org?label=chat&logo=Matrix)](https:\u002F\u002Fmatrix.to\u002F#\u002F#project-mesa:matrix.org) |\n| Cite    | [![DOI](https:\u002F\u002Fjoss.theoj.org\u002Fpapers\u002F10.21105\u002Fjoss.07668\u002Fstatus.svg)](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.07668) |\n\nMesa allows users to quickly create agent-based models using built-in\ncore components (such as spatial grids and agent schedulers) or\ncustomized implementations; visualize them using a browser-based\ninterface; and analyze their results using Python's data analysis\ntools. Its goal is to be the Python-based alternative to NetLogo,\nRepast, or MASON.\n\n![A screenshot of the WolfSheep Model in Mesa](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmesa_mesa_readme_4ce40b0a9f7a.png)\n\n*Above: A Mesa implementation of the WolfSheep model, this\ncan be displayed in browser windows or Jupyter. An online demo is [available here](https:\u002F\u002Fpy.cafe\u002Fapp\u002FEwoutH\u002Fmesa-solara-basic-examples).*\n\n## Features\n\n-   Modular components\n-   Browser-based visualization\n-   Built-in tools for analysis\n-   Example model library\n\n## Using Mesa\nTo install our latest stable Mesa 3 release, run:\n\n```bash\npip install -U mesa\n```\nDevelopment of Mesa 4 has started. To install our latest Mesa 4 pre-release, use:\n```bash\npip install -U --pre mesa\n```\n\nStarting with Mesa 3.0, we don't install all our dependencies anymore by default.\n```bash\n# You can customize the additional dependencies you need, if you want. Available are:\npip install -U \"mesa[network,viz]\"\n\n# This is equivalent to our recommended dependencies:\npip install -U \"mesa[rec]\"\n\n# To install all, including developer, dependencies:\npip install -U \"mesa[all]\"\n```\n\nYou can also use `pip` to install the latest GitHub version:\n\n``` bash\npip install -U -e git+https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa@main#egg=mesa\n```\n\nOr any other (development) branch on this repo or your own fork:\n\n``` bash\npip install -U -e git+https:\u002F\u002Fgithub.com\u002FYOUR_FORK\u002Fmesa@YOUR_BRANCH#egg=mesa\n```\n\n## Resources\nFor resources or help on using Mesa, check out the following:\n\n-   [Getting Started](https:\u002F\u002Fmesa.readthedocs.io\u002Fstable\u002Fgetting_started.html) (A collection of tutorials that will walk you through a basic model.)\n-   [GSoC at Mesa — Candidates Guide](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002Fdocs\u002FGSoC.md) (For candidates interested in participating in the Google Summer of Code at Mesa)\n-   [Mesa Examples](https:\u002F\u002Fmesa.readthedocs.io\u002Fstable\u002Fexamples.html) (A repository of seminal ABMs that are part of the Mesa[rec] install and use the most current Mesa release)\n-   [Docs](http:\u002F\u002Fmesa.readthedocs.org\u002F) (Mesa's documentation, API and useful snippets)\n    -   [Development version docs](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002F) (the latest version docs if you're using a pre-release Mesa version)\n-   [Discussions](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fdiscussions) (GitHub threaded discussions about Mesa)\n-   [Matrix Chat](https:\u002F\u002Fmatrix.to\u002F#\u002F#project-mesa:matrix.org) (Chat Forum via Matrix to talk about Mesa)\n\n## Running Mesa in Docker\n\nYou can run Mesa in a Docker container in a few ways.\n\nIf you are a Mesa developer, first [install Docker\nCompose](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Finstall\u002F) and then, in the\nfolder containing the Mesa Git repository, you run:\n\n``` bash\n$ docker compose up\n# If you want to make it run in the background, you instead run\n$ docker compose up -d\n```\n\nThis runs the Schelling model, as an example.\n\nWith the docker-compose.yml file in this Git repository, the `docker compose up` command does two important things:\n\n-   It mounts the mesa root directory (relative to the\n    docker-compose.yml file) into \u002Fopt\u002Fmesa and runs pip install -e on\n    that directory so your changes to mesa should be reflected in the\n    running container.\n-   It binds the docker container's port 8765 to your host system's\n    port 8765 so you can interact with the running model as usual by\n    visiting localhost:8765 on your browser\n\nIf you are a model developer that wants to run Mesa on a model, you need\nto:\n\n-   make sure that your model folder is inside the folder containing the\n    docker-compose.yml file\n-   change the `MODEL_DIR` variable in docker-compose.yml to point to\n    the path of your model\n-   make sure that the model folder contains an app.py file\n\nThen, you just need to run `docker compose up -d` to have it\naccessible from `localhost:8765`.\n\n## Contributing to Mesa\n\nWant to join the Mesa team or just curious about what is happening with\nMesa? You can\\...\n\n> -   Join our [Matrix chat room](https:\u002F\u002Fmatrix.to\u002F#\u002F#project-mesa:matrix.org) in which questions, issues, and\n>     ideas can be (informally) discussed.\n> -   Come to a monthly dev session (you can find dev session times,\n>     agendas and notes on [Mesa discussions](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fdiscussions)).\n> -   Just check out the code on [GitHub](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002F).\n\nIf you run into an issue, please file a [ticket](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues) for us to discuss. If\npossible, follow up with a pull request.\n\nIf you would like to add a feature, please reach out via [ticket](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues) or\njoin a dev session (see [Mesa discussions](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fdiscussions)). A feature is most likely\nto be added if you build it!\n\nDon't forget to checkout the [Contributors guide](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002FCONTRIBUTING.md).\n\n## Citing Mesa\n\nTo cite Mesa in your publication, you can refer to our peer-reviewed article in the Journal of Open Source Software (JOSS):\n- ter Hoeven, E., Kwakkel, J., Hess, V., Pike, T., Wang, B., rht, & Kazil, J. (2025). Mesa 3: Agent-based modeling with Python in 2025. Journal of Open Source Software, 10(107), 7668. https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.07668\n\nOur [CITATION.cff](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002FCITATION.cff) can be used to generate APA, BibTeX and other citation formats.\n","\u003Cp align=\"center\">\u003Cem>Mesa 4 正在积极开发中！请查看我们最新的 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Freleases\">预发布版本\u003C\u002Fa> 和 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues\u002F3132\">问题追踪器\u003C\u002Fa>。\n\u003Cbr>关于 GSoC，请参阅我们的 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fwiki\u002FGoogle-Summer-of-Code-2026\">2026 年 Google 夏季编程大赛\u003C\u002Fa> 指南。\u003C\u002Fem>\u003C\u002Fp>\n\n# Mesa：基于代理的 Python 建模框架\n\n|         | |\n|---------| --- |\n| CI\u002FCD   | [![GitHub Actions 构建状态](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fworkflows\u002Fbuild\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Factions) [![覆盖率](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fmesa\u002Fmesa\u002Fbranch\u002Fmain\u002Fgraph\u002Fbadge.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fmesa\u002Fmesa) |\n| 软件包 | [![PyPI - 版本](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fmesa.svg?logo=pypi&label=PyPI&logoColor=gold)](https:\u002F\u002Fpypi.org\u002Fproject\u002FMesa\u002F) [![PyPI - 下载量](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Fmesa.svg?color=blue&label=Downloads&logo=pypi&logoColor=gold)](https:\u002F\u002Fpypi.org\u002Fproject\u002FMesa\u002F) [![PyPI - Python 版本](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Fmesa.svg?logo=python&label=Python&logoColor=gold)](https:\u002F\u002Fpypi.org\u002Fproject\u002FMesa\u002F) |\n| 元数据  | [![代码风格 - Ruff](https:\u002F\u002Fimg.shields.io\u002Fendpoint?url=https:\u002F\u002Fraw.githubusercontent.com\u002Fastral-sh\u002Fruff\u002Fmain\u002Fassets\u002Fbadge\u002Fv2.json)](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fruff) [![代码风格：Black](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode%20style-black-000000.svg)](https:\u002F\u002Fgithub.com\u002Fpsf\u002Fblack) [![Hatch 项目](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A5%9A-Hatch-4051b5.svg)](https:\u002F\u002Fgithub.com\u002Fpypa\u002Fhatch) [![SPEC 0 — 最低支持依赖](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSPEC-0-green?labelColor=%23004811&color=%235CA038)](https:\u002F\u002Fscientific-python.org\u002Fspecs\u002Fspec-0000\u002F) |\n| 聊天    | [![聊天](https:\u002F\u002Fimg.shields.io\u002Fmatrix\u002Fproject-mesa:matrix.org?label=chat&logo=Matrix)](https:\u002F\u002Fmatrix.to\u002F#\u002F#project-mesa:matrix.org) |\n| 引用    | [![DOI](https:\u002F\u002Fjoss.theoj.org\u002Fpapers\u002F10.21105\u002Fjoss.07668\u002Fstatus.svg)](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.07668) |\n\nMesa 使用户能够利用内置的核心组件（如空间网格和代理调度器）或自定义实现，快速创建基于代理的模型；通过基于浏览器的界面进行可视化；并使用 Python 的数据分析工具分析结果。其目标是成为 NetLogo、Repast 或 MASON 的 Python 替代方案。\n\n![Mesa 中 WolfSheep 模型的截图](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmesa_mesa_readme_4ce40b0a9f7a.png)\n\n*上图：Mesa 实现的 WolfSheep 模型，可在浏览器窗口或 Jupyter 中显示。在线演示可在此处访问：\u003Ca href=\"https:\u002F\u002Fpy.cafe\u002Fapp\u002FEwoutH\u002Fmesa-solara-basic-examples\">链接\u003C\u002Fa>。*\n\n## 特性\n\n- 模块化组件\n- 基于浏览器的可视化\n- 内置分析工具\n- 示例模型库\n\n## 使用 Mesa\n要安装我们最新的稳定版 Mesa 3，请运行：\n\n```bash\npip install -U mesa\n```\nMesa 4 的开发已经开始。要安装最新的 Mesa 4 预发布版本，请使用：\n```bash\npip install -U --pre mesa\n```\n\n从 Mesa 3.0 开始，我们不再默认安装所有依赖项。\n```bash\n# 如果需要，您可以自定义所需的额外依赖项。可用选项如下：\npip install -U \"mesa[network,viz]\"\n\n# 这等同于我们推荐的依赖项：\npip install -U \"mesa[rec]\"\n\n# 若要安装所有依赖项，包括开发者依赖项：\npip install -U \"mesa[all]\"\n```\n\n您也可以使用 `pip` 安装最新的 GitHub 版本：\n\n``` bash\npip install -U -e git+https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa@main#egg=mesa\n```\n\n或者安装此仓库中的任何其他（开发）分支，或您自己的分叉：\n\n``` bash\npip install -U -e git+https:\u002F\u002Fgithub.com\u002FYOUR_FORK\u002Fmesa@YOUR_BRANCH#egg=mesa\n```\n\n## 资源\n有关 Mesa 的资源或使用帮助，请参阅以下内容：\n\n- [入门指南](https:\u002F\u002Fmesa.readthedocs.io\u002Fstable\u002Fgetting_started.html)（一系列教程，将引导您完成一个基本模型。）\n- [Mesa 的 GSoC — 候选人指南](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002Fdocs\u002FGSoC.md)（面向有意参与 Mesa 的 Google 夏季编程大赛的候选人。）\n- [Mesa 示例](https:\u002F\u002Fmesa.readthedocs.io\u002Fstable\u002Fexamples.html)（一个包含经典 ABM 的仓库，属于 Mesa[rec] 安装的一部分，并使用最新的 Mesa 版本。）\n- [文档](http:\u002F\u002Fmesa.readthedocs.org\u002F)（Mesa 的文档、API 和实用片段）\n    - [开发版本文档](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002F)（如果您使用的是预发布版 Mesa，则为最新版本的文档。）\n- [讨论区](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fdiscussions)（关于 Mesa 的 GitHub 线程式讨论。）\n- [Matrix 聊天](https:\u002F\u002Fmatrix.to\u002F#\u002F#project-mesa:matrix.org)（通过 Matrix 讨论 Mesa 的聊天论坛。）\n\n## 在 Docker 中运行 Mesa\n\n您可以通过几种方式在 Docker 容器中运行 Mesa。\n\n如果您是 Mesa 的开发者，首先请安装 [Docker Compose](https:\u002F\u002Fdocs.docker.com\u002Fcompose\u002Finstall\u002F)，然后在包含 Mesa Git 仓库的文件夹中运行：\n\n``` bash\n$ docker compose up\n# 如果希望在后台运行，可以改为：\n$ docker compose up -d\n```\n\n这将运行谢林模型作为示例。\n\n使用此 Git 仓库中的 `docker-compose.yml` 文件，`docker compose up` 命令会执行两项重要操作：\n\n- 它会将 mesa 根目录（相对于 `docker-compose.yml` 文件）挂载到 `\u002Fopt\u002Fmesa`，并在该目录上运行 `pip install -e`，以便您对 mesa 所做的更改能够反映在正在运行的容器中。\n- 它会将容器的端口 8765 绑定到主机系统的端口 8765，这样您就可以像往常一样通过浏览器访问 `localhost:8765` 与正在运行的模型交互。\n\n如果您是希望在某个模型上运行 Mesa 的模型开发者，则需要：\n\n- 确保您的模型文件夹位于包含 `docker-compose.yml` 文件的文件夹内。\n- 将 `docker-compose.yml` 中的 `MODEL_DIR` 变量更改为指向您的模型路径。\n- 确保模型文件夹中包含 `app.py` 文件。\n\n之后，只需运行 `docker compose up -d`，即可通过 `localhost:8765` 访问该模型。\n\n## 为 Mesa 做贡献\n\n想加入 Mesa 团队，或者只是好奇 Mesa 目前的进展吗？你可以……\n\n- 加入我们的 [Matrix 聊天室](https:\u002F\u002Fmatrix.to\u002F#\u002F#project-mesa:matrix.org)，在这里可以非正式地讨论问题、提出想法。\n- 参加每月的开发会议（开发会议的时间、议程和记录可以在 [Mesa 讨论区](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fdiscussions) 查看）。\n- 直接在 [GitHub](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002F) 上查看代码。\n\n如果你遇到问题，请提交一个 [issue](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues)，以便我们讨论。如果可能的话，再附上一个 pull request。\n\n如果你想添加新功能，请通过 [issue](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues) 联系我们，或者参加一次开发会议（参见 [Mesa 讨论区](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fdiscussions)）。通常情况下，如果你自己实现这个功能，它被合并的可能性会更大！\n\n别忘了查看 [贡献者指南](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002FCONTRIBUTING.md)。\n\n## 引用 Mesa\n\n若要在你的论文中引用 Mesa，可以参考我们在《开源软件期刊》（JOSS）上发表的同行评审文章：\n\n- ter Hoeven, E., Kwakkel, J., Hess, V., Pike, T., Wang, B., rht, & Kazil, J. (2025). Mesa 3：2025 年基于 Python 的主体建模。开源软件期刊，10(107), 7668. https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.07668\n\n我们还提供了 [CITATION.cff](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002FCITATION.cff)，可用于生成 APA、BibTeX 等多种引用格式。","# Mesa 快速上手指南\n\nMesa 是一个用于在 Python 中构建、分析和可视化**基于代理的模型（Agent-Based Models, ABM）**的开源框架。它是 NetLogo、Repast 或 MASON 等工具的 Python 替代方案。\n\n## 环境准备\n\n*   **操作系统**：Windows、macOS 或 Linux\n*   **Python 版本**：建议安装 Python 3.9 或更高版本\n*   **前置依赖**：\n    *   `pip` (Python 包管理工具)\n    *   (可选) Docker 及 Docker Compose（如需容器化运行）\n    *   (可选) Jupyter Notebook（如需在笔记本中进行交互式开发）\n\n> **提示**：国内用户建议在安装时使用清华或阿里镜像源以加速下载。\n\n## 安装步骤\n\n### 1. 安装稳定版（推荐）\n安装最新的稳定版本（Mesa 3.x）：\n\n```bash\npip install -U mesa -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n### 2. 按需安装扩展依赖\n从 Mesa 3.0 开始，默认不再安装所有依赖。你可以根据需求选择安装：\n\n*   **推荐配置**（包含网络和可视化支持）：\n    ```bash\n    pip install -U \"mesa[rec]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n*   **自定义配置**（仅安装特定功能，如网络分析或可视化）：\n    ```bash\n    pip install -U \"mesa[network,viz]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n*   **完整配置**（包含所有开发依赖）：\n    ```bash\n    pip install -U \"mesa[all]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n\n### 3. 安装开发预览版（可选）\n如果你想体验正在开发中的 Mesa 4 新功能：\n\n```bash\npip install -U --pre mesa -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n或者直接从 GitHub 源码安装最新开发版：\n\n```bash\npip install -U -e git+https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa@main#egg=mesa\n```\n\n## 基本使用\n\n以下是一个最简单的“狼羊吃草”模型的核心代码示例，展示如何定义代理（Agent）和模型（Model）。\n\n### 1. 创建模型文件\n新建一个名为 `model.py` 的文件，写入以下代码：\n\n```python\nfrom mesa import Model, Agent\nfrom mesa.time import RandomActivation\nfrom mesa.space import MultiGrid\n\nclass WolfSheepAgent(Agent):\n    def __init__(self, unique_id, model, is_wolf):\n        super().__init__(unique_id, model)\n        self.is_wolf = is_wolf\n        self.energy = 10\n\n    def step(self):\n        # 简单的移动逻辑\n        self.model.grid.move_to_empty(self)\n        self.energy -= 1\n        \n        # 简单的繁殖或捕食逻辑占位\n        if self.energy \u003C= 0:\n            self.model.schedule.remove(self)\n\nclass WolfSheepModel(Model):\n    def __init__(self, width=10, height=10, initial_agents=10):\n        super().__init__()\n        self.grid = MultiGrid(width, height, torus=True)\n        self.schedule = RandomActivation(self)\n        \n        # 创建初始代理\n        for i in range(initial_agents):\n            a = WolfSheepAgent(i, self, is_wolf=(i % 2 == 0))\n            self.schedule.add(a)\n            x = self.random.randrange(self.grid.width)\n            y = self.random.randrange(self.grid.height)\n            self.grid.place_agent(a, (x, y))\n\n    def step(self):\n        self.schedule.step()\n```\n\n### 2. 运行模型\n在 Python 脚本或 Jupyter Notebook 中运行模型：\n\n```python\nfrom model import WolfSheepModel\n\n# 初始化模型\nmodel = WolfSheepModel(width=10, height=10, initial_agents=20)\n\n# 运行 10 步\nfor _ in range(10):\n    model.step()\n    print(f\"Step {_}: Agents remaining: {model.schedule.get_agent_count()}\")\n```\n\n### 3. 启动可视化服务器（可选）\n如果你安装了 `[viz]` 依赖并创建了相应的 `app.py`（参考官方示例），可以使用以下命令在浏览器中查看交互式界面：\n\n```bash\nmesa runserver\n```\n默认访问地址为：`http:\u002F\u002Flocalhost:8521` (具体端口视配置而定，Docker 环境下通常为 8765)。\n\n---\n*更多详细教程和示例模型，请访问 [Mesa 官方文档](https:\u002F\u002Fmesa.readthedocs.io\u002F) 或查看仓库中的 `examples` 目录。*","某城市交通规划团队需要模拟早晚高峰期间，数千辆自动驾驶汽车在复杂路网中的交互行为，以评估新交通信号策略对整体拥堵的影响。\n\n### 没有 mesa 时\n- 开发者需从零编写复杂的网格空间系统和代理调度逻辑，代码重复且极易出错，开发周期长达数周。\n- 缺乏内置的可视化手段，只能依赖静态图表或导出原始数据到外部工具查看，无法实时观察车辆流动的动态演变。\n- 难以复现经典的“狼 - 羊”类涌现行为模型，每次尝试新策略都需手动重构底层架构，试错成本极高。\n- 数据分析与模型运行割裂，研究人员需在仿真脚本和分析脚本间反复切换，效率低下且容易丢失上下文。\n\n### 使用 mesa 后\n- 直接调用 mesa 内置的空间网格（Space Grid）和调度器（Scheduler）组件，几天内即可搭建出包含数千个智能体的高保真交通模型。\n- 利用浏览器端的可视化界面，团队成员能实时看到车辆拥堵形成的动态过程，直观发现策略漏洞并即时调整参数。\n- 基于 mesa 模块化特性，快速复用官方示例库中的逻辑结构，轻松实现从微观驾驶行为到宏观车流模式的涌现分析。\n- 在 Python 环境中无缝衔接 Pandas 等分析工具，仿真结束即刻生成统计报告，实现了建模、运行与分析的一体化闭环。\n\nmesa 将原本繁琐的底层架构搭建转化为专注业务逻辑的创新探索，让复杂系统仿真变得像搭积木一样高效直观。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmesa_mesa_4ce40b0a.png","Mesa","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmesa_7531bcce.png",null,"https:\u002F\u002Fgithub.com\u002Fmesa",[78,82,86],{"name":79,"color":80,"percentage":81},"Python","#3572A5",96.8,{"name":83,"color":84,"percentage":85},"Jupyter Notebook","#DA5B0B",3.2,{"name":87,"color":88,"percentage":89},"Shell","#89e051",0,3594,1266,"2026-04-15T16:02:03","Apache-2.0","未说明",{"notes":96,"python":97,"dependencies":98},"Mesa 是一个基于 Python 的代理建模（ABM）框架。从 3.0 版本开始，默认不再安装所有依赖，用户需根据需求选择安装额外组件（如网络分析或可视化功能）。支持通过 Docker 运行，默认端口为 8765。该项目正在积极开发 Mesa 4 版本。","3.10+",[65,99,100],"networkx (可选)","solara (可选，用于可视化)",[14,102,13],"其他",[65,104,105,106,107,108,109,110,111,112,113],"agent-based-modeling","agent-based-simulation","simulation-framework","simulation","simulation-environment","complex-systems","complexity-analysis","modeling-agents","spatial-models","gis","2026-03-27T02:49:30.150509","2026-04-17T08:24:17.497915",[117,122,127,132,137,141],{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},36697,"如何在数据收集器（DataCollector）中为不同类型的代理（Agent）分别收集不同的属性数据？","可以使用 `agenttype_reporters` 参数来针对不同代理类定义不同的报告器。例如，若模型中有 Wolf、Sheep 和 Animal 类，可以这样配置：\n\nclass MyModel(Model):\n    def __init__(self):\n        super().__init__()\n        self.datacollector = DataCollector(\n            agent_reporters={\"life_span\": \"life_span\"},\n            agenttype_reporters={\n                Wolf: {\"sheep_eaten\": \"sheep_eaten\"},\n                Sheep: {\"wool\": \"wool_amount\"},\n                Animal: {\"energy\": \"energy\"}  # 收集所有 Animal 子类的数据\n            }\n        )\n\n此外，利用 `AgentSet` 的新功能（如 `.select()`, `.do()`, `.get()`）也可以灵活地筛选代理子集并获取属性，作为数据收集的替代或补充方案。","https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues\u002F348",{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},36698,"Mesa 中是否有正式的方法来定义和复用网格（Grid）的邻域规则（如摩尔邻域、冯·诺依曼邻域及半径）？","是的，Mesa 已经引入了更正式的邻域定义机制。现在的 `Cell` 对象包含 `neighborhood` 属性，并且可以通过 `get_neighborhood()` 方法进行查询，解决了直接查询与基于半径查询的 API 混淆问题。\n\n对于需要复用邻域定义的场景，社区建议利用 `CellCollection` 或掩码（mask）来表示邻域，并编写工具函数来生成这些集合。例如，可以定义一个函数：\n\ndef to_collection(include_center=False, radius=1, moore=True):\n    # 返回对应的 CellCollection\n    ...\n\n这使得拓扑规则更加明确、可复用，并且易于缓存或扩展到其他网格类型。","https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues\u002F1900",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},36699,"为什么在安装 Mesa 时会自动下载 JS 依赖项？这种做法有什么风险，推荐的替代方案是什么？","在安装时自动下载 JS 依赖项存在以下严重问题：\n1. **链接失效风险**：硬编码的 URL 可能会失效，导致旧版本无法安装且无法复现构建结果。\n2. **版本不可控**：用户可能下载到不同版本的依赖，引发难以排查的 Bug。\n3. **安全隐患**：恶意攻击者可能篡改链接指向恶意软件，且用户在不知情的情况下执行下载。\n\n社区讨论倾向于两种解决方案：\n- **Vendor（内置）依赖**：直接将 `.js` 文件放入代码仓库中（推荐做法），确保版本固定且离线可用。\n- **使用 npm 管理**：如果必须移除仓库中的文件，应通过 `npm` 和 `package-lock.json` 来管理依赖及哈希校验，而不是在 `setup.py` 中动态下载。例如：`npm install bootstrap@version` 会自动处理哈希和版本锁定。","https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues\u002F1277",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},36700,"Mesa 3.0 版本的 JOSS 论文主要涵盖了哪些核心内容结构？","Mesa 3.0 的 JOSS 论文旨在全面概述该框架，其内容结构主要分为三个部分：\n1. **ABM 框架核心**：涵盖代理与管理（agents\u002Fmanagement）、空间（spaces）以及时间管理（time management）。\n2. **可视化（Visualization）**：介绍内置的可视化功能。\n3. **实验（Experimentation）**：描述如何进行模型实验和数据收集。\n\n此外，论文还整合了实验性功能到主要叙事中，重点讨论了新型空间（new-style spaces），并包含了应用案例引用、Mesa-Geo 论文引用以及致谢部分。","https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fissues\u002F2559",{"id":138,"question_zh":139,"answer_zh":140,"source_url":121},36701,"如果我的调度器（Scheduler）名称不是默认的，或者我有多个调度器，如何确保数据收集器能正常工作？","旧版数据收集器硬编码了从 `model.scheduler.agents` 获取代理的逻辑，这在使用自定义命名或多个调度器时会失效。解决方案包括：\n1. **显式传递调度器**：在初始化 `DataCollector` 时，支持（可选）传入具体的调度器对象，而不是依赖默认路径。\n2. **使用 AgentSet 功能**：利用新版 `AgentSet` 的能力，通过 `AgentSet.select()` 选择特定子集，或使用 `AgentSet.get()` 获取属性。这种方法不依赖于特定的调度器名称，只要能将代理组织成 `AgentSet` 即可进行数据收集。\n\n注意：目前如果代理不属于任何调度器，仍然无法自动收集其数据，这是已知限制。",{"id":142,"question_zh":143,"answer_zh":144,"source_url":126},36702,"如何在网格中高效地处理“中心单元格是否包含在内”以及“对角线邻居”的逻辑？","Mesa 提供了内置参数来处理这些常见的邻域逻辑，无需手动编写复杂的判断代码：\n- **moore**: 设置为 `True` 返回摩尔邻域（包含对角线），`False` 返回冯·诺依曼邻域（排除对角线）。\n- **include_center**: 设置为 `True` 时返回包含中心单元格 (x, y) 在内的邻域，否则仅返回周围单元格。\n- **radius**: 指定邻域的半径（以单元格为单位）。\n\n为了避免每次调用都重复传递这些参数，建议使用封装好的工具函数或 `CellCollection` 来预定义邻域配置，例如创建一个预设了 `moore=True` 和 `radius=1` 的邻域对象并在整个模型中复用。",[146,151,156,161,166,171,176,181,186,191,196,201,206,211,216,221,226,231,236,241],{"id":147,"version":148,"summary_zh":149,"released_at":150},294543,"v3.1.2","## Highlights\r\nMesa v3.1.2 is a patch release containing updates to our wolf-sheep, shelling and prisoner's dilemma example models and improving documentation in the tutorials and visualisation docstring. No functional changes to the core library were made.\r\n\r\n## What's Changed\r\n### 🔍 Examples updated\r\n* examples\u002Fwolf_sheep: Don't allow dumb moves by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2503\r\n* Added homophily ratio in basic schelling example by @vbv-shm in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2520\r\n* examples: Update pd_grid analysis.ipynb to use new spaces by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2553\r\n### 📜 Documentation improvements\r\n* Corrected a few errors in Intro tutorial by @sanika-n in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2583\r\n* Small draw_space docstring fix by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2554\r\n* fix: model name in visualization tutorial by @Sahil-Chhoker in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2591\r\n\r\n## New Contributors\r\n* @vbv-shm made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2520\r\n* @sanika-n made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2583\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.1.1...v3.1.2","2025-01-04T13:14:54",{"id":152,"version":153,"summary_zh":154,"released_at":155},294544,"v3.1.1","## Highlights\r\nMesa 3.1.1 is a maintenance release that includes visualization improvements and documentation updates. The key enhancement is the addition of an interactive play interval control to the visualization interface, allowing users to dynamically adjust simulation speed between 1ms and 500ms through a slider in the Controls panel.\r\n\r\nSeveral example models were updated to use Mesa 3.1's recommended practices, particularly the `create_agents()` method for more efficient agent creation and NumPy's `rng.integers()` for random number generation. The Sugarscape example was modernized to use PropertyLayers.\r\n\r\nBug fixes include improvements to PropertyLayer visualization and a correction to the Schelling model's neighbor similarity calculation. The tutorials were also updated to reflect current best practices in Mesa 3.1.\r\n\r\n## What's Changed\r\n### 🎉 New features added\r\n* Add Interactive Play Interval Control to Mesa Visualization by @AdamZh0u in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2540\r\n### 🐛 Bugs fixed\r\n* bug fixes for draw_property_layers by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2548\r\n### 🔍 Examples updated\r\n* Wolf-sheep to use `create_agent` by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2543\r\n* Shift sugarscape example to using create_agent by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2544\r\n* Fix: Schelling Model Neighbor Similarity Calculation by @Sahil-Chhoker in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2518\r\n* Change pd_grid example to use create_agents by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2545\r\n* Switch sugarscape to using property layers by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2546\r\n### 📜 Documentation improvements\r\n* Updated docs and check_model param by @nissu99 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2510\r\n* Update tutorials to use `create_agents` and `rng.integers` by @DarshPareek in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2541\r\n\r\n## New Contributors\r\n* @nissu99 made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2510\r\n* @DarshPareek made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2541\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.1.0...3.1.1","2024-12-14T16:25:48",{"id":157,"version":158,"summary_zh":159,"released_at":160},294545,"v3.1.0","## Highlights\r\nWith Mesa 3.1.0 we're back on our regular release schedule after the big Mesa 3.0 release, with some exciting new features.\r\n\r\nThis release adds experimental support for Observables and Computed, enabling a more reactive and responsive programming model for agent-based simulations. The new `Observable` and `Computable` classes allow developers to declaratively define attributes that automatically emit signals when their values change, and compute derived values that update dynamically. This lays the groundwork for more advanced event handling and data visualization features in future releases (#2291).\r\n\r\nThe experimental cell space module has been updated with full support for n-dimensional property layers. These allow agents to easily interact with and modify spatial properties of the environment, such as terrain, resources, or environmental conditions. The new implementation provides a more intuitive attribute-based API and ensures tight integration with the cell space architecture (#2512).\r\n\r\nMesa now includes built-in support for logging using the standard Python `logging` module. This provides developers with a flexible and powerful way to add structured diagnostic and debug output to their simulations, without the need for custom logging solutions. The logging system is integrated throughout the library, including the new SolaraViz visualization system (#2506).\r\n\r\nCreating multiple agents with varying initialization parameters is now significantly easier with the new `Agent.create_agents` class method. This factory function supports both uniform and per-agent parameters, simplifying the code required to set up a simulation with a large number of heterogeneous agents (#2351).\r\n\r\nIn addition to the major new features, this release includes a number of smaller enhancements and bug fixes that improve the overall developer experience. These include removing deprecated functionality, cleaning up examples, and addressing various edge cases reported by the community. Mesa 3.1 requires Python 3.11 or higher.\r\n\r\n## What's Changed\r\n### 🧪 Experimental features\r\n* Add support for Observables to MESA by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2291\r\n* Add full support for property layers to cell spaces by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2512\r\n### 🎉 New features added\r\n* Add logging to MESA by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2506\r\n* Add `create_agents` factory method to Agent by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2351\r\n### 🔍 Examples updated\r\n* Add seed control to all examples by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2496\r\n### 📜 Documentation improvements\r\n* doc fix for pip install error on mac by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2508\r\n* Refactored docs for Introductory Tutorial by @Spartan-71 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2511\r\n* Add module-level docstring to experimental features by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2532\r\n### 🔧 Maintenance\r\n* Remove deprecated time module by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2476\r\n* Drop support for Python 3.10, require Python >= 3.11 by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2474\r\n* Remove deprecated functionality by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2483\r\n* Remove visualization modules from `mesa.experimental` by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2495\r\n* Cleanup two occurrences of removed scheduler by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2499\r\n* move _setup_agent_registration into `Model.__init__` by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2501\r\n* remove devs related examples from devs\u002Fexamples by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2507\r\n* added empty iterable checks and updated tests by @Sahil-Chhoker in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2523\r\n* Fix: running Mesa in Docker with Schelling model by @AdamZh0u in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2524\r\n\r\n## New Contributors\r\n* @Spartan-71 made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2511\r\n* @Sahil-Chhoker made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2523\r\n* @AdamZh0u made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2524\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.0.3...v3.1.0\r\n","2024-12-04T19:39:51",{"id":162,"version":163,"summary_zh":164,"released_at":165},294546,"v3.0.3","## Highlights\r\nA small bugfix release that fixes two bugs.\r\n\r\n## What's Changed\r\n### 🧪 Experimental features\r\n* cell_space: Allow CellCollection to be empty by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2502\r\n### 🐛 Bugs fixed\r\n* Only set model_parameters once by @Corvince in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2505\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.0.2...v3.0.3","2024-11-13T23:29:53",{"id":167,"version":168,"summary_zh":169,"released_at":170},294547,"v3.0.2","## Highlighst\r\nMesa 3.0.2 is a small follow-up patch release to [Mesa 3.0](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Freleases\u002Ftag\u002Fv3.0.0), in which we fixed a lot of small bugs in the example models their visualisation, and improved their testing.\r\n\r\n## What's Changed\r\n### 🐛 Bugs fixed\r\n* allow components as a positional argument again by @Corvince in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2488\r\n### 🔍 Examples updated\r\n* examples: Add required components keyword by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2485\r\n* examples: Fix boid_flockers viz by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2492\r\n* examples: Fix schelling viz by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2490\r\n* example: Add input sliders to Sugerscape viz by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2487\r\n* examples\u002Fgol: Add initial fraction alive, add sliders to viz by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2489\r\n### 🔧 Maintenance\r\n* test app init of examples by @Corvince in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2491\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.0.1...v3.0.2","2024-11-11T14:52:26",{"id":172,"version":173,"summary_zh":174,"released_at":175},294548,"v3.0.1","## Highlights\r\nAfter our huge [3.0.0 release](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Freleases\u002Ftag\u002Fv3.0.0), Mesa 3.0.1 follows up with two improvements to experimental features, examples and docs.\r\n\r\n## What's Changed\r\n### 🧪 Experimental features\r\n* Bugfixes to DEVS by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2478\r\n* Support simulators in SolaraViz by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2470\r\n### 🛠 Enhancements made\r\n* issue a user warning if random is None by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2479\r\n### 🔍 Examples updated\r\n* Integrate benchmarks and example models by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2473\r\n### 📜 Documentation improvements\r\n* docs\u002Ftutorial: Replace scheduler in MoneyModel by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2475\r\n* docs: update migration_guide.md by @eltociear in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2480\r\n* Update some DeprecationWarnings to note they are removed in Mesa 3.1 by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2481\r\n\r\n## New Contributors\r\n* @eltociear made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2480\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.0.0...v3.0.1","2024-11-11T10:16:25",{"id":177,"version":178,"summary_zh":179,"released_at":180},294549,"v3.0.0","## Highlights\r\nAfter our most extensive pre-release program ever, we’re proud to release Mesa 3.0 as stable. Mesa 3.0 brings major improvements to agent-based modeling, making it more intuitive and powerful while reducing complexity. This release modernizes core functionalities and introduces new capabilities for both beginners and advanced users.\r\n\r\n### Streamlined agent management\r\nThe centerpiece of Mesa 3.0 is its new agent management system. Agents are now automatically tracked and assigned unique IDs, eliminating common boilerplate code. The new AgentSet functionality provides an elegant and flexible way to work with agents, for example:\r\n\r\n```python\r\n# Find agents meeting specific criteria\r\nwealthy_agents = model.agents.select(lambda a: a.wealth > 1000)\r\n\r\n# Group and analyze agents\r\ngrouped = model.agents.groupby(\"state\")\r\nstate_stats = grouped.agg({\r\n     \"count\": len,\r\n     \"avg_age\": (\"age\", np.mean),\r\n     \"total_wealth\": (\"wealth\", sum)\r\n })\r\n\r\n# Activate agents in different patterns\r\nmodel.agents.shuffle_do(\"step\")  # Random activation\r\nmodel.agents.select(lambda a: a.energy > 0).do(\"move\")  # Conditional activation\r\n```\r\n\r\nThe AgentSet provides powerful methods for filtering, grouping, and analyzing agents, making it easier to express complex model logic. Each model automatically maintains an AgentSet containing all agents (`model.agents`) and separate AgentSets for each agent type (`model.agents_by_type`). See the full [AgentSet docs](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fapis\u002Fagent.html#mesa.agent.AgentSet) here.\r\n\r\n### Modern Visualization with SolaraViz\r\nMesa 3.0's new experimental visualization system, SolaraViz, provides a modern, interactive interface for model exploration:\r\n\r\n```python\r\nfrom mesa.visualization import SolaraViz, make_space_component, make_plot_component\r\n\r\nvisualization = SolaraViz(\r\n    model,\r\n    [\r\n        make_space_component(agent_portrayal),\r\n        make_plot_component([\"population\", \"average_wealth\"]),\r\n        lambda m: f\"Step {m.steps}: {len(m.agents)} agents\"  # Custom text component\r\n    ],\r\n    model_params=parameter_controls\r\n)\r\n```\r\n\r\nKey visualization features:\r\n- Interactive browser-based interface with real-time updates\r\n- Support for both grid-based and network models\r\n- Visualization of PropertyLayers and hexagonal grids\r\n- Custom components using Matplotlib or text\r\n- Improved performance and responsiveness\r\n\r\nCheck out the [Visualization Tutorial](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Ftutorials\u002Fvisualization_tutorial.html) to get started.\r\n\r\n*Note: SolaraViz is in active development. We might make API breaking changes between Mesa 3.0 and 3.1.*\r\n\r\n### Enhanced data collection\r\nThe DataCollector now supports collecting different metrics for different agent types, using  `agenttype_reporters`:\r\n\r\n```python\r\nself.datacollector = DataCollector(\r\n    model_reporters={\"total_wealth\": lambda m: m.agents.agg(\"wealth\", sum)},\r\n    agent_reporters={\"age\": \"age\", \"wealth\": \"wealth\"},\r\n    agenttype_reporters={\r\n        Predator: {\"kills\": \"kills_count\"},\r\n        Prey: {\"distance_fled\": \"total_flight_distance\"}\r\n    }\r\n)\r\n```\r\n\r\n### Experimental features\r\nMesa 3.0 introduces several experimental features for advanced modeling:\r\n- [Cell Space](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fapis\u002Fexperimental.html#module-experimental.cell_space.cell) with integrated PropertyLayers and improved agent movement capabilities\r\n- Voronoi grid implementation\r\n- [Event-scheduling simulation](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fapis\u002Fexperimental.html#module-experimental.devs.eventlist) capabilities\r\n\r\nThese experimental features are in active development and might break API between releases.\r\n\r\n## Breaking changes\r\n_See our [Mesa 3.0 migration guide](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fmigration_guide.html#mesa-3-0) for a full overview._\r\n\r\nIf you want to move existing models from Mesa 2.x to 3.0, there are a few things you have to change.\r\n\r\n1. Models must explicitly initialize the Mesa base class:\r\n```python\r\nclass MyModel(mesa.Model):\r\n    def __init__(self, n_agents, seed=None):\r\n        super().__init__(seed=seed)  # Required in Mesa 3.0\r\n```\r\n\r\n2. Agents are created without manual ID assignment:\r\n```python\r\n# Old\r\nagent = MyAgent(unique_id=1, model=self)\r\n# New\r\nagent = MyAgent(model=self)\r\n```\r\n\r\n3. Scheduler replacement with AgentSet operations:\r\n```python\r\n# Old (RandomActivation)\r\nself.schedule = RandomActivation(self)\r\nself.schedule.step()\r\n\r\n# New\r\nself.agents.shuffle_do(\"step\")\r\n\r\n# Old (SimultaneousActivation)\r\nself.schedule = SimultaneousActivation(self)\r\nself.schedule.step()\r\n\r\n# New\r\nself.agents.do(\"step\")\r\nself.agents.do(\"advance\")\r\n```\r\n\r\nFurthermore:\r\n- Steps counter automatically increments\r\n- `mesa.flat` namespace removed\r\n- Python 3.10+ required\r\n- Reserved model variables (`agents`, `steps`, etc.) protected\r\n- Simplified DataCollector initialization\r\n- Old visualization system replaced by SolaraViz\r\n\r\n## Getting Started\r\nInstall Mesa 3.0:\r\n```bash\r\npip install --up","2024-11-09T08:07:46",{"id":182,"version":183,"summary_zh":184,"released_at":185},294530,"v3.5.1","## 亮点\nMesa 3.5.1 是一个维护版本，它将 Mesa 4.0 开发分支中的错误修复、性能改进和小幅增强后向移植到稳定的 3.5.x 系列中。\n\n在 3.5.0 中已经趋于稳定的事件调度系统迎来了多项增强：`EventGenerator` 新增了 `pause()`\u002F`resume()` 方法（#3431）以及 `next_scheduled_time` 属性（#3423）。`EventList` 则添加了一个用于清理已取消事件的 `compact()` 方法（#3359）。现在，事件调度中强制使用单调时间（#3343），并且修复了 `EventGenerator` 中因强引用导致的内存泄漏问题（#3360）。\n\n此外，`Event.__lt__`（#3336）、`EventList.peek_ahead`（#3413）和 `EventList.__len__`（#3512）的性能也得到了提升，这些改进都避免了不必要的内存分配。\n\n错误修复方面，包括将 `CellAgent` 分配到已满单元格时状态不一致的问题（#3374）、在 `FixedCell` 中实现原子性代理添加（#3415）、防止时间回退（#3329），以及从 `solara_viz` 中移除对旧版 `model.steps` 的使用（#3344）。\n\n最后，Altair 可视化后端新增了工具提示支持（#3392）。整个事件系统和 `AgentSet` 的类型提示也得到了完善。基准测试现已改用 `Scenario`，而狼-羊示例也进行了优化（#3503）。\n\n## 变更内容\n### 🛠 增强功能\n* 修复计划验证中开始时间大于结束时间的问题，由 @souro26 在 #3326 中完成\n* 事件相关修复，由 @quaquel 在 #3331 中完成\n* 在 schedule_event 中对不支持的 lambda\u002Fpartial 回调快速报错，由 @falloficarus22 在 #3320 中完成\n* 修复：在 EventGenerator 中使用弱引用来防止内存泄漏，由 @Krishsharma179 在 #3360 中完成\n* 为 EventList 添加压缩方法，以减少大量取消操作带来的性能下降，由 @souro26 在 #3359 中完成\n* 为 AgentSet.select 中的内部生成器添加类型提示，由 @Tushar1733 在 #3410 中完成\n* 为 Altair 后端添加工具提示支持，由 @annapurna-gupta 在 #3392 中完成\n* 为 EventGenerator 添加 next_scheduled_time 属性，由 @souro26 在 #3423 中完成\n* 为 EventGenerator 添加暂停和恢复功能，由 @souro26 在 #3431 中完成\n\n### 🐛 错误修复\n* 修复 Model._event_generators 无限制增长的问题，由 @EwoutH 在 #3317 中完成\n* 修复：通过提前返回来防止 _advance_time 中的时间回退，由 @Krishsharma179 在 #3329 中完成\n* 从 solara_viz 中移除 model.steps 的使用，由 @codebreaker32 在 #3344 中完成\n* 在事件调度中强制执行单调时间不变性，由 @souro26 在 #3343 中完成\n* 修复将 CellAgent 分配到已满单元格时状态不一致的问题，由 @souro26 在 #3374 中完成\n* 修复：FixedCell 的 setter 会先原子性地添加代理再更新引用（修复 #3411），由 @Rishav23av 在 #3415 中完成\n* 单元容量相关错误修复，由 @quaquel 在 #3524 中完成\n\n### ⚡ 性能改进\n* 优化 Event.__lt__，避免元组分配，由 @souro26 在 #3336 中完成\n* 在 peek_ahead 中使用生成器代替列表分配，由 @souro26 在 #3413 中完成\n* 避免 EventList.__len__ 中临时列表的分配，由 @souro26 在 #3512 中完成\n\n### 🔍 示例更新\n* 清理 pd_grid 示例的激活逻辑，由 @EwoutH 在 #3349 中完成\n* 在所有基准测试示例中使用 Scenario，由 @codebreaker32 在 #3314 中完成\n* 优化狼-","2026-03-15T11:41:55",{"id":187,"version":188,"summary_zh":189,"released_at":190},294531,"v4.0.0a0","## 亮点\nMesa 4.0 alpha 0 (`v4.0.0a0`) 是 Mesa 下一个主要版本的首个预发布版本。它移除了长期废弃的 API，清理了核心架构，并为智能体引入了实验性的定时动作功能。这是一个用于早期测试的 Alpha 版本，在正式的 4.0 稳定版发布之前，可能会存在一些不完善之处和进一步的破坏性变更。\n\n### 破坏性变更：移除已废弃的 API\nMesa 4.0 按照在 Mesa 3.x 中宣布的弃用计划，移除了多个遗留组件：\n\n- **移除 `seed` 参数** (#3318)：自 Mesa 3.4 起已废弃的 `Model.__init__()` 的 `seed` 关键字参数已被移除。请改用 `rng`（或通过 `Scenario` 传递）。同时，`reset_rng` 方法也已更新，可在重置 NumPy 随机数生成器的同时重置 `model.random`。\n- **移除 `model.steps`** (#3328)：步数计数器已被替换为 `model.time`，从而完成了向以时间为中心的仿真模型的转变。所有内部使用现在都引用 `model.time`，相应的步数循环机制也得到了简化。\n- **移除 `batch_run`** (#3325)：`batch_run` 函数及其相关文件已被移除。用户应通过 `Scenario` 和直接控制模型来管理实验的执行（有关背景信息，请参阅 #3134）。\n- **移除 `mesa.space`** (#3337)：旧版空间模块及 `agent.pos` 已被移除。对于基于网格和网络的模型，请使用 `mesa.discrete_space`。\n- **移除 `PropertyLayer` 和 `HasPropertyLayers` 混入类** (#3340, #3432)：独立的 `PropertyLayer` 类现由直接存储在网格上的原始 NumPy 数组取代，这些数组被称为 `property_layers`。单元格上的属性访问现在使用动态 `GridCell` 类上的原生属性闭包，从而简化了内部实现。\n- **移除模拟器类** (#3530)：`Simulator`、`ABMSimulator` 和 `DEVSimulator` 类以及整个 `mesa.experimental.devs` 包已被移除，从而完成了自 Mesa 3.5.0 开始的弃用周期。它们的功能现由 `model.run_for()`、`model.run_until()`、`model.schedule_event()` 和 `model.schedule_recurring()` 承担。需要注意的是，核心事件系统在 `mesa.time` 中仍完全可用。\n\n### 实验性功能：智能体的定时动作\nMesa 4.0a0 引入了一个实验性的 `Action` 系统 (#3461)，为智能体提供了一种内置的“随时间执行某项任务”的概念。这些动作与 Mesa 的事件调度系统集成，可实现精确的定时，并支持中断和进度跟踪，同时还允许恢复执行。\n\n```python\nfrom mesa.experimental.actions import Action\n\nclass Forage(Action):\n    def __init__(self, sheep):\n        super().__init__(sheep, duration=5.0)\n\n    def on_complete(self):\n        self.agent.energy += 30\n\n    def on_interrupt(self, progress):\n        self.agent.energy += 30 * progress  # 按比例获得奖励\n\nsheep.start_action(Forage(sheep))\n```\n\n其主要特性包括：\n- 可通过子类化实现 `on_start()`、`on_resume()`、`on_complete()` 和 `on_interrupt(progress)` 回调函数。\n- 实时计算的 `progress` 和 `remainin","2026-03-14T08:58:09",{"id":192,"version":193,"summary_zh":194,"released_at":195},294532,"v3.5.0","## 亮点\nMesa 3.5.0 是一个重要的功能发布版本，引入了公开的事件调度 API，稳定了事件系统，并通过弃用若干遗留模式为 Mesa 4.0 奠定了基础。\n\n### 公开的事件调度与时间推进\n3.5.0 的核心特性是新增了一个直接在 `Model` 上使用的公开 API，用于事件调度和时间推进（#3266）。用户无需再与实验性的 `Simulator` 类交互，而是可以通过简单且表达力强的方法来调度事件和推进时间：\n\n```python\n# 运行模型一段时间\nmodel.run_for(10)       # 推进 10 个时间单位\nmodel.run_until(50.0)   # 直到绝对时间 50 为止\n\n# 调度一次性事件\nmodel.schedule_event(callback, at=25.0)    # 在绝对时间 25 处触发\nmodel.schedule_event(callback, after=5.0)  # 从当前时间起 5 个单位后触发\n\n# 调度重复性事件\nfrom mesa.time import Schedule\nmodel.schedule_recurring(func, Schedule(interval=10, start=0))\n```\n\n对于传统的 ABM 来说，`model.run_for(1)` 在功能上等同于 `model.step()`，但这一机制可以自然地推广到事件驱动型和混合型模型中。思维模式也从“执行第 N 步”转变为“推进时间，所有已安排的任务都会自动运行”。\n\n我们新推出的 [Agent 激活](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Ftutorials\u002F2_agent_activation.html) 和 [事件调度](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Ftutorials\u002F3_event_scheduling.html) 教程对此进行了详尽的介绍（#3280）。\n\n### 稳定化的事件调度系统\n事件调度系统（EventList、Event、EventGenerator、Schedule、Priority）已从 `mesa.experimental.devs` 移至新的稳定模块 `mesa.time` 中（#3276），使基于事件的仿真成为 Mesa 的一等公民功能。新的 `Schedule` 数据类提供了一种简洁的方式来定义带有间隔、开始、结束和次数参数的重复性时间模式（#3250）。有关迁移指南，请参阅我们的 [迁移指南](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fmigration_guide.html#event-scheduling-and-time-advancement)。\n\n### 为 Mesa 4.0 做准备的弃用内容\n为了迎接 Mesa 4.0，本版本弃用了多项遗留模式：\n- **Simulator 类已被弃用**（#3277）：`ABMSimulator` 和 `DEVSimulator` 已被上述新的 `Model` 方法所取代。\n- **`seed` 参数已被弃用**（#3147）：请改用 `Model.__init__()` 中的 `rng` 参数。\n- **AgentSet 的序列行为已被弃用**（#3208）：对 `AgentSet` 的索引或切片操作已被弃用，建议使用新的 `to_list()` 方法。\n- **描绘字典已被弃用**（#3144）：请改用 `AgentPortrayalStyle` 和 `PropertyLayerStyle`。\n\n更多详细信息请参阅我们的 [迁移指南](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fmigration_guide.html#mesa-3-5-0)。\n\n### 内部架构改进\n在底层实现上，`Model` 现在内部使用 `EventGenerator` 来进行步骤调度（#3260），从而将步进机制与更广泛的事件系统统一起来。一个新的 `_HardKeyAgentSet`（#3219、#3224）则取代了基于 `WeakKeyDictionary` 的存储方式，用于管理模型中的代理集合。","2026-02-15T17:53:53",{"id":197,"version":198,"summary_zh":199,"released_at":200},294533,"v3.5.0b0","## 亮点\nMesa 3.5.0 将是一个重要的功能发布版，它引入了公开的事件调度 API，稳定了事件系统，并通过弃用若干遗留模式为 Mesa 4.0 奠定基础。\n\n鉴于本次发布规模较大，我们首先发布了测试版 `v3.5.0b0`。欢迎并感谢大家提供反馈和报告问题！\n\n### 公开的事件调度与时间推进\n3.5.0 的核心特性是新增了一个可在 `Model` 上直接使用的公开 API，用于事件调度和时间推进（#3266）。用户无需再与实验性的 `Simulator` 类交互，而是可以通过简单且富有表现力的方法来调度事件和推进时间：\n\n```python\n# 运行模型一段时间\nmodel.run_for(10)       # 推进 10 个时间单位\nmodel.run_until(50.0)   # 直到绝对时间 50\n\n# 调度一次性事件\nmodel.schedule_event(callback, at=25.0)    # 在绝对时间触发\nmodel.schedule_event(callback, after=5.0)  # 相对于当前时间触发\n\n# 调度重复性事件\nfrom mesa.time import Schedule\nmodel.schedule_recurring(func, Schedule(interval=10, start=0))\n```\n\n对于传统的 ABM 来说，`model.run_for(1)` 在功能上等同于 `model.step()`，但这一机制可以自然地推广到事件驱动型和混合模型中。思维模式也从“执行第 N 步”转变为“推进时间，所有已安排的任务都会自动运行”。\n\n### 稳定化的事件调度系统\n事件调度系统（EventList、Event、EventGenerator、Schedule、Priority）已从 `mesa.experimental.devs` 移至新的稳定模块 `mesa.time` 中（#3276），使基于事件的仿真成为 Mesa 的一等公民功能。新的 `Schedule` 数据类提供了一种简洁的方式来定义具有间隔、起始、结束和次数参数的重复性时间模式（#3250）。\n\n### 为 Mesa 4.0 做准备的弃用内容\n为了迎接 Mesa 4.0，本版本弃用了多项遗留模式：\n- **Simulator 类被弃用**（#3277）：`ABMSimulator` 和 `DEVSimulator` 已被上述新的 `Model` 方法所取代。\n- **`seed` 参数被弃用**（#3147）：请改用 `Model.__init__()` 中的 `rng` 参数。\n- **AgentSet 的序列行为被弃用**（#3208）：对 `AgentSet` 的索引或切片操作已被弃用，建议使用新的 `to_list()` 方法。\n- **描绘字典被弃用**（#3144）：请改用 `AgentPortrayalStyle` 和 `PropertyLayerStyle`。\n\n更多详细信息请参阅我们的 [迁移指南](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fmigration_guide.html#mesa-3-5-0)。\n\n### 内部架构改进\n在底层实现上，`Model` 现在内部使用 `EventGenerator` 来进行步骤调度（#3260），从而将步骤机制与更广泛的事件系统统一起来。一个新的 `_HardKeyAgentSet`（#3219、#3224）取代了基于 `WeakKeyDictionary` 的存储方式，用于管理模型中的智能体集合，在创建视图时会自动降级以防止内存泄漏，同时消除了弱引用带来的额外开销。此外，一个 `AbstractAgentSet` 基类（#3210）正式定义了 `AgentSet` 的接口规范。\n\n### 新增","2026-02-12T07:44:42",{"id":202,"version":203,"summary_zh":204,"released_at":205},294534,"v3.4.2","## 亮点\nMesa 3.4.2 是一个错误修复版本，解决了影响所有 Mesa 模型的严重内存泄漏问题。\n\n在创建智能体后，模型实例将无法被垃圾回收的内存泄漏问题已被发现（#3179）。根本原因在于 `Agent._ids` 类属性：这是一个 `defaultdict`，用于存储对模型实例的引用，以确保每个模型的 `unique_id` 值都是唯一的。由于该属性是类级别的，并且在整个 Python 进程中持续存在，因此任何用作键的模型都会无限期地保持强引用，从而阻止模型及其所有相关对象在超出作用域后被清理。\n\n此 bug 对运行多个模拟或批量实验的用户具有严重影响：每个模型实例都会不断累积在内存中而无法释放，最终耗尽可用内存。修复方案将 `unique_id` 的分配从 `Agent` 类移至 `Model.register_agent()` 方法中，现在每个模型都维护自己的 `agent_id_counter` 实例属性（#3180）。这消除了持久的类级别引用，使得模型对象能够被正确地进行垃圾回收。\n\n此外，本次发布还修复了 `PropertyLayer.from_data()` 方法，以防止意外的副作用（#3122），并进行了多项小的文档改进（#3104、#3124、#3127），同时还扩展了贡献指南，详细说明了 Mesa 的开发理念和工作流程（#3135）。\n\n**强烈建议升级到 Mesa 3.4.2。**\n\n```bash\npip install --upgrade mesa\n```\n\n## 变更内容\n### 🐛 错误修复\n* 确保 `PropertyLayer.from_data()` 不产生副作用，由 @quaquel 在 #3122 中修复\n* 修复内存泄漏问题，由 @quaquel 在 #3180 中修复\n\n### 📜 文档改进\n* 记录 `Agent` 的可哈希性要求，由 @Sonu0305 在 #3104 中完成\n* 修复 `chart_property_layers` 的文档字符串，由 @Sonu0305 在 #3124 中完成\n* 修复 `remove_property_layer` 的文档字符串，由 @Sonu0305 在 #3127 中完成\n* 添加 Mesa 开发流程指南，由 @EwoutH 在 #3135 中完成\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fcompare\u002Fv3.4.1...v3.4.2","2026-01-23T12:25:07",{"id":207,"version":208,"summary_zh":209,"released_at":210},294535,"v3.4.1","## 亮点\nMesa 3.4.1 是一个补丁版本，包含错误修复、性能改进和文档增强。此版本解决了影响数据收集、内存管理和网格操作的问题，同时引入了性能优化。\n\n该版本修复了多个影响模拟准确性的错误：修复了多个 `batch_run` 和 `DataCollector` 相关问题，包括 `agenttype_reporters` 支持（#3095）、稀疏数据收集（#2988）以及每步多次调用 `collect()` 的正确处理（#3058）；解决了 `MultiGrid._empty_mask` 更新不正确的问题（#3019）和 `select_random_empty_cell()` 中的无限循环问题（#3014）；修复了 `ContinuousSpace` 中移除 agent 时的内存泄漏问题（#3031）；修正了 `EventList.peek_ahead()` 的时间顺序问题（#3010）；并确保 `FixedAgent` 在被移除后状态的一致性（#3100）。\n\n此外，多项优化提升了 Mesa 的性能：`PropertyLayer` 经过重构，直接实现了 NumPy 接口，支持标准的 NumPy 语法（#3074）；`select_random_empty_cell()` 现在使用向量化 NumPy 操作，取代了低效的 O(N) Python 迭代（#3087）；对 `Cell.is_empty`\u002F`is_full` 的检查进行了优化，去除了不必要的 O(n) 复制操作（#3069）。\n\n文档方面也得到了多项改进，包括为可视化教程添加版本警告（#2949）、更新贡献指南（#3028），以及引入 Vale 工具以统一文档风格（#3022）。整个 `mesa.space` 模块现已被标记为仅维护状态（#3082），建议用户在新项目中使用 `mesa.discrete_space`。此外，`Agent`、`AgentSet` 和 `Model` 类中新增了泛型类型参数，以提升静态类型检查能力（#2885）。\n\n我们很高兴在此版本中迎来了 9 位新贡献者！感谢所有为错误修复、性能改进和文档增强做出贡献的开发者！\n\n## 变更内容\n### 🛠 功能增强\n* 优化 Cell 的 `is_empty`\u002F`is_full` 检查，由 @codebyNJ 在 #3069 中完成  \n* 重构 `PropertyLayer` 以实现 NumPy 接口并弃用封装层，由 @codebreaker32 在 #3074 中完成  \n* 优化 `grid.py` 中的 `select_random_empty_cell()` 方法，由 @codebreaker32 在 #3087 中完成  \n* 为 `Agent`、`AgentSet` 和 `Model` 添加泛型类型参数，由 @SiddharthBansal007 在 #2885 中完成  \n\n### 🐛 错误修复\n* 修复：`peak_ahead` 返回事件时按正确的时间顺序排列，由 @Nithin9585 在 #3010 中完成  \n* 修复：通过启发式回退机制防止 `select_random_empty_cell()` 中的无限循环，由 @DipayanDasgupta 在 #3014 中完成  \n* 修复：`datacollector` 缺少属性的错误，由 @codebyNJ 在 #3041 中完成  \n* 修复：为 agent reporters 添加深拷贝，以避免可变引用泄漏……，由 @Nithin9585 在 #3038 中完成  \n* 在 `Simulator.run_for()` 中添加初始化检查，由 @codebreaker32 在 #3036 中完成  \n* 修复：`DataCollector` 中的方法 reporter 验证问题，由 @vedantvakharia 在 #3002 中完成  \n* 修复：`MultiGrid._empty_mask` 更新不正确的问题，由 @Nithin9585 在 #3019 中完成  \n* 修复：当 `DataCollector.collect()` 每步被多次调用时，`batch_run` 中的数据获取问题得到纠正，由 @Ni","2026-01-10T09:46:26",{"id":212,"version":213,"summary_zh":214,"released_at":215},294536,"v3.4.0","## 亮点\nMesa 3.4.0 功能版本引入了通用的仿真时间管理，提升了批量运行的可重复性，并强化了我们的弃用政策。该版本还要求使用 Python 3.12 及以上版本，同时包含大量错误修复和体验优化。\n\n### 通过 `model.time` 实现通用仿真时间\nMesa 现在通过 `model.time` 属性提供仿真时间的单一可信来源 (#2903)。此前，时间分散在不同组件中：简单模型使用 `model.steps` 作为代理，而离散事件仿真则将时间存储在 `simulator.time` 中。这种设计使得需要一致时间访问的功能变得复杂。\n\n现在，所有模型都拥有 `model.time` 属性，它具备以下特性：\n- 每一步自动递增（每次增加 1.0）\n- 与离散事件仿真无缝兼容\n- 为数据收集、可视化和用户代码提供一致的接口\n\n```python\n# 基本用法——时间自动递增\nmodel = Model()\nmodel.step()\nprint(model.time)  # 1.0\n\n# 使用离散事件仿真\nsimulator = DEVSimulator()\nsimulator.setup(model)\nsimulator.schedule_event_absolute(some_function, 2.5)\nsimulator.run_until(3.0)\nprint(model.time)  # 3.0\n```\n\n旧的 `simulator.time` 仍然可用，但会发出弃用警告。\n\n### 提升批量运行的可重复性\n`batch_run` 函数现已更新，能够显式控制各次运行的随机种子 (#2841)。此前，如果使用固定种子并指定 `iterations` 参数，所有迭代都会使用相同的种子，从而产生完全相同的结果，而非独立的复现结果。\n\n新的 `rng` 参数可以接受单个种子值或种子值的可迭代对象，使您能够完全掌控运行的可重复性：\n\n```python\nrng = np.random.default_rng(42)\nseed_values = rng.integers(0, sys.maxsize, size=(5,))\n\nresults = mesa.batch_run(\n    MoneyModel,\n    parameters=params,\n    rng=seed_values.tolist(),  # 每次迭代使用不同的种子\n)\n```\n\n旧的 `iterations` 参数现已弃用，将在 Mesa 4.0 中移除。有关代码更新的详细信息，请参阅[迁移指南](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fmigration_guide.html#batch-run)。\n\n### 强化弃用政策\nMesa 现在制定了正式的[弃用政策](https:\u002F\u002Fgithub.com\u002Fmesa\u002Fmesa\u002Fblob\u002Fmain\u002FCONTRIBUTING.md#deprecation-policy)，以确保用户有足够的时间进行迁移，同时允许 Mesa 不断演进 (#2900)。与此相关的一项变更在于，所有弃用警告现在都使用 `FutureWarning` 而非 `DeprecationWarning` (#2905)，从而使这些警告默认可见，因为 `DeprecationWarning` 对于导入的模块是隐藏的。\n\n该政策保证：\n- 新功能必须至少在一个次要版本中可用，才能开始弃用旧功能。\n- 在正式弃用之前，必须更新文档、迁移指南和示例。\n- 破坏性更改仅发生在主版本发布时。\n- 实验性功能具有更大的灵活性，但仍需明确沟通 c","2025-12-24T16:25:03",{"id":217,"version":218,"summary_zh":219,"released_at":220},294537,"v3.3.1","## 亮点\nMesa 3.3.1 是一个维护版本，主要聚焦于修复 bug 和改进文档，紧随 3.3.0 版本的重大可视化更新之后。\n\n本次发布解决了两个关键的可视化 bug，分别影响 HexGrid 上的 PropertyLayers 以及 Altair 和 Matplotlib 后端之间的属性图层数据映射问题。\n\n文档也进行了多项重要更新，包括修复教程代码示例、新增 Google Summer of Code 贡献者指南，以及优化文档结构的组织方式。迁移指南现已更新，以反映旧的 `agent_portrayal` 参数已被弃用，取而代之的是在 Mesa 3.3.0 中引入的新 `AgentPortrayalStyle`。\n\n我们很高兴地欢迎六位新贡献者加入 Mesa 项目！感谢所有为修复 bug、改进文档和提升测试覆盖率做出贡献的开发者。\n\n## 变更内容\n### 🐛 已修复的 bug\n* 修复 HexGrid 上 PropertyLayers 的可视化错误，并添加转置操作……由 @flucco 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2868 中完成。\n* 修复：Altair 和 Matplotlib 后端的属性图层数据映射问题——由 @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2869 中完成。\n* 修复：AgentSet 的初始化不应再要求显式指定随机数生成器——由 @verisimilidude2 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2789 中完成。\n\n### 🔍 示例更新\n* 修复教程中缺失的变量 g——由 @pazmiller 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2849 中完成。\n\n### 📜 文档改进\n* 修复示例中的断链——由 @BigTurtle8 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2847 中完成。\n* 文档：通过为 MoneyModel 添加默认值来修复教程中的 ValueError——由 @pragam-m25 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2871 中完成。\n* 新增 GSoC 贡献者指南——由 @colinfrisch 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2873 中完成。\n* 弃用 `agent_portrayal` 并更新迁移指南——由 @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2872 中完成。\n* 文档：将列表概览与教程分开——由 @dhiraj-143r 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2878 中完成。\n\n### 🔧 维护工作\n* 对可视化部分进行 ruff 代码格式化修复——由 @quaquel 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2867 中完成。\n* [pre-commit.ci] 自动更新 pre-commit 配置：升级至 ruff v0.13——由 @pre-commit-ci[bot] 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2840 中完成。\n* 测试：为 UserInputs 中的 InputText 添加测试——由 @pragam-m25 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2870 中完成。\n\n## 新贡献者\n* @BigTurtle8 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2847 中完成了首次贡献。\n* @pazmiller 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2849 中完成了首次贡献。\n* @flucco 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2868 中完成了首次贡献。\n* @pragam-m25 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2870 中完成了首次贡献。\n* @dhiraj-143r 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2878 中完成了首次贡献。\n* @verisimilidude2 在 ht 中完成了首次贡献。","2025-11-07T10:43:56",{"id":222,"version":223,"summary_zh":224,"released_at":225},294538,"v3.3.0","## 亮点\n\n3.3.0 版本的最大亮点是引入了一个全新且改进的可视化模块。这项工作是由 @Sahil-Chhoker 在 Google Summer of Code 项目中完成的。新模块保持向后兼容性，并继续使用 Solara 框架。它包含多项新功能和改进，具体如下：\n- `AgentPortrayalStyle`：一种更友好的代理展示方式。\n- `PropertyLayerStyle`：使属性层和代理展示更加一致。\n- `SpaceRender`：一个用于绘制空间、代理和属性层的新组件，支持广泛的自定义选项。\n- 对 Altair 和 Matplotlib 的支持得到增强。\n- 多页面支持（例如，用户可以在一个页面上显示模拟，在另一个页面上显示模型图表）。\n- 可视化相关教程已更新。\n\n[您可以在此处阅读有关此次更新的更多信息](https:\u002F\u002Fgist.github.com\u002FSahil-Chhoker\u002F470d78683664dffc05725bd858beb494)\n\n此外，Mesa 还进行了许多其他改进，从错误修复到持续集成\u002F持续交付（CI\u002FCD）流程的优化。感谢 PyCon Sprint 活动以及所有支持 Mesa 的开发者！\n\n## 变更内容\n### 🧪 实验性功能\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2803 中引入了 Space Renderer。\n### 🎉 新增功能\n* @hussainsultan 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2788 中添加了 docs\u002Fnix flake。\n### 🛠 功能增强\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2786 中新增了 `AgentPortrayalStyle` 和 `PropertyLayerStyle`。\n* @Holzhauer 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2799 中允许使用图像标记来绘制代理。\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2809 中修复了 solaraviz 中的渲染器空值检查问题。\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2810 中增加了 Altair 绘图功能。\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2817 中修复了当同时调用 draw_structure 和 draw_agents 时，Altair 中网格不显示的问题。\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2818 中允许在 AgentPortrayalStyle 中将颜色映射到整数。\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2827 中添加了多页面功能。\n### 🐛 错误修复\n* @Holzhauer 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2780 中修复了 ModelCreator 中关于必填模型参数和用户可调整参数的问题。\n* @derkweijers 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2791 中移除了不必要的整数类型转换。\n* @jackiekazil 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2787 中为 README 添加了引号，以确保跨终端兼容性。\n* @catherinedevlin 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2793 中修复了损坏的文档链接问题（Issue #2792）。\n* @Sahil-Chhoker 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2798 中修复了展示组件的相关错误。\n* @colinfrisch 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2806 中修复了当 citizen_density（初始代理密度…）时可能导致崩溃的问题。\n* @Tosiekdev 在 https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2821 中修复了 Issue #2812。\n### 📜 文档 i","2025-09-06T20:14:07",{"id":227,"version":228,"summary_zh":229,"released_at":230},294539,"v3.2.0","## 亮点\nMesa 3.2.0 是一个功能丰富的版本，它稳定了我们的离散空间模块，增强了多项可视化能力，优化了教程组织结构，新增了实验性的元智能体，并包含其他提升使用体验的改进。\n\n我们还庆祝了经过同行评审的 [Mesa 3 论文](https:\u002F\u002Fdoi.org\u002F10.21105\u002Fjoss.07668) 在 JOSS 上发表。请参阅更新后的 [引用 Mesa](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa?tab=readme-ov-file#citing-mesa) 部分，了解如何正确引用我们的工作。\n\n### 离散空间的稳定性提升\n实验性的 Cell Space 系统现已稳定，并作为 `mesa.discrete_space` 模块正式发布（[#2610](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2610)）。这一强大的空间建模框架支持以细胞为中心的仿真，集成了 PropertyLayers，并改进了智能体的移动能力。主要改进包括：\n\n- 支持在仿真过程中对离散空间进行动态修改（[#2755](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2755)）\n- 提供实时添加或移除细胞及连接的方法\n- 与 PropertyLayers 完全集成（[#2440](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2440)），用于表示环境变量\n- 兼容所有示例和现有可视化工具\n\nPropertyLayer 本身也已稳定化，能够高效管理地形、资源等基于网格的环境属性或其他空间变量。核心示例，如 [谢林模型](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Ftree\u002Fmain\u002Fmesa\u002Fexamples\u002Fbasic\u002Fschelling)、[生命游戏](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Ftree\u002Fmain\u002Fmesa\u002Fexamples\u002Fbasic\u002Fconways_game_of_life)、[玻尔兹曼财富模型](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Ftree\u002Fmain\u002Fmesa\u002Fexamples\u002Fbasic\u002Fboltzmann_wealth_model) 和 [网络中的病毒传播](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Ftree\u002Fmain\u002Fmesa\u002Fexamples\u002Fbasic\u002Fvirus_on_network)，均已更新为使用新的离散空间系统。\n\n### 可视化体验的增强\nSolaraViz 可视化系统获得了显著升级：\n\n- **命令控制台**（[#2697](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2697)）：直接嵌入可视化界面的交互式 Python 控制台，支持实时检查和操作模型\n- **异步更新**（[#2656](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2656)）：可视化现运行于独立线程中，大幅提升了复杂模型的性能\n- **深色模式**（[#2689](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2689)）：支持 Solara 深色主题，可自动匹配系统偏好设置\n- **错误处理优化**（[#2747](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2747)、[#2753](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2753)）：更清晰地展示错误信息，并提供查看详细回溯信息的选项\n- **用户界面改进**：支持方向键导航（[#2725](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2725)），输入框可移动并自动滚动（[#2710](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpul","2025-05-08T09:37:46",{"id":232,"version":233,"summary_zh":234,"released_at":235},294540,"v3.1.5","## Highlights\r\nMesa 3.1.5 is a maintenance release focused on improving documentation and cleaning up our resources. This update includes no breaking changes and is compatible with previous 3.1.x releases.\r\n\r\nThe documentation improvements include enhanced explanations for batch run parallel processing, a significantly expanded overview section covering spaces, property layers and time advancement methods with practical code examples, and a clearer installation guide detailing what the optional `[rec]` dependencies provide. We've also improved our examples documentation to better distinguish between core and user-contributed examples, and added a new \"Roles\" section to the contributing guide that outlines the project's community structure and progression paths.\r\n\r\nOn the maintenance side, we've cleaned up unused images and compressed existing ones, reducing the repository size by over 2MB and distribution size from 3.2MB to 1.2MB.\r\n\r\nWe recommend all users update to this release for the improved documentation.\r\n\r\n## What's Changed\r\n### 📜 Documentation improvements\r\n* docs: Split off the overview page, extend with spaces\u002Factivation by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2673\r\n* docs: Add Roles section to CONTRIBUTING.md by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2694\r\n* [JOSS] Docs: Clarify difference between core and user examples by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2706\r\n* [JOSS] docs: Improve batch_run documentation for parallel processing by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2707\r\n* Clean-up old images, compress wolf-sheep image, remove version switch artifact by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2717\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.1.4...v3.1.5","2025-03-26T11:11:05",{"id":237,"version":238,"summary_zh":239,"released_at":240},294541,"v3.1.4","## Highlights\r\nThis release contains various improvements and bugfixes to the matplotlib-based visualization of spaces. Hexgrids are now fully supported, including property layers. In making this possible, various minor bugs were encountered and also fixed. In addition to the visualization improvements, there are various minor convenience improvements to the docs.\r\n\r\n\r\n## What's Changed\r\n### 🛠 Enhancements made\r\n* Fixed hex-space draw function to avoid overlaps by @Sahil-Chhoker in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2609\r\n* Fix: Property layer visualization for HexGrid by @Sahil-Chhoker in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2646\r\n* Enhance DataCollector to validate model_reporters functions by @peter-kinger in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2605\r\n* Implemented post_process in Altair based components by @sanika-n in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2641\r\n### 🐛 Bugs fixed\r\n* bugfix for draw_property_layer by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2639\r\n* Uses array for hex grid property layer fix by @Sahil-Chhoker in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2651\r\n* Update Binder environment to use latest Mesa version (#2652) by @aarav-shukla07 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2655\r\n* Change Hexgrid._connect_cells_2d to use x,y coordinates by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2632\r\n### 🔍 Examples updated\r\n* Added property layer viz to sugarscape by @sanika-n in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2653\r\n* added color-bar for spice by @sanika-n in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2622\r\n### 📜 Documentation improvements\r\n* remove any reference to using --pre by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2618\r\n* Updated Docs by @sanika-n in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2624\r\n* Fixed 404 error for Examples Tab in Introductory Tutorial (#2662) by @aarav-shukla07 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2664\r\n* Documentation by @Spartan-71 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2630\r\n* Adding a copy option at the top of the code written in the docs by @PrashantChoudhary13579 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2628\r\n* Adding Mesa Extension page by @PrashantChoudhary13579 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2627\r\n### 🔧 Maintenance\r\n* remove remnants of mesa cli by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2617\r\n* benchmarks.yml: Install SciPy and use uv for pip install by @EwoutH in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2633\r\n* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2659\r\n\r\n## New Contributors\r\n* @PrashantChoudhary13579 made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2628\r\n* @aarav-shukla07 made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2655\r\n* @peter-kinger made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2605\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.1.3...v3.1.4","2025-02-09T18:20:20",{"id":242,"version":243,"summary_zh":244,"released_at":245},294542,"v3.1.3","## Highlights\r\nMesa 3.1.3 introduces a major experimental reimplementation of Mesa's continuous space, providing an intuitive agent-centric API and significant performance improvements. The new implementation supports n-dimensional spaces and offers streamlined methods for agent movement and neighbor calculations.\r\n\r\n### New Continuous Space Features\r\n- Agent-centric movement API similar to cell spaces\r\n- Efficient neighbor calculations and position updates\r\n- Support for n-dimensional spaces\r\n- Improved memory management with dynamic array resizing\r\n\r\nHere's a quick look at the new API:\r\n\r\n```python\r\n# Create a 2D continuous space\r\nspace = ContinuousSpace(\r\n    dimensions=[[0, 1], [0, 1]],\r\n    torus=True,\r\n    random=model.random\r\n)\r\n\r\n# Create and position an agent\r\nagent = ContinuousSpaceAgent(space, model)\r\nagent.position = [0.5, 0.5]\r\n\r\n# Move agent using vector arithmetic\r\nagent.position += [0.1, 0.1]\r\n\r\n# Get neighbors within radius\r\nneighbors, distances = agent.get_neighbors_in_radius(radius=0.2)\r\n\r\n# Find k nearest neighbors\r\nnearest, distances = agent.get_nearest_neighbors(k=5)\r\n```\r\n\r\nThe new implementation particularly benefits models requiring frequent position updates and neighbor queries, such as flocking simulations or particle systems. See PR [#2584](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2584) and the [API documentation](https:\u002F\u002Fmesa.readthedocs.io\u002Flatest\u002Fapis\u002Fexperimental.html#module-experimental.continuous_space.continuous_space) for more details. We would love to get feedback on the new Continuous Space in [#2611](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fdiscussions\u002F2611).\r\n\r\nOther improvements in this release include consistent visualization behavior across space types with the reimplementation of `draw_voronoi` [#2608](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2608), and a new render interval slider for controlling visualization update frequency in SolaraViz, which helps improve performance when working with complex visualizations [#2596](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2596). We've also fixed a bug affecting random number generation determinism when using `Model(seed=something)`, ensuring both `model.random` and `model.rng` now behave consistently when seeded with the same initial value [#2598](https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2598).\r\n\r\n## What's Changed\r\n### 🧪 Experimental features\r\n* Reimplementation of Continuous Space by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2584\r\n### 🛠 Enhancements made\r\n* reimplementation of draw_voroinoi by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2608\r\n* Add render interval slider to control visualization update frequency by @HMNS19 in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2596\r\n### 🐛 Bugs fixed\r\n* Bugfix for non deterministic rng behavior by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2598\r\n### 🔍 Examples updated\r\n* Clarify ContinuousSpace.get_neighbors behavior with multiple agents at same position by @quaquel in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2599\r\n\r\n## New Contributors\r\n* @HMNS19 made their first contribution in https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fpull\u002F2596\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Fprojectmesa\u002Fmesa\u002Fcompare\u002Fv3.1.2...v3.1.3","2025-01-11T15:59:34"]