Simulation of the spread and containment of infections
Requires https://github.com/veandco/go-sdl2
Plotgeneration requires Python and Matplotlib, however these are not required to run the simulator
go build
./SpreadSimulator [options]
The following options are available;
- -cfg [filame] | Choose a configuration by its filename, will use 'standard' if omitted
- -v | Log current statistics in console
- -export | Saves the statistics into the export directory as a CSV-File, run
- -nogui | Disable graphics view.
python plotGenerator.py
to generate a plot for all csv files in the export directory
Example calls
./SpreadSimulator -v
./SpreadSimulator -cfg customConfig -v
./SpreadSimulator -v -export -nogui
./SpreadSimulator -cfg customConfig -export
./SpreadSimulator -cfg customConfig -export -nogui
Config via JSONStatistics export using CSVCLI Options/Flags- R0 and Re
NoGUI option- (Live?)
Visual Statistics - More Rendering Backends
- ???
- Profit
The simulator creates a given number of entities within a confined space.
Each of them is given a randomized motion vector, which is applied every tick.
A number of them will be infected at the start.
A number of them will be able to move around.
If another entity passes within a given radius, it'll get infected by a certain probability.
When an entity gets infected a timer will start. As soon as this timer runs out, the entity will either survive or die by a certain chance.
The hospital capacity determines how many hospital slots are available to the infected.
Each tick a number of random entities will be tested and detected using a certain probability. This simulates test accuracy.
In the case of an entity getting a positive test result, the entity will be hospitalized, which means he will be immobile and its chance of survival rises to 90%.
If active social distancing is set to true, the entities will actively try to avoid each other.
Randomly placed central locations attract entities during opening hours and repell them during closing time.