CppyABM: An open‐source agent‐based modeling library to integrate C++ and Python
Agent‐based modeling (ABM) has been extensively used to study the collective behavior of systems emerging from the interaction of numerous independent individuals called agents. Python and C++ are commonly used for ABM thanks to their unique features; the latter offers superior performance while the...
Saved in:
Published in | Software, practice & experience Vol. 52; no. 6; pp. 1337 - 1351 |
---|---|
Main Authors | , , |
Format | Journal Article |
Language | English |
Published |
Hoboken, USA
John Wiley & Sons, Inc
01.06.2022
Wiley Subscription Services, Inc |
Subjects | |
Online Access | Get full text |
Cover
Loading…
Summary: | Agent‐based modeling (ABM) has been extensively used to study the collective behavior of systems emerging from the interaction of numerous independent individuals called agents. Python and C++ are commonly used for ABM thanks to their unique features; the latter offers superior performance while the former provides ease‐of‐use and rich libraries in data science, visualization, and machine learning. We present the framework CppyABM that unifies these features by providing identical ABM semantic and development styles in both C++ and Python as well as the essential binding tools to expose a certain functionality from C++ to Python. The binding feature allows users to tailor and further extend a type or function within Python while it is originally defined in C++. Using CppyABM, users can choose either C++ or Python depending on their expertise and the specialty of the model or combine them to benefit from the advantages of both languages simultaneously. We provide showcases of CppyABM capabilities using several examples in computational biology, ecology, and virology. These examples are implemented in different formats using either C++ or Python or a combination of both to provide a comparison between the performance of implementation scenarios. The results of the example show a clear performance advantage of the models entirely or partly implemented in C++ compared to purely Python‐based implementations. |
---|---|
Bibliography: | Funding information Correction added on 13 January 2022, after first online publication: Figure citations in section 3.2.1 and in the last sentence of section 3.2.1 have been corrected in this version Helmholtz Zentrum Hereon |
ISSN: | 0038-0644 1097-024X |
DOI: | 10.1002/spe.3067 |