Python is widely used for agent-based modelling because it is accessible and has a mature scientific ecosystem, but object-per-agent execution incurs interpreter overhead that restricts the population sizes feasible in interactive modelling, calibration, and parameter sweeps. This paper presents AMBER, a Python framework that stores agent state in a Polars-backed columnar table and exposes population operations through a compact view API. The framework preserves conventional model and agent abstractions while translating common population updates into compiled column operations; behaviours that do not vectorise remain expressible through a buffered object-oriented path. We evaluate AMBER on wealth transfer, random walk, and spatial SIR benchmarks against Mesa, AgentPy, SimPy, Melodie, Agents.jl, and AMBER's own loop path, using invariant checks to verify comparable model outputs before timing. Across the tested workloads, AMBER has the lowest execution time among Python-hosted implementations and achieves speedups of up to $1118\times$ over Mesa; on the largest SIR benchmark it is also faster than the Julia-based Agents.jl implementation.


翻译:Python因其易用性和成熟的科学计算生态而被广泛用于智能体建模,但基于对象-智能体的执行方式会产生解释器开销,从而限制了交互式建模、校准和参数扫描中可行的种群规模。本文提出AMBER,一种Python框架,它将智能体状态存储在基于Polars的列式表中,并通过紧凑的视图API暴露种群操作。该框架在保留传统模型和智能体抽象的同时,将常见种群更新转化为编译后的列操作;无法向量化的行为仍可通过缓冲的面向对象路径表达。我们在财富转移、随机游走和空间SIR基准测试中,将AMBER与Mesa、AgentPy、SimPy、Melodie、Agents.jl以及AMBER自身的循环路径进行对比评估,通过不变性检验验证模型输出可比性后计时。在测试工作负载下,AMBER在所有Python实现的方案中执行时间最低,且相比Mesa实现高达1118倍的加速比;在最大规模的SIR基准测试中,其速度甚至优于基于Julia的Agents.jl实现。

0
下载
关闭预览

相关内容

Python是一种面向对象的解释型计算机程序设计语言,在设计中注重代码的可读性,同时也是一种功能强大的通用型语言。
AI 智能体系统:体系架构、应用场景及评估范式
设计和构建强大的大语言模型智能体
专知会员服务
56+阅读 · 2024年10月6日
Github项目推荐 | gensim - Python中的主题建模
AI研习社
15+阅读 · 2019年3月16日
基于python的开源量化交易,量化投资架构
运维帮
15+阅读 · 2018年7月5日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
国家自然科学基金
12+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
国家自然科学基金
19+阅读 · 2008年12月31日
Arxiv
0+阅读 · 5月22日
VIP会员
最新内容
俄罗斯如何拦截乌克兰无人机与巡航导弹
专知会员服务
8+阅读 · 10月15日
《武器-目标分配问题:精确与近似求解算法》
专知会员服务
11+阅读 · 10月15日
综述|谁来改进机器人?迈向物理递归自我改进
专知会员服务
10+阅读 · 10月14日
软件定义无人机蜂群给防空带来全新压力
专知会员服务
10+阅读 · 10月13日
《半自主无人地面战车的互操作性》66页
专知会员服务
14+阅读 · 10月13日
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
国家自然科学基金
12+阅读 · 2012年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
国家自然科学基金
19+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员