Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dannycalleri/virus-simulation
A simulation of a virus spreading among a population
https://github.com/dannycalleri/virus-simulation
particles physics simulation typescript virus
Last synced: about 1 month ago
JSON representation
A simulation of a virus spreading among a population
- Host: GitHub
- URL: https://github.com/dannycalleri/virus-simulation
- Owner: dannycalleri
- License: mit
- Created: 2020-03-31T12:57:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-13T23:44:14.000Z (about 2 years ago)
- Last Synced: 2024-11-09T15:47:30.620Z (3 months ago)
- Topics: particles, physics, simulation, typescript, virus
- Language: TypeScript
- Homepage:
- Size: 3.83 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Virus simulation - [Demo](https://dannycalleri.github.io/virus-simulation/)
During the global quarantine caused by COVID-19, I was literally blown away by [this article](https://www.washingtonpost.com/graphics/2020/world/corona-simulator/) by Harry Stevens in the Washington Post.
Here I'm trying to reproduce what he did and simulate what happens when a virus starts spreading among a population.
I used some technology that I wrote for games in the past, in particular the ones coming from my [Dungeon Crawler demo](https://github.com/dannycalleri/dungeon-crawler), so it was quite easy to rebuild everything.
Hope you like it.
## Known Issues
* When the page isn't focused, the game loop doesn't run because requestAnimationFrame is blocked. However, the physics engine that's running on another thread keeps running and since the events that triggers collisions are triggered by the engine itself, the simulation goes on breaking the synch with the renderer. A pause functionality that stops the physics engine should fix it. You can reproduce it by switching to the window of another app and then coming back to the browser tab running the simulation. You will notice a sudden drop in the "infected" chart.