gursi26
pandemic_simulation
Rust

Pandemic simulation in Rust

Last updated Dec 16, 2025
36
Stars
1
Forks
0
Issues
0
Stars/day
Attention Score
5
Language breakdown
Rust 100.0%
โ–ธ Files click to expand
README

pandemic_simulation

A simple pandemic simulation with customizable parameters written in Rust, and rendered with Raylib.

https://user-images.githubusercontent.com/75204369/162750625-4df57e3d-0c02-4b5a-9c16-b510ff232b89.mp4

Customisable parameters:

  • INFECTION_RADIUS - Radius around infected person where normal person is susceptible to infection
  • INFECTION_RATE - Probability that normal person will get infected when within infection radius
  • NUMBALLS - Number of people
  • INITIALINFECTEDPOPULATION - Number of people infected at start of simualtion
  • MAXSPEED - Maximum possible speed that people move around at (speeds and start locations are random)
  • BASERECOVERYTIME - Base time for recovery
  • RECOVERYTIMERANGE - recoverytime = BASERECOVERYTIME + rand(-RECOVERYTIMERANGE, RECOVERYTIME_RANGE), accounts for natural variation in recovery times.
  • FATALITYRATE - Percentage of people that would die after recoverytime has elapsed. Remaining will recover.
Instructions:
  • git clone https://github.com/gursi26/pandemic_simulation.git
  • cd pandemic_simulation
  • cargo run
Dependecies: TODOs
  • [ ] Use grid rendering system for better performance with higher number of objects
  • [ ] Other, more optimised collision detection methods
  • [ ] Include phenomena like
- [ ] Social distancing - [ ] Lockdown with frequent trips to a central location (like a grocery store) - [ ] Separate communities with travel between them - [ ] Quarantine zones for infected patients - [ ] Asymptomatic cases - [X] Fatality rate - [X] Recovery rate - [ ] Virus mutating into a stronger variant (more contagious or more deadly)

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท gursi26/pandemic_simulation ยท Updated daily from GitHub