Tag Archives: modularity

Towards an Agent-based Platform for Crisis Management

By Christian Kammler1, Maarten Jensen1, Rajith Vidanaarachchi2 Cezara Păstrăv1

  1. Department of Computer Science, Umeå University, Sweden
    Transport, Health, and Urban Design (THUD)
  2. Research Lab, The University of Melbourne, Australia

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” — John Woods

1       Introduction

Agent-based modelling can be a valuable tool for gaining insight into crises [3], both, during and before to increase resilience. However, in the current state of the art, the models have to build up from scratch which is not well suitable for a crisis situation as it hinders quick responses. Consequently, the models do not play the central supportive role that they could. Not only is it hard to compare existing models (given the absence of existing standards) and asses their quality, but also the most widespread toolkits, such as Netlogo [6], MESA (Python) [4], Repast (Java) [1,5], or Agents.jl (Julia) [2], are specific for the modelling field and lack the platform support necessary to empower policy makers to use the model (see Figure 1).

Fig. 1. Platform in the middle as a connector between the code and the model and interaction point for the user. It must not require any expert knowledge.

While some of these issues are systemic within the field of ABM (Agent-Based Modelling) itself, we aim to alleviate some of them in this particular context by using a platform purpose-built for developing and using ABM in a crisis. To do so, we view the problem through a multi-dimensional space which is as follows (consisting of the dimensions A-F):

  • A: Back-end to front-end interactivity
  • B: User and stakeholder levels
    – Social simulators to domain experts to policymakers
    – Skills and expertise in coding, modelling and manipulating a model
  • C: Crisis levels (Risk, Crisis, Resilience – also identified as – Pre Crisis, In Crisis, Post Crisis)
  • D: Language specific to language independent
  • E: Domain specific to domain-independent (e.g.: flooding, pandemic, climate change, )
  • F: Required iteration level (Instant, rapid, slow)

A platform can now be viewed as a vector within this space. While all of these axes require in-depth research (for example in terms of correlation or where existing platforms fit), we chose to focus on the functionalities we believe would be the most relevant in ABM for crises.

2       Rapid Development

During a crisis, time is compressed, and fast iterations are necessary (mainly focusing on axes C and F), making instant and rapid/fast iterations necessary while slow iterations are not suitable. As the crisis develops, the model may need to be adjusted to quickly absorb new data, actors, events, and response strategies, leading to new scenarios that need to be modelled and simulated. In this environment, models need to be built with reusability and rapid versioning in mind from the beginning, otherwise every new change makes the model more unstable and less trustworthy.

While a suite of best practices exists in general Software Development, they are not widely used in the agent-based modelling community. The platform needs a coding environment that favors modular reusable code, easy storage and sharing of such modules in well-organized libraries and makes it easy to integrate existing modules with new code.

Having this modularity is not only helping with the right side of Figure 1, we can also use it to help with the left side of the Figure at the same time. Meaning that the conceptual model can be part of the respective module, allowing to quickly determine if a module is relevant and understanding what the module is doing. Furthermore, it can be used to create a top-level drag and drop like model building environment to allow for rapid changes without having to write code (given that we take of the interface properly).

Having the code and the conceptual model together would also lower the effort required to review these modules. The platform can further help with this task by keeping track of which modules have been reviewed, and with versioning of the modules, as they can be annotated accordingly. It has to be noted however,

that such as system does not guarantee a trustworthy model, even though it might be up to date in terms of versioning.

3       Model transparency

Another key factor we want to focus on is the stakeholder dimension (axis B). These people are not experts in terms of models, mainly the left side of Figure 1, and thus need extensive support to be empowered to use the simulation in a – for them  – meaningful  way. While for  the visualization side  (the how? )  we can use insights from Data Visualization, for the why side it is not that easy.

