SEIRD Epidemic Simulator
A network-based epidemic simulator
This project was realized for the “Complex Networks” course, hold at the Department of Information Technology of University of Palermo.
The goal is to analyze the time evoulition of epidemics spread, based on the SEIRD model.
The population is rapresented by a random network (Poisson Erdos-Renyi), generated by choosing a fixed number of nodes and a fixed
edge probabiltity between them.
This is the schema of the epidemic states used in the model:
A Susceptible node can be catch the disease if it has an edge with an Exposed or Infected one.
If it happens, the node becomes Exposed for a specific time, after which it becomes automatically Infected.
During the Infection period, the node could become Recovered, but also it could fall in the Severe Infected state.
If the node falls in the Severe Infected state, there is a probability that it could die.
Note that, the node in the Dead state is not removed from the network, but it is just not taken in account for the next steps.
The scripts of the program are the following:
- main.py
- model.py
- simulator.py
In the main script, in addition to the GUI objects, there is a function with this lines:
def start_sim():
sim = simulator.Simulator()
net = model.Network(sim)
for i in range(sim.num_iter):
net.update_states(i,sim)
net.t_state = net.t_state + sim.dt_state
new_cases = net.get_new_cases(i,sim)
sim.s_to_e(net,new_cases)
sim.e_to_i(net)
sim.i_to_r(net)
sim.i_to_ig(net,i)
sim.ig_to_d(net,i)
if i>=plot_freq and i%plot_freq==0:
p = net.plot(i,sim)
Inside the loop, these funcions are performed:
- update_states(): updates the table states for each iteration
- get_new_cases(): returns new cases of exposed to disease, according to the adjacency list
- s_to_e(): takes the new cases and updates the state of the exposed nodes.
- e_to_i(): updates the state from exposed to infected
- i_to_r(): updates the state from infected to recovered
- i_to_ig(): set which infected nodes go to the severe infected state
- ig_to_d(): set which severe infected nodes go to the dead state
- plot(): plot funcion of the epidemic states
HOW TO INSTALL:
- Download the zip file from GitHub.
- install requirements:
pip install -r requirements.txt
HOW TO RUN:
Run the script:
python3 main.py
The GUI will open and you can start to use the simulator.
Interface example:
Parameters
- Number of nodes: number of individuals of the population
- Link probability: mean connection rate between individuals
- Number of iterations: number of days to analyze
- Initial exposed: initial number of individuals affected from the disease
- Incubation period: incubation time of the disease
- Disease period: time of the disease
- Transmission rate (α)
- Severe infected rate (β).
- Mortality rate (γ).
REFERENCES:
Erdos-Renyi network model, LT03 - Spread of epidemics models, LT11 - Spread of epidemics networked models, LT12. Prof. Salvatore Miccichè - Complex Networks 2021/2022. Master in Informatics, University of Palermo.
A. Kuzdeuov, A. Karabay, D. Baimukashev, B. Ibragimov and H. A. Varol, “A Particle-Based COVID-19 Simulator With Contact Tracing and Testing,” in IEEE Open Journal of Engineering in Medicine and Biology, vol. 2, pp. 111-117, 2021, doi: 10.1109/OJEMB.2021.3064506.
A. Karabay, A. Kuzdeuov, S. Ospanova, M. Lewis and H. A. Varol, “A Vaccination Simulator for COVID-19: Effective and Sterilizing Immunization Cases,” in IEEE Journal of Biomedical and Health Informatics, vol. 25, no. 12, pp. 4317-4327, Dec. 2021, doi: 10.1109/JBHI.2021.3114180.
A. Kuzdeuov et al., “A Network-Based Stochastic Epidemic Simulator: Controlling COVID-19 With Region-Specific Policies,” in IEEE Journal of Biomedical and Health Informatics, vol. 24, no. 10, pp. 2743-2754, Oct. 2020, doi: 10.1109/JBHI.2020.3005160.
View on GitHub Download as .zip
tags: networks - graphtheory - epidemics