Programming Language Considerations for Agent-Based Economic Modelling
This thesis evaluates Python, Julia, and C++ for high-performance Agent-Based Economic Modelling (ABEM). By implementing and benchmarking a labor market simulation, it identifies the optimal programming languages and software architectures to overcome critical scalability bottlenecks.
Ackermann, Mael, 2026
Art der Arbeit Bachelor Thesis
Auftraggebende University of Applied Sciences and Arts Northwestern Switzerland
Betreuende Dozierende Christen, Patrik
Views: 2
Traditional macroeconomic models rely on perfect rationality and static equilibrium shortcuts, failing to capture complex, bottom-up emergent phenomena. Agent-Based Economic Models (ABEMs) resolve this by simulating millions of heterogeneous, boundedly rational agents. However, executing these simulations introduces massive computational bottlenecks. While Python is highly accessible, its execution speed is limited. C++ offers raw performance but high development complexity, leaving a critical need to evaluate Julia's potential to solve this "two-language problem".
This work combines a systematic literature review of HPC paradigms with quantitative benchmarking. A synthetic Labor ABM, inspired by Oxford INET and Axtell & Farmer, was implemented in C++ and Julia. To isolate language efficiency, the benchmark simulated 100,000 workers and 2,000 firms over 110 steps on an Intel i7-7700K. Crucially, the core hiring and firing algorithm was redesigned, reducing its mathematical complexity from O(Nfirms × Nindividuals) to a highly efficient, flattened O(Nfirms + Nindividuals) model.
The algorithmic optimisation achieved a five-fold performance improvement, slashing execution times from ~3.5 to ~0.7 seconds for 100,000 agents. Single-threaded benchmarks reveal that C++ maintains a slight edge over Julia (0.626s vs 0.765s), a performance gap that widens at a scale of 1,000,000 agents (106.56s vs 154.28s). For the client (IWI FHNW), this thesis delivers three core benefits. First, it provides a structured evaluation framework that guides the selection of languages for large-scale economic simulations. Second, it demonstrates that Julia successfully resolves the "two-language problem", combining Python-like development speed with near-C++ execution speed, thereby accelerating model prototyping and policy testing. Third, it proves that architectural and memory-conscious optimisations, enhance resource utilisation. The complete codebase, benchmarking suites, and plotting assets are openly accessible at: https://github.com/maelackermann/ABEM_experiments.
Studiengang: Business Information Technology (Bachelor)
Keywords Agent Based Models, Complexity Economics, HPC, Julia, C++, Python, ECS
Vertraulichkeit: öffentlich