Simple project that uses the mesa python3 package to simulate a pandemic environment with some simple rules
Poetry is needed to install the project.
To install poetry:
pip3 install poetry
Create the environment:
poetry install
Launch the environment:
poetry shell
Check: https://python-poetry.org/docs/ for the installation command and then follow the same commands.
First run:
poetry shell
python server.py
or
poetry run python server.py
then a server will open at: http://127.0.0.1:8052/
The simulation follows some simple rules:
-
the population consists of 3 types of persons:
- infected (red)
- well (never infected) (green)
- recovered (infected in the past) (yellow)
-
Each agent has an age and based on that a probability of infection is assigned to him/her
-
An infected agent spreads the virus to his/her neighbours (in relation with the above probability of infection).
-
A recovered agent can never be infected again
-
An infected agent recovers after a number of days