thoughtworks / epirust

An agent-based epidemiology simulation framework built in Rust
GNU Affero General Public License v3.0
99 stars 14 forks source link
agent-based-modeling agent-based-simulation epidemiology rust

EpiRust

An agent-based epidemiology simulation framework built in Rust

Build Status

This is a monorepo containing code for the EpiRust framework -

  1. engine - The main EpiRust engine, which can be run as a CLI app
  2. orchestrator - Coordinator for multiple engines to run large scale simulations

Note: We are no longer maintaining the Web UI for EpiRust which allows you to trigger simulations and grid visualization for upto 1000 agents. Hence, it has been removed from here. Please refer sims2020 branch for web.

Quickstart

The quickest way to run the application is using the CLI interface on the engine. Follow the docker or local setup to get the engine up and running.

Docker

Prerequisites:

Build EpiRust engine docker image
docker build -t epirust-engine -f ./engine-app/Dockerfile .
Running EpiRust engine docker container
docker run --rm --name epirust-engine epirust-engine /bin/sh -c './epirust-engine -c config/default.json && ls *.csv'

Local setup

Prerequisites:

Running standalone simulations

To run in standalone mode, run this:

    RUST_LOG=info cargo run --bin engine-app -- -i <engine-id> -c path/to/simulation-config

Visualization:

Sample output: Epicurves plot

Running multi-region simulations

You can run EpiRust for multi-region simulations (e.g. to simulate a group of cities). This will require the orchestrator, and each engine representing a region. The architecture page on the wiki describes how this works at a high level.

Steps for running a multi-region simulation:

  1. Prepare a configuration. A configuration is a json file which consists of two parts:
    • The simulation configuaration for each engine. (Note that currently there is some repetition needed in the configuration for each engine)
    • The travel plan, which defines a matrix containing the daily travellers from one region to another. You can take a look at the orchestrator/config directory for examples of the configuration.
  2. To start with KAFKA on local, follow this
  3. To start with MPI on local, follow this
  4. To start with MPI on cloud, follow this
  5. To start with KAFKA on cloud, you have to set up KAFKA cluster on cloud. (follow this)

It will generate output CSV and JSON files which you can use to for analysis and charting.

License

EpiRust is an open source project licensed under AGPL v3