Open up a Terminal (macOS/Linux) or PowerShell (Windows) and enter the following commands:
git clone https://github.com/underdoge/infection
cd infection
python -m venv venv
source venv/bin/activate
.\venv\Scripts\Activate.ps1
pip install -r requirements_macos_linux.txt
pip install -r requirements_win.txt
python3 main.py
python main.py
Important: Running the unit tests using 'pytest -v' won't work because it doesn't add the 'infection' module to the current path, only 'python -m pytest -v' does.
python3 -m pytest -v
python -m pytest -v
- The Infection Probability value determines how likely a healthy individual is to get infected upon contact with an infected one.
- Adjust the Infection Probability slider to the desired value, the default is 0.2.
- Only new individuals will be created with the selected value, previously created individuals are not affected when changing the slider value. In other words, each individual keeps its own infection probability throughout the simulation.
- Press the "+1 Healthy" button to add a new healthy individual to the simulation.
- Press the "+1 Infected" button to add a new infected individual to the simulation.
- Press the Reset button to remove all individuals and reset the simulation parameters.
- Press the "Healthy Color" button to change the color of new healthy individuals.
- Press the "Infected Color" button to change the color of new infected individuals.
- Press the "Recovered Color" button to change the color of new recovered individuals.
- Only new individuals will be created with the new color, previously created individuals are not affected when changing the color. In other words, each individual keeps its infection status color throughout the simulation until it updates its infection status.
- Python 3.7 or greater
- Git (to clone the repo)
Underdoge's infection @ GitHub Pages
- The use of the Windows Subsystem for Linux (WSL) is not supported because it provides very poor performance for the Kivy module and causes several graphical glitches, however, you can run this program in Windows with Python natively without any issues.