In a crisis, it is crucial to quickly determine why the model behaves in a certain way in order to interpret the results. Here, the platform can help by offering tools to build model narratives (at agent, group, or whole population level), to detect events and trends, and to compare model behavior between runs. We can take inspiration from the larger software development field for a few useful ideas on how to visually track model elements, log the behavior of model elements, or raise flags when certain conditions or events are detected. However, we also have to be careful here, as we easily move towards the technical solution side and away from the stakeholder and policy maker. Therefore, more research has to be done on what support policy makers actually need. An avenue here can be techniques from data story-telling.

4       The way forward

What this platform will look like depends on the approaches we take going forward. We think that the following two questions are central (also to prompt further research):

  1. What are relevant roles that can be identified for a platform?
  2. Given a role for the platform, where should it exist within the space de- scribed, and what attributes/characteristics should it have?

While these questions are key to identify whether or not existing platforms can be extended and shaped in the way we need them or if we need to build a sandbox from scratch, we strongly advocate or an open source approach. An open source approach can not only help to allow for the use of the range of expertise spread across the field, but also alleviate some of the trust challenges. One of the main challenges is that  a  trustworthy,  well-curated  model  base with different modules does not yet exist. As such, the platform should aim first to aid in building this shared resource and add more related functionality as it becomes relevant. As for model tracking tools, we should aim for simple tools first and build more complex functionality on top of them later.

A starting point can be to build modules for existing crises, such as earth- quakes or floods where it is possible to pre-identify most of the modelling needs, the level of stakeholder engagement, the level of policymaker engagement, etc.

With this we can establish the process of open-source modelling and learn how to integrate new knowledge quickly, and be potentially better prepared for unknown crises in the future.

Acknowledgements

This piece is a result of discussions at the Lorentz workshop on “Agent Based Simulations for Societal Resilience in Crisis Situations” at Leiden, NL in earlier this year! We are grateful to the organisers of the workshop and to the Lorentz Center as funders and hosts for such a productive enterprise.

References

  1. Collier, N., North, M.: Parallel agent-based simulation with repast for high per- formance computing. SIMULATION 89(10), 1215–1235 (2013), https://doi.org/10. 1177/0037549712462620
  2. Datseris, G., Vahdati, A.R., DuBois, T.C.: Agents.jl: a performant and feature-full agent-based modeling software of minimal code complexity. SIMULATION 0(0), 003754972110688 (2022), https://doi.org/10.1177/00375497211068820
  3. Dignum, F. (ed.): Social Simulation for a Crisis: Results and Lessons from Simulating the COVID-19 Crisis. Springer International Publishing, Cham (2021)
  4. Kazil, J., Masad, D., Crooks, A.: Utilizing python for agent-based modeling: The mesa framework. In: Thomson, R., Bisgin, H., Dancy, C., Hyder, A., Hussain, M. (eds.) Social, Cultural, and Behavioral Modeling. pp. 308–317. Springer Interna- tional Publishing, Cham (2020)
  5. North, M.J., Collier, N.T., Ozik, J., Tatara, E.R., Macal, C.M., Bragen, M., Sydelko, P.: Complex adaptive systems modeling with Repast Simphony. Complex Adaptive Systems Modeling 1(1), 3 (March 2013), https://doi.org/10.1186/2194-3206-1-3
  6. Wilensky, U.: Netlogo. http://ccl.northwestern.edu/netlogo/, Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL (1999), http://ccl.northwestern.edu/netlogo/

Kammler, C., Jensen, M., Vidanaarachchi, R. and Păstrăv, C. (2023) Towards an Agent-based Platform for Crisis Management. Review of Artificial Societies and Social Simulation, 10 May 2023. https://rofasss.org/2023/05/10/abm4cm


© The authors under the Creative Commons’ Attribution-NoDerivs (CC BY-ND) Licence (v4.0)

Designing social simulation to (seriously) support decision-making: COMOKIT, an agent-based modelling toolkit to analyse and compare the impacts of public health interventions against COVID-19

