SIR Infection Network
This is an SIR (susceptible-infected-recovered) infection model with agents connected on a network. It is based on the paper "An Agent-Based Model of COVID-19", C. Wolfram.
Description

This is an SIR (susceptible-infected-recovered) infection model with agents connected on a network. It is based on the paper "An Agent-Based Model of COVID-19", C. Wolfram.

The model

The network is constructed according to the Watts-Strogatz algorithm. This algorithm produces "small-world" networks with high clustering. The parameters num_agents, avg_degree and beta control the number of nodes in the network, the average number of edges between nodes, and the randomness of edges, respectively.

Agents may have one of three statuses: susceptible, infected or recovered. Agents with status susceptible may become infected by interacting with one of their infected neighbors. Infected agents eventually recover. Recovered agents cannot become infected again.

The network is initialized with a certain number of infected agents, controlled by the initial_num_infected parameter. Each agent has their own recovery time sampled from an exponential distribution with mean avg_recovery_time.

At each time step agents may meet with a number of their connected neighbors. This number is sampled from an exponential distribution with mean avg_meetings.

Visualization

The plot shows the number of susceptible, infected and recovered agents over time.

Observations

  • The number of infected agents tends to grow, reaching a peak which is lagged by the number of recovered agents, until finally there are no infected agents.
  • After the average number of meetings per time step passes a certain point, the model undergoes a phase transition where almost all of the agents become infected. Before this point, the number of interactions is low enough where most of the susceptible agents never become infected. A similar phenomenon may be observed by increasing the average degree of the network.

Extending the model

Here are a few enhancements that could be made to the model

  • Not all infections have long-lasting immunity. Extend the model by allowing some of the recovered agents to become infected again.
  • Heterogeneity in meeting rates. Currently, all agents share the same distribution for the number of interactions at each time step. Extend the model by giving each agent their own distribution. Similarly, one could simulate the effect of quarantines by restricting the ability of some agents to have any interactions.
  • Try different network models, such as the scale-free Barabási–Albert model or the Erdős–Rényi model.