igabriel85 / PandemicSimulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pandemic Simulation with mesa

Simple project that uses the mesa python3 package to simulate a pandemic environment with some simple rules

Installation

Poetry is needed to install the project.

Using pip3

To install poetry:

pip3 install poetry

Create the environment:

poetry install

Launch the environment:

poetry shell

Other methods

Check: https://python-poetry.org/docs/ for the installation command and then follow the same commands.

Run

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/

Simulation Rules

The simulation follows some simple rules:

  1. the population consists of 3 types of persons:

    • infected (red)
    • well (never infected) (green)
    • recovered (infected in the past) (yellow)
  2. Each agent has an age and based on that a probability of infection is assigned to him/her

  3. An infected agent spreads the virus to his/her neighbours (in relation with the above probability of infection).

  4. A recovered agent can never be infected again

  5. An infected agent recovers after a number of days

How it looks

image

About

License:MIT License


Languages

Language:Python 100.0%