By Alexis Drogoul1, Patrick Taillandier2, Benoit Gaudou1,3, Marc Choisy4,8, Kevin Chapuis1,5,  Quang Nghi Huynh 1,6, Ngoc Doanh Nguyen1,7, Damien Philippon10, Arthur Brugière1, and Pierre Larmande8

1 UMI 209, UMMISCO, IRD, Sorbonne Université, Bondy, France. 2 UR 875, MIAT, INRAE, Toulouse University, Castanet Tolosan, France. 3 UMR 5505, IRIT, Université Toulouse 1 Capitole, Toulouse, France. 4 UMR 5290, MIVEGEC, IRD/CNRS/Univ. Montpellier, Montpellier, France. 5 UMR 228, ESPACE-DEV, IRD, Montpellier, France. 6 CICT, Can Tho University, Can Tho, Vietnam. 7 MSLab / WARM, Thuyloi University, Hanoi, Vietnam. 8 UMR 232, DIADE, IRD, Univ. Montpellier, Montpellier, France. 9 OUCRU, Centre for Tropical Medicine, Ho Chi Minh City, Viet Nam. 10 WHO Collaborating Centre for Infectious Disease Epidemiology and Control, School of Public Health, Li Ka Shing Faculty of Medicine, The University of Hong Kong, Hong Kong Special Administrative Region, China.

(A contribution to the: JASSS-Covid19-Thread)

In less than 4 months after its emergence in China, the COVID-19 pandemic has spread worldwide. In response to this health crisis, unprecedented in modern history, researchers have mobilized to produce knowledge and models in order to inform and support public decision-making, sometimes in real-time (Adam, D. 2020). However, the social modelling community is facing two challenges in this endeavour: the first one is its capacity to provide robust scientific knowledge and to translate it into evidences on concrete cases (and not only general principles) within a short time range; and the second one is to do it knowing (and anticipating the fact) that these evidences may have concrete social, economic or clinical impacts in the “real” world.

These two challenges require the design of realistic models that provide what B. Edmonds, in response to (Squazzoni & al. 2020), calls the “empirical grounding and validation needed to reliably support policy making” (Edmonds, 2020); in other words, spatially explicit, demographically realistic, data driven models that can be fed with both quantitative and qualitative (behavioural) data, and that can be easily experimented in huge numbers of scenarios so as to provide statistically sound results and evidences.

It is difficult to deny these requirements, but it is easier said than done. What we have witnessed, instead, these last 4 months, is an explosion of agent-based toy models representing, ad nauseam, the spread of the virus or similar dynamics within artificial populations without space, without behaviours, without friend nor family relations, without social networks, without even remotely realistic activities or mobility schemes; in short, populations of artificial agents devoid of everything that makes a human population slightly different from a mixture of homogeneous particles. How we, as a community, can claim to inform policy makers, in such a critical context, with such abstract and simplistic constructions is difficult to justify. Are public health decision makers really that interested, these days, in models that help them to understand the general principles, the inner mechanisms or hidden dynamics of this crisis? Or would they feel better supported if we could answer their questions on which interventions, at which place, at which spatial and temporal scale and on which populations, would have the best impact on the pandemic?

We tend to forget, however, that agent-based modelling (ABM), among other benefits, does not oppose these two objectives when building a model. And from the outset of the crisis, many of us were quick to advocate a modelling approach that would:

  • Be as close as possible to public decision making by having the possibility to answer to concrete, practical questions;
  • Be based on a detailed and realistic representation of space, as the spread of the epidemic is spatial and public health policies are also predominantly spatial (containment, social distancing, reduction of mobility, etc.);
  • Rely on spatial and social data that can be collected easily and, above all, quickly, and not be too dependent on the availability of large datasets (which may not be opened nor shared depending on the country of intervention);
  • Make it possible to represent as faithfully as possible the complexity of the social and ecological environments in which the pandemic is spreading;
  • Be generic, flexible and applicable to any case study, but also trustable as it relies on inner mechanisms that can be isolated and validated separately;
  • Be open and modular enough to support the cooperation of researchers across different disciplines while relying on rigorous scientific and computational principles;
  • Offer an easy access to large-scale experimentation and statistical validation by facilitating the exploration of its parameters;

