Agent-based modeling (ABM) is a principal approach for studying complex systems. By decomposing a system into simpler, interacting agents, agent-based modeling (ABM) allows researchers to observe the emergence of complex phenomena. High-performance array computing libraries like JAX can help scale such computational models to a large number of agents by using automatic vectorization and just-in-time (JIT) compilation. One of the caveats of using JAX to achieve such scaling is that the shapes of arrays used in the computational model should remain immutable throughout the simulation. In the context of agent-based modeling (ABM), this can pose constraints on certain agent manipulation operations that require flexible data structures. A subset of which is represented by the ability to update a dynamically selected number of agents by applying distinct changes to them during a simulation. To this effect, we introduce ABMax, an ABM framework based on JAX that implements multiple just-in-time (JIT) compilable algorithms to provide this functionality. On the canonical predation model benchmark, ABMax achieves runtime performance comparable to state-of-the-art implementations. Further, we show that this functionality can also be vectorized, making it possible to run many similar agent-based models in parallel. We also present two examples in the form of a traffic-flow model and a financial market model to show the use case of ABMax
翻译:智能体建模(ABM)是研究复杂系统的主要方法。通过将系统分解为更简单、相互作用的智能体,智能体建模(ABM)使研究人员能够观察复杂现象的出现。像JAX这样的高性能数组计算库可以通过自动向量化和即时(JIT)编译帮助将此类计算模型扩展到大量智能体。使用JAX实现这种扩展的一个注意事项是,计算模型中使用的数组形状在整个模拟过程中应保持不变。在智能体建模(ABM)的背景下,这可能对某些需要灵活数据结构的智能体操作施加限制。其中一个子集表现为能够在模拟期间对动态选定数量的智能体应用不同的更改来更新它们。为此,我们介绍了ABMax,这是一个基于JAX的ABM框架,它实现了多种可即时(JIT)编译的算法以提供此功能。在经典的捕食模型基准测试中,ABMax实现了与最先进实现相当的运行时性能。此外,我们展示了此功能也可以被向量化,从而可以并行运行许多类似的智能体模型。我们还以交通流模型和金融市场模型的形式提供了两个示例,以展示ABMax的用例。