代理模型(ABM)是一种自下而上的建模方法,其中系统中的每个实体均被唯一地表示为一个独立决策的代理。大规模的涌现行为在ABM中对种群规模敏感。因此,模拟中的代理数量应能反映所建模系统的实际情况,某些领域中可能达到数百万甚至数十亿个体。在商品化多核处理器上实现可接受扩展性的自然解决方案是将模型分解,使每个组件能够由不同线程并发独立处理。本文提出了一种多线程Java实现的PPHPC ABM,旨在实现两个目标:1)将该实现的性能与现有的NetLogo实现进行比较;2)研究不同并行化策略在共享内存架构上的模拟性能影响。结果表明:1)模型并行化可带来显著的性能提升;2)不同的并行化策略在性能与模拟可重现性方面存在特定权衡;3)PPHPC是一个有效的参考模型,可用于从性能和统计准确性角度比较不同实现或并行化策略。
Agent-based modeling (ABM) is a bottom-up modeling approach, where each entity of the system being modeled is uniquely represented as an independent decision-making agent. Large scale emergent behavior in ABMs is population sensitive. As such, the number of agents in a simulation should be able to reflect the reality of the system being modeled, which can be in the order of millions or billions of individuals in certain domains. A natural solution to reach acceptable scalability in commodity multi-core processors consists of decomposing models such that each component can be independently processed by a different thread in a concurrent manner. In this paper we present a multithreaded Java implementation of the PPHPC ABM, with two goals in mind: 1) compare the performance of this implementation with an existing NetLogo implementation; and, 2) study how different parallelization strategies impact simulation performance on a shared memory architecture. Results show that: 1) model parallelization can yield considerable performance gains; 2) distinct parallelization strategies offer specific trade-offs in terms of performance and simulation reproducibility; and, 3) PPHPC is a valid reference model for comparing distinct implementations or parallelization strategies, from both performance and statistical accuracy perspectives.