This approach is currently being implemented by an interdisciplinary group of modellers, all signatories of this response, who have started to design and implement on the GAMA platform a generic model called COMOKIT, around which they now wish to gather the maximum number of modellers and researchers in epidemiology and social sciences. Being generic here means that COMOKIT is portable for almost any case study imaginable, from small towns to provinces or even countries, the only real limit to its application being the available RAM and computing power[1].

COMOKIT is an integrated model that, in its simplest incarnation, dynamically combines five sub-models:

  1. a sub-model of the individual clinical dynamics and epidemiological status of agents
  2. a sub-model of agent-to-agent direct transmission of the infection,
  3. a sub-model of environmental transmission through the built environment,
  4. a sub-model of policy design and implementation,
  5. an agenda-based model of people activities at a one-hour time step.

It allows, of course, to represent heterogeneity in individual characteristics (sex, age, household), agendas (depending on social structures, available services or age categories), social relationships and behaviours (e.g. respect of regulations).

COMOKIT has been designed as modular enough to allow modellers and users to represent different strategies and study their impacts in multiple scenarios. Using the experimental features provided by the underlying GAMA platform (Taillandier & al. 2019) (like advanced visualization, multi-simulation, batch experiments, easy large-scale explorations of parameters spaces on HPC infrastructures), it is made particularly easy and effective to compare the outcomes of these strategies. Modularity is also a key to facilitating its adoption by other modellers and users: COMOKIT is a basis that can be very easily extended (to new policies, people activities, actors, spatial features, etc.). For instance, more detailed socio-psychological models, like the ones described in ASSOCC (Ghorbani & al. 2020), could be interesting to test within realistic models. In that respect, COMOKIT is both a framework (for deriving new concrete models) and a model (that can be instantiated by itself on arbitrary datasets).

Finally, COMOKIT has been thought of as incrementally expandable: because of the urgency usually associated with its use, it can be instantiated on new case studies in a matter of minutes, by generating the built environment of an area and its synthetic population using a simple geolocalised boundary and reasonable defaults (which can of course be parametrized, or even, in the case of the population generation, be driven by a plugin called Gen* (Chapuis & al. 2018)). When more detailed data becomes available (about the population, peoples’ occupations, economic activities, public health policies, …) the same model can be fed with it in order to refine its initial outcomes.

 A screenshot of the experiments’ UI in COMOKIT

Figure 1. A screenshot of the experiments’ UI in COMOKIT: six scenarios of partial confinement are being compared with respect to the number of cases during and after a 3 months-long period. Son Loi case study, 9988 inhabitants from the 2019 Vietnamese census.

Up to now, COMOKIT has been implemented and evaluated on two cases of city confinement in Vietnam (i.e. Son Loi (Thanh & al. 2020) and Thua Duc). In these cases, which have served as testbeds to verify the correctness of the individual sub-models and their interactions, we have compared the impacts of a number of social-distancing strategies (e.g. with a ratio of the population allowed to move outside, for various durations, to various geographical extents, by activities, and so on), and other non-pharmaceutical interventions such as advising the population to wear masks, or closing the schools and public places. These studies have shown in particular that the process of ending an intervention is as much impactful as the process of starting it, in particular to avoid a second epidemic wave

We need you: social scientists, epidemiologists, modellers, computer scientists, web designers…

As the epidemic moves to countries with more limited health infrastructure and economic space, it becomes critical to devise, test and compare original public interventions that are adapted to these constraints, for instance interventions that would be more geographically and socially targeted than an entire lockdown of the whole population. COMOKIT, which is used since the beginning of April 2020 within the Rapid Response Team of the Steering Committee against COVID-19 of the Ministry of Health in Vietnam, can become an invaluable help in this endeavour. However, it must become even more realistic, reliable and robust than it is at present, so that decision-makers can build a relationship of trust with this new tool and hopefully with agent-based modelling in general.

