Message Boards Message Boards


[NB] Agent based epidemic simulation

Posted 1 year ago
5 Replies
13 Total Likes

MODERATOR NOTE: coronavirus resources & updates:

enter image description here

Inspired by the model at Washington Post the following computational essay creates and visualizes an agent-based simulation of epidemic spread in a small community. The rules that control the agent's behaviour can be easily modified or extended.

The basic assumptions are that agents move freely and without purpose within a square space. If a vulnerable agent is touched by an infected agent, they immediately become infectious for a fixed period of time and before becoming permanently immune to the disease. Agents do not interact with each other in any other way.

5 Replies


I really like the clean coding style you have adopted here. The use of agents identified as Associations with updated properties and an updating rule is one that can be modified for a wide range of stochastic problems with a large number of parameters. I used agent models for economics and finance back in the 90's. Whenever I tried to model neoliberal economic models as advocated by the Chicago School of economics, I found that they only ever worked if you assumed everything worked perfectly like your experiment No 2 with immediate 100% isolation and that everyone in the market had perfect knowledge of prices. Such situations only arose about one in every 100,000 experiments. Journals were not interested in such experiments, especially since corporations owned the journals. Strange how that happens.


Posted 11 months ago

Human interactions and ensuing transmission, are not described by randomly colliding balls. They involved scheduled and random social contacts, and their spatial and temporal organization are paramount.

Of course. This was meant to be a simple model and the illustration of an approach.

By adding many more property keys (each persons social calendar, spatial environment, type of current activity etc) and more complex update rules (going to places in the caledar, calculating the type of contact based on each agents current location and activity) one could model that.

Though performance will likely become a consideration.

David The agent based simulations described above are not random. They take into account the known data to represent features such as the rate of infection, isolation, recovery and immunity. See for instance the variables included in the function runExperiment.


Posted 11 months ago

Those features are relevant to disease progress, of course, and for some interventions. But my key reservation concerns the nature (patterns, types) of social mixing. Randomness could play some role (people may bump into each other 'randomly', once in a while). But large part of interactions are structured, along the lines mentioned by Jon. One example is Christopher Wolfram model, based on social network structure. We are working on IBM with structured social mixing that goes beyond networks, and we are planning to post it soon.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract