This project simulates the spread of an infectious disease using a proximity-based SIR model and visualizes it as a heatmap. Instead of tracking individual people or graph connections, the simulation focuses on infection density over time from a top-down aerial view, similar to how outbreaks are mapped in real-world epidemiology.
- Uniformly distributed agents across a 2D map.
- Slight Brownian motion to simulate interaction.
- Proximity-based infection: agents infect others within 5 meters.
- Infection probability decreases exponentially with distance.
- Agents recover after a random time.
- Recovered agents can be reinfected, but with lower probability.
- Heatmap shows infection density, not people.
- β Brownian motion (minimal movement)
- β SIR model: Susceptible β Infected β Recovered
- β Reinfection support
- β Per-pixel infection heatmap (OpenGL GPU-accelerated)
- β Custom-sized pixel grid (e.g., 200Γ150) rendered full-screen
- β Real-time rendering using PyOpenGL + GLFW
- β Scalable and optimized with spatial hashing
- β Configurable menu for parameters
A configuration menu allows customization of:
- Number of agents
- Initial infected count
- Infection probability
- Infection radius
- Reinfection probability
- Tick speed (FPS)
- Pixel size (for rendering)
The window will show a red heatmap, where:
- Light red = low infection density
- Bright red = high infection density
No individual agents are shown β only the infection spread as a visual.
MIT License
This simulation was built for educational and academic use to model how infections spread in a proximity-based population using GPU-accelerated heatmap rendering.