All the documentation (with a complete ODD description and UML diagrams), commented source code (of the models and utilities), as well as five example datasets, are made available on the project’s webpage and Github repository to be shared, reused and adapted to other case studies. We strongly encourage anyone interested to try COMOKIT, apply it on their own case studies, improve it by adding new policies, activities, agents or scenarios, and share their studies, proposals, and results. Any help will be appreciated to show that we can collectively contribute, as a community, to the fight against this pandemic (and maybe the next ones): analysing the sub-models, documenting them, proposing access to data, fixing bugs, adding new sub-models, testing their integration, proposing HPC infrastructures to run large-scale experiments, everything can be helpful!

Notes

[1] To give a very rough idea, it takes approximately 15mn and 800Mb of RAM on one core of a laptop to simulate 6 months of a town of 10.000 inhabitants, at a 1-hour step, while displaying a 3D view and charts.

References

Adam, D. (2020). Special report: The simulations driving the world’s response to COVID-19. Nature. doi:10.1038/d41586-020-01003-6

Chapuis, K., Taillandier, P., Renaud, M., & Drogoul, A. (2018). Gen*: a generic toolkit to generate spatially explicit synthetic populations. International Journal of Geographical Information Science, 32(6), 1194-1210. doi:10.1080/13658816.2018.1440563

Edmonds, B. (2020) Good Modelling Takes a Lot of Time and Many Eyes. Review of Artificial Societies and Social Simulation, 13rd April 2020. https://rofasss.org/2020/04/13/a-lot-of-time-and-many-eyes/

Ghorbani, A., Lorig, F., de Bruin, B., Davidsson, P., Dignum, F., Dignum, V., van der Hurk, M., Jensen, M., Kammler, C., Kreulen, K., Ludescher, L. G., Melchior, A., Mellema, R., Păstrăv, C., Vanhée, L. and Verhagen, H. (2020) The ASSOCC Simulation Model: A Response to the Community Call for the COVID-19 Pandemic. Review of Artificial Societies and Social Simulation, 25th April 2020. https://rofasss.org/2020/04/25/the-assocc-simulation-model/

Squazzoni, F., Polhill, J. G., Edmonds, B., Ahrweiler, P., Antosz, P., Scholz, G., Chappin, É., Borit, M., Verhagen, H., Giardini, F. and Gilbert, N. (2020) Computational Models That Matter During a Global Pandemic Outbreak: A Call to Action. Journal of Artificial Societies and Social Simulation, 23(2):10. <http://jasss.soc.surrey.ac.uk/23/2/10.html>. doi: 10.18564/jasss.4298

Taillandier, P., Gaudou, P. Grignard, A. Huynh, Q.N., Marilleau, N., Caillou, P., Philippon, D., Drogoul, A. (2019) Building, Composing and Experimenting Complex Spatial Models with the GAMA Platform. GeoInformatica 23, 299-322. doi:10.1007/s10707-018-00339-6

Thanh, H. N., Van, T. N., Thu, H. N. T., Van, B. N., Thanh, B. D., Thu, H. P. T., … & Nguyen, T. A. (2020). Outbreak investigation for COVID-19 in northern Vietnam. The Lancet Infectious Diseases. DOI:10.1016/S1473-3099(20)30159-6


Drogoul, A., Taillandier, P., Gaudou, B., Choisy, M., Chapuis, K., Huynh, N. Q. , Nguyen, N. D., Philippon, D., Brugière, A., and Larmande, P. (2020) Designing social simulation to (seriously) support decision-making: COMOKIT, an agent-based modelling toolkit to analyze and compare the impacts of public health interventions against COVID-19 . Review of Artificial Societies and Social Simulation, 27th April 2020. https://rofasss.org/2020/04/27/comokit/


© The authors under the Creative Commons’ Attribution-NoDerivs (CC BY-ND) Licence (v4.0)