This work was developed as part of the Scottish Government Data Science Accelerator Programme.
Agent-based models represent a "bottom-up" modelling paradigm, where systems of interest are studied by simulating the behaviours and actions of their lowest level actors (e.g. individual people), letting the system evolve, and recording the results. This type of modelling can naturally include complex emergent phenomena, societal trends, and heterogeneous spatial constraints in a way that is difficult, or impossible, to achieve otherwise.
Despite many readily applicable advantages and use-cases, agent-based modelling is currently somewhat underused in the public health domain.
This project aimed to develop proof-of-concept agent-based models in Julia (primarily using Agents.jl) with direct application to the spread of infectious diseases, but also to gain general expertise in agent-based techniques/libraries and the Julia language, while producing useful reference code/simulations.
Instructions for setting up Julia, the general layout of this repository, and running code on your own computer can be found here.
An interactive Jupyter notebook showing the difference between differential equation disease modelling, and the agent-based equivalent can be found here:
(alternatively this notebook can be run locally)
A Pluto version of this notebook can be run locally via this script -- this is similar in content to the Jupyter notebook, but with more interactive components. Most of the Julia code is also hidden from the user to present a more "blog-like" experience.
To demonstrate the sort of specific problem agent-based models are uniquely suited to, a simplified real-life disease transmission scenario was simulated using an office floor plan. Individuals are free to move around the office and walk to e.g. the kitchen, bathroom, exit (or simply stay at their desk), and potentially pass on their infection.
As the agent-based model can capture both when and where people become infected, it's possible to construct an infection heatmap for this specific space.
This can then be used to inform decision making about the layout of the space, and what effect people's behaviour can have on disease transmission in the area -- e.g. if we cut off access to the kitchen area, we see the infection hot-spot shifts to the exit instead.
Different simulations can be run with e.g. different desk layouts, different numbers of people, one-way walking systems, staggered entry and exit times for staff and so on, to assess their respective impact.