There is an error in Pseudocode 1, and 2, where a line was omitted after line 46 (in 1), 61 (in 2). The following line was omitted:
tau - = xi*Lambda //subtract remainder of time-step
Pseudocode 1. Pseudocode for an SIR process with constant and homogeneous transition rates.

C++ code for homogeneous and heterogeneous populations is given in S1 Files.
Pseudocode 2. Pseudocode for a non-Markovian SIR process with non-constant recovery rates.
The function mu returns the instantaneous recovery rate as function of (t–t*); for Weibull distributed recovery times, mu is given by Eq. (23). C++ code is given in S1 Files.
This change in the pseudocode results in changes to supporting information S1, S2 and S3 Figs. The corrected supporting information figures are:
Supporting information
(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−2 and μΔt = 10−4; (C),(D),(G), and (H) for βΔt = 10−1 and μΔt = 10−3. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on a face-to-face contact network recorded in a high school (Table 1).
(PDF)
(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−1 and μΔt = 10−3; (C),(D),(G), and (H) for βΔt = 1 and μΔt = 10−2. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active.
(PDF)
(A),(C) Mean number of nodes in each state as function of time in the SIR model with Weibull distributed recovery times (Sec. 6: “Non-Markovian processes”); the parameter controlling the precision of the temporal Gillespie algorithm was set to ϵ = 0 (quasi-exact). (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0). (A),(B) βΔt = 10−2 and μΔt = 10−4; (C),(D) βΔt = 10−1 and μΔt = 10−3. The outcome of the rejection sampling algorithm approaches that of the temporal Gillespie algorithm as βΔt and μΔt become smaller. All simulations were performed 100 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active. Nodes’ recovery times followed Eq. (20) with γ = 1.5 and the length of a time-step was Δt = 1 s.
(PDF)
Reference
- 1.Vestergaard CL, Génois M (2015) Temporal Gillespie Algorithm: Fast Simulation of Contagion Processes on Time-Varying Networks. PLoS Comput Biol 11(10): e1004579 10.1371/journal.pcbi.1004579 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−2 and μΔt = 10−4; (C),(D),(G), and (H) for βΔt = 10−1 and μΔt = 10−3. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on a face-to-face contact network recorded in a high school (Table 1).
(PDF)
(A)–(D) for a SIR process and (E)–(H) a SIS process. (A),(B),(E), and (F) for βΔt = 10−1 and μΔt = 10−3; (C),(D),(G), and (H) for βΔt = 1 and μΔt = 10−2. (A),(C) Mean number of nodes in each state of the SIR model as function of time. (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0) in the SIR model. (E),(G) Mean number of nodes in each state of the SIS model as function of time. (F),(H) Distribution of the number of infected nodes in the stationary state (t →∞) of the SIS model. All simulations were performed 1 000 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active.
(PDF)
(A),(C) Mean number of nodes in each state as function of time in the SIR model with Weibull distributed recovery times (Sec. 6: “Non-Markovian processes”); the parameter controlling the precision of the temporal Gillespie algorithm was set to ϵ = 0 (quasi-exact). (B),(D) Distribution of final epidemic size (number of recovered nodes when I = 0). (A),(B) βΔt = 10−2 and μΔt = 10−4; (C),(D) βΔt = 10−1 and μΔt = 10−3. The outcome of the rejection sampling algorithm approaches that of the temporal Gillespie algorithm as βΔt and μΔt become smaller. All simulations were performed 100 000 times with the root node chosen at random on an activity driven network consisting of N = 100 nodes, with activities ai = ηzi, where η = 0.1 and zi ~ zi-3.2 for zi ϵ [0.03,1), and a node formed two contacts when active. Nodes’ recovery times followed Eq. (20) with γ = 1.5 and the length of a time-step was Δt = 1 s.
(PDF)

