Agent-based modeling (ABM) has emerged as an indispensable methodology for studying complex adaptive systems across the natural and social sciences. However, Python-based ABM frameworks face a fundamental tension between the accessibility that has made Python dominant in scientific computing and the performance requirements of large-scale simulations. This paper introduces AMBER, a framework that resolves this tension through a novel architectural approach: replacing the conventional object-per-agent representation with columnar state management using the Polars DataFrame library. We analyze the computational characteristics of both paradigms, present the architectural design of AMBER including its core abstractions, spatial environments, experiment management, and optimization capabilities. Empirical evaluation on three canonical benchmarks demonstrates that AMBER achieves speedups of 1.2x to 93x depending on workload characteristics, with the greatest advantages for models dominated by population-wide attribute operations. Memory profiling reveals 30-50% reduction in peak usage compared to object-oriented frameworks. Our results establish columnar state management as a viable architectural foundation for high-performance ABM in interpreted languages.
翻译:基于智能体建模(ABM)已成为研究自然科学和社会科学中复杂适应系统不可或缺的方法。然而,基于Python的ABM框架面临一个根本性矛盾:一方面是使Python在科学计算中占据主导地位的可访问性,另一方面是大规模仿真的性能需求。本文介绍了AMBER,这是一个通过新颖的架构方法解决这一矛盾的框架:利用Polars DataFrame库进行列式状态管理,取代了传统的基于对象-智能体的表示方式。我们分析了两种范式的计算特性,阐述了AMBER的架构设计,包括其核心抽象、空间环境、实验管理和优化能力。在三个经典基准测试上的实证评估表明,根据工作负载特性,AMBER实现了1.2倍至93倍的加速,其中在群体范围属性操作占主导的模型中优势最为显著。内存分析显示,与面向对象框架相比,峰值使用量减少了30-50%。我们的研究结果确立了列式状态管理作为解释型语言中高性能ABM的可行架构基础。