Skip to content

Configuration for EpiRust

akshaydewan edited this page Jun 2, 2020 · 1 revision

Table of Contents

Single Engine Mode

The EpiRust engine accepts a configuration file using the -c flag. This is a JSON file which defines the population, disease dynamics, interventions etc. The schema of the file may keep changing as the program is developed, so if you face errors, you may refer to the engine/config folder in the source for the updated schema.

Here’s what an example configuration looks like:

{
  "output_file": "simulation_default_config",
  "population": {
    "Auto": {
      "number_of_agents": 10000,
      "public_transport_percentage": 0.2,
      "working_percentage": 0.7
    }
  },
  "disease": {
    "death_rate": 0.035,
    "percentage_asymptomatic_population": 0.3,
    "exposed_duration": 48,
    "last_day": 26,
    "asymptomatic_last_day": 9,
    "mild_infected_last_day": 12,
    "regular_transmission_rate": 0.25,
    "pre_symptomatic_duration": 48,
    "percentage_severe_infected_population": 0.3,
    "high_transmission_start_day": 6,
    "high_transmission_rate": 0.25,
    "regular_transmission_start_day": 5
  },
  "geography_parameters": {
    "grid_size": 250,
    "hospital_beds_percentage": 0.003
  },
  "hours": 10000,
  "interventions": [
    {
      "Lockdown": {
        "at_number_of_infections": 100,
        "essential_workers_population": 0.1
      }
    }
  ],
  "starting_infections": {
    "exposed": 1,
    "infected_mild_asymptomatic": 0,
    "infected_mild_symptomatic": 0,
    "infected_severe": 0
  }
}

Population

EpiRust can generate a population automatically, or a synthetic population can be supplied as an external CSV file.

When generating a population automatically, you can specify the public_transport_percentage and working_percentage to value between 0-1, representing the number of people using public transport and working respectively.

"population": {
    "Auto": {
      "number_of_agents": 10000,
      "public_transport_percentage": 0.2,
      "working_percentage": 0.7
    }
  }
When reading a CSV population, specify the file path relative to the working directory from where the application is run. Column mapping currently is not implemented, so make sure that the csv file contains the columns: ind (an index or serial number), age, working, and pub_transport
 "population": {
    "Csv": {
      "file": "config/pune_population.csv",
      "cols": [
      ]
    }
  }

Disease

EpiRust currently uses a 9-compartment model (used for COVID-19), with the following stages: Susceptible, Exposed, Presymptomatic infected, Asymptomatic infected, Infected with high severity, Infected with low severity, Hospitalized, Recovered and Dead.

The values and rates for the transitions between these compartments can be configured under the disease json:

"disease": {
    "death_rate": 0.035,
    "percentage_asymptomatic_population": 0.3,
    "exposed_duration": 48,
    "last_day": 26,
    "asymptomatic_last_day": 9,
    "mild_infected_last_day": 12,
    "regular_transmission_rate": 0.25,
    "pre_symptomatic_duration": 48,
    "percentage_severe_infected_population": 0.3,
    "high_transmission_start_day": 6,
    "high_transmission_rate": 0.25,
    "regular_transmission_start_day": 5
  }

Geography

This section defines the size of the grid and the percentage of hospital beds available in the region. The Grid is divided into a home area, work area, public transport area and hospital area. Currently the size of these areas are not configurable from the JSON, but can be modified in the source in constants.rs

"geography_parameters": {
    "grid_size": 250,
    "hospital_beds_percentage": 0.003
}

Interventions

EpiRust supports the following kinds of interventions:

Lockdown

This will halt the normal movement of agents across the grid. However, essential workers are still allowed to commute and work.

"Lockdown": {
    "at_number_of_infections": 100,
    "essential_workers_population": 0.1
}
In this example, a lockdown will be triggered when the number of infections reach 100, and 0.1 of the population will be treated as essential workers.

The lockdown will be lifted when the number of infections drops below the threshold.

Vaccination

When configured, a vaccination will be triggered at a specified simulation hour, for a percentage of the population.

"Vaccinate": {
    "at_hour": 5000,
    "percent": 0.2
}

Hospital expansion

(TODO)

Starting Infections

Sets the number of starting infections in the specified disease compartments. This can be useful when starting a simulation for a region based on actual data.

"starting_infections": {
    "exposed": 55,
    "infected_mild_asymptomatic": 0,
    "infected_mild_symptomatic": 0,
    "infected_severe": 0
}
Currently, only the exposed and infected compartments can be set for starting infections. In the example above, the simulation will start with 55 exposed agents.

Miscellaneous

hours: The number of hours/ticks the simulation should run.

output_file: The prefix used for the output files that will be generated by the simulation run.

Multi-Engine Mode

In multi-engine mode, several engines can run simultaneously, with each engine representing a region (such as a city). The orchestrator needs to be run for coordinating the engines. The configuration must be supplied to the orchestrator.

The structure of the configuration for multi-engine mode is:

{
    "simulation": [...],
    "travel_plan": {...},
}
The simulation block defines the configuration for each engine, which is the same as the configuration in single-engine mode.
"simulation": [
    {
      "engine_id": "city_1",
      "config": {} //same as single-engine config
    },
    {
      "engine_id": "city_2",
      "config": {} //same as single-engine-config
    },
]
In the above example, city_1 and city_2 are the names of the engines representing those regions. (Note that there is some duplication of config, such as the disease json which should be the same across all engines. This needs to be improved in the future).

In order to simulate the travel across cities, the travel_plan section comes in. The travel plan is described as a matrix, describing the number of people travelling across the regions. More information can be found on Issue #7

An example travel matrix for 3 regions A, B, C would look like:

{
  "regions": ["A", "B", "C"],
  "matrix": [
    [0, 156, 10],
    [108, 0, 290],
    [90, 75, 0]
  ]
}
In the above example, 156 agents travel from A to B, and so on. The diagonals of the matrix should always be zero. Note that travels happen only once in 24 hours. The actual number of travellers may differ from the ones defined in the matrix. For instance, 156 people travelling from A to B is a dependent on the current total population of that region. If the population of city A drops (due to outgoing travellers), then the number of outgoing travellers will drop proportionally. The number is also affected by Lockdowns, the number of hospitalized agents etc.