Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Pandemic Simulator

Description

This project is a pandemic simulation application built using cellular automata to model the spread of infectious diseases. It enables users to configure parameters, run simulations, and visualize the dynamics of a pandemic over time in an interactive and user-friendly way.

The simulator models a population on a 2D grid where cells represent individuals in different states of health, such as:

  • S: Susceptible
  • E: Exposed
  • I: Infected
  • Q: Quarantined (isolated infected individuals)
  • R: Recovered
  • D: Deceased
  • -1: Obstacles (non-interactive zones)

The application offers real-time animations of the simulation and supports statistical analysis of the disease progression.


Features

  1. Configurable Parameters:

    • Grid size (default: 100)
    • Disease Parameters:
      • Infection rate (p_inf, default: 0.2)
      • Incubation period (t_inc, default: 7 steps)
      • Recovery rate (p_rec, default: 0.05)
      • Death rate (p_dec, default: 0.01)
      • Recovery to susceptible period (t_il, default: 30 steps)
    • Disease Control:
      • Quarantine probability (p_quar, default: 0.1)
      • Mask usage parameters
    • Environment:
      • Obstacle ratio (default: 0.1)
    • Mask Usage:
      • Initial mask usage ratio (0-1, default: 0.0)
      • Dynamic mask usage toggle (0/1, default: 0)
      • Mask usage growth rate per step (default: 0.001)
      • Mask change start time (default: 50 steps)
    • Simulation:
      • Total steps (default: 200)
      • Animation interval (default: 30ms)
  2. Visualization:

    • Interactive 2D animations of the grid
    • Line plots showing the number of infected, recovered, and deceased over time
    • Color-coded cells representing different health states
  3. Social Distancing Measures:

    • Face Masks: Reduces transmission probability
      • Static or dynamic mask usage configuration
      • Initial mask usage ratio configurable (0-1)
      • Optional automatic increase in mask adoption over time
      • Masked susceptible individuals: 50% reduction in infection probability
      • Masked infected individuals: 70% reduction in transmission probability
      • Masks are randomly distributed among non-obstacle cells
      • Dynamic mask usage allows gradual increase with configurable:
        • Start time for mask usage changes
        • Growth rate per simulation step

Technologies Used

  • Programming Language: Python
  • Libraries:
    • numpy: For numerical operations and matrix manipulations
    • matplotlib: For visualizations and animations

Installation

Prerequisites

  • Python 3.8 or higher
  • Poetry package manager

Steps

  1. Clone the repository:
    git clone git@github.com:KajSob/pandemic-spread-simulation.git
    cd pandemic-simulator
    
  2. Install dependencies using Poetry:
     poetry install
    
  3. Run the application:
    poetry run python pandemic_simulation/main.py

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages