-
Notifications
You must be signed in to change notification settings - Fork 14
Configuration for EpiRust
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
}
}
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
}
}
ind
(an index or serial number), age
, working
, and pub_transport
"population": {
"Csv": {
"file": "config/pune_population.csv",
"cols": [
]
}
}
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
}
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
}
EpiRust supports the following kinds of interventions:
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
}
The lockdown will be lifted when the number of infections drops below the threshold.
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
}
(TODO)
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
}
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.
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": {...},
}
"simulation": [
{
"engine_id": "city_1",
"config": {} //same as single-engine config
},
{
"engine_id": "city_2",
"config": {} //same as single-engine-config
},
]
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]
]
}