AMBER:一种用于Python中高性能基于代理建模的列式架构
AMBER: A Columnar Architecture for High-Performance Agent-Based Modeling in Python
AI总结:
本文提出AMBER,一种基于列式存储的Python框架,通过紧凑的视图API暴露种群操作,以减少解释器开销,从而提高交互式建模、校准和参数扫描的性能。
摘要:
Python广泛用于基于代理的建模,因为它易于使用且具有成熟的科学生态系统,但每个代理执行对象会带来解释器开销,限制了交互式建模、校准和参数扫描中可行的种群规模。本文提出了AMBER,一种Python框架,将代理状态存储在基于Polars的列式表中,并通过紧凑的视图API暴露种群操作。该框架保留了传统的模型和代理抽象,同时将常见的种群更新转换为编译的列操作;无法向量化的行为仍可通过缓冲的面向对象路径表达。我们评估了AMBER在财富转移、随机游走和空间SIR基准测试中,与Mesa、AgentPy、SimPy、Melodie、Agents.jl和AMBER自身循环路径的性能对比,使用不变性检查验证可比的模型输出。在所有测试的工作负载中,AMBER在Python托管实现中具有最低的执行时间,并在Mesa上实现了高达1118倍的速度提升;在最大的SIR基准测试中,它也比基于Julia的Agents.jl实现更快。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。