Skip to content

Commit

Permalink
Adding different viral factor to the individuals, hospital data and p…
Browse files Browse the repository at this point in the history
…ossibility of not having all parameters in CSV epi

Individuals have now the possibility to have a viral factor, which will determine their beta and viral release (i.e. allowing superspreaders, for instance). The enhancement is set to false by default. Also changed the order of creation of the matrix of parameters to allow epidemiological CSV file not having all the parameters. In addition, I've added the data for the hospitalisation and ICU capacity, according to Vinh Phuc (hence why it should be added as a parameter LATER)
  • Loading branch information
DAM-Philippon committed Jun 7, 2020
1 parent 3df18f5 commit f512b2b
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 35 deletions.
2 changes: 2 additions & 0 deletions COMOKIT/Model/Constants.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@ global {
string epidemiological_proportion_death_symptomatic <- "Proportion_death_symptomatic";
string epidemiological_infectious_period_symptomatic <- "Infectious_period_symptomatic";
string epidemiological_infectious_period_asymptomatic <- "Infectious_period_asymptomatic";
string epidemiological_allow_viral_individual_factor <- "Allow_viral_individual_factor";
string epidemiological_viral_individual_factor <- "Viral_individual_factor";

}
3 changes: 3 additions & 0 deletions COMOKIT/Model/Entities/Biological Entity.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ species BiologicalEntity control:fsm{
int last_test <- 0;
//Age of the entity
int age;
//Factor for the beta and the basic viral release
float viral_factor;
//Factor of the contact rate for asymptomatic and presymptomatic individuals (might be age-dependent, hence its presence here)
float factor_contact_rate_asymptomatic;
//Basic viral release of the agent (might be age-dependent, hence its presence here)
Expand All @@ -75,6 +77,7 @@ species BiologicalEntity control:fsm{
factor_contact_rate_asymptomatic <- world.get_factor_contact_rate_asymptomatic(age);
basic_viral_release <- world.get_basic_viral_release(age);
contact_rate <- world.get_contact_rate_human(age);
viral_factor <- world.get_viral_factor(age);
}

//Action to call when performing a test on a individual
Expand Down
8 changes: 2 additions & 6 deletions COMOKIT/Model/Entities/Hospital.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,13 @@ import "Building.gaml"
global{
//Number of hospital in the city
int number_hospital <- 1;
//Capacity of hospitalisation per hospital (this should be initialised by data, but we don't have any :))
int capacity_hospitalisation_per_hospital <- 10000;
//Capacity of ICU per hospital (this should be initialised by data, but we don't have any :))
int capacity_ICU_per_hospital <- 1000;

//Action to create a hospital TO CHANGE WHEN DATA ARE AVAILABLE (which building to chose, what capacity)
action create_hospital{
create Hospital number:number_hospital{
type <- "Hospital";
capacity_hospitalisation <- capacity_hospitalisation_per_hospital;
capacity_ICU <- capacity_ICU_per_hospital;
capacity_hospitalisation <- hospitalisation_capacity;
capacity_ICU <- ICU_capacity;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion COMOKIT/Model/Entities/Individual.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ species Individual parent: BiologicalEntity schedules: shuffle(Individual where
basic_viral_release <- world.get_basic_viral_release(age);
contact_rate <- world.get_contact_rate_human(age);
proba_wearing_mask <- world.get_proba_wearing_mask(age);
viral_factor <- world.get_viral_factor(age);
}

//Action to call to define a new case, obtaining different time to key events
Expand Down Expand Up @@ -259,7 +260,7 @@ species Individual parent: BiologicalEntity schedules: shuffle(Individual where
reflex infect_others when: not is_outside and is_infectious
{
//Computation of the reduction of the transmission when being asymptomatic/presymptomatic and/or wearing mask
float reduction_factor <- 1.0;
float reduction_factor <- viral_factor;
if(is_asymptomatic)
{
reduction_factor <- reduction_factor * factor_contact_rate_asymptomatic;
Expand Down
15 changes: 15 additions & 0 deletions COMOKIT/Model/Functions.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,21 @@ global
}
}


//Basic viral release in the environment of an infectious individual of a given age MUST BE A DISTRIBUTION
float get_viral_factor(int age)
{
if(allow_viral_individual_factor=false)
{
//No difference between individuals
return 1.0;
}
else
{
return get_rnd_from_distribution(map_epidemiological_parameters[age][epidemiological_viral_individual_factor][0],float(map_epidemiological_parameters[age][epidemiological_viral_individual_factor][1]),float(map_epidemiological_parameters[age][epidemiological_viral_individual_factor][2]));
}
}

//Time between exposure and symptom onset of an individual of a given age
float get_incubation_period_symptomatic(int age)
{
Expand Down
63 changes: 35 additions & 28 deletions COMOKIT/Model/Global.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,34 @@ global {
//Action used to initialise epidemiological parameters according to the file and parameters forced by the user
action init_epidemiological_parameters
{

//In the case no file was provided, then we simply create the matrix from the default parameters, that are not age dependent
loop aYear from:0 to: max_age
{
map<string, list<string>> tmp_map;
add list(epidemiological_fixed,string(init_all_ages_successful_contact_rate_human)) to: tmp_map at: epidemiological_successful_contact_rate_human;
add list(epidemiological_fixed,string(init_all_ages_factor_contact_rate_asymptomatic)) to: tmp_map at: epidemiological_factor_asymptomatic;
add list(epidemiological_fixed,string(init_all_ages_proportion_asymptomatic)) to: tmp_map at: epidemiological_proportion_asymptomatic;
add list(epidemiological_fixed,string(init_all_ages_proportion_dead_symptomatic)) to: tmp_map at: epidemiological_proportion_death_symptomatic;
add list(epidemiological_fixed,string(basic_viral_release)) to: tmp_map at: epidemiological_basic_viral_release;
add list(epidemiological_fixed,string(init_all_ages_probability_true_positive)) to: tmp_map at: epidemiological_probability_true_positive;
add list(epidemiological_fixed,string(init_all_ages_probability_true_negative)) to: tmp_map at: epidemiological_probability_true_negative;
add list(epidemiological_fixed,string(init_all_ages_proportion_wearing_mask)) to: tmp_map at: epidemiological_proportion_wearing_mask;
add list(epidemiological_fixed,string(init_all_ages_factor_contact_rate_wearing_mask)) to: tmp_map at: epidemiological_factor_wearing_mask;
add list(init_all_ages_distribution_type_incubation_period_symptomatic,string(init_all_ages_parameter_1_incubation_period_symptomatic),string(init_all_ages_parameter_2_incubation_period_symptomatic)) to: tmp_map at: epidemiological_incubation_period_symptomatic;
add list(init_all_ages_distribution_type_incubation_period_asymptomatic,string(init_all_ages_parameter_1_incubation_period_asymptomatic),string(init_all_ages_parameter_2_incubation_period_asymptomatic)) to: tmp_map at: epidemiological_incubation_period_asymptomatic;
add list(init_all_ages_distribution_type_serial_interval,string(init_all_ages_parameter_1_serial_interval),string(init_all_ages_parameter_2_serial_interval)) to: tmp_map at: epidemiological_serial_interval;
add list(epidemiological_fixed,string(init_all_ages_proportion_hospitalisation)) to: tmp_map at: epidemiological_proportion_hospitalisation;
add list(epidemiological_fixed,string(init_all_ages_proportion_icu)) to: tmp_map at: epidemiological_proportion_icu;
add list(init_all_ages_distribution_type_infectious_period_symptomatic,string(init_all_ages_parameter_1_infectious_period_symptomatic),string(init_all_ages_parameter_2_infectious_period_symptomatic)) to: tmp_map at: epidemiological_infectious_period_symptomatic;
add list(init_all_ages_distribution_type_infectious_period_asymptomatic,string(init_all_ages_parameter_1_infectious_period_asymptomatic),string(init_all_ages_parameter_2_infectious_period_asymptomatic)) to: tmp_map at: epidemiological_infectious_period_asymptomatic;
add list(init_all_ages_distribution_type_onset_to_hospitalisation,string(init_all_ages_parameter_1_onset_to_hospitalisation),string(init_all_ages_parameter_2_onset_to_hospitalisation)) to: tmp_map at: epidemiological_onset_to_hospitalisation;
add list(init_all_ages_distribution_type_hospitalisation_to_ICU,string(init_all_ages_parameter_1_hospitalisation_to_ICU),string(init_all_ages_parameter_2_hospitalisation_to_ICU)) to: tmp_map at: epidemiological_hospitalisation_to_ICU;
add list(init_all_ages_distribution_type_stay_ICU,string(init_all_ages_parameter_1_stay_ICU),string(init_all_ages_parameter_2_stay_ICU)) to: tmp_map at: epidemiological_stay_ICU;
add list(init_all_ages_distribution_viral_individual_factor,string(init_all_ages_parameter_1_viral_individual_factor),string(init_all_ages_parameter_2_viral_individual_factor)) to: tmp_map at: epidemiological_viral_individual_factor;
add tmp_map to: map_epidemiological_parameters at: aYear;
}

//If there are any file given as an epidemiological parameters, then we get the parameters value from it
if(load_epidemiological_parameter_from_file and file_exists(epidemiological_parameters))
{
Expand Down Expand Up @@ -159,6 +187,10 @@ global {
allow_transmission_human <- bool(data[epidemiological_csv_column_parameter_one,first(map_parameters[aKey])])!=nil?
bool(data[epidemiological_csv_column_parameter_one,first(map_parameters[aKey])]):allow_transmission_human;
}
match epidemiological_allow_viral_individual_factor{
allow_viral_individual_factor <- bool(data[epidemiological_csv_column_parameter_one,first(map_parameters[aKey])])!=nil?
bool(data[epidemiological_csv_column_parameter_one,first(map_parameters[aKey])]):allow_viral_individual_factor;
}
match epidemiological_transmission_building{
allow_transmission_building <- bool(data[epidemiological_csv_column_parameter_one,first(map_parameters[aKey])])!=nil?
bool(data[epidemiological_csv_column_parameter_one,first(map_parameters[aKey])]):allow_transmission_building;
Expand Down Expand Up @@ -215,34 +247,6 @@ global {
}
}
}
//In the case no file was provided, then we simply create the matrix from the default parameters, that are not age dependent
else
{
loop aYear from:0 to: max_age
{
map<string, list<string>> tmp_map;
add list(epidemiological_fixed,string(init_all_ages_successful_contact_rate_human)) to: tmp_map at: epidemiological_successful_contact_rate_human;
add list(epidemiological_fixed,string(init_all_ages_factor_contact_rate_asymptomatic)) to: tmp_map at: epidemiological_factor_asymptomatic;
add list(epidemiological_fixed,string(init_all_ages_proportion_asymptomatic)) to: tmp_map at: epidemiological_proportion_asymptomatic;
add list(epidemiological_fixed,string(init_all_ages_proportion_dead_symptomatic)) to: tmp_map at: epidemiological_proportion_death_symptomatic;
add list(epidemiological_fixed,string(basic_viral_release)) to: tmp_map at: epidemiological_basic_viral_release;
add list(epidemiological_fixed,string(init_all_ages_probability_true_positive)) to: tmp_map at: epidemiological_probability_true_positive;
add list(epidemiological_fixed,string(init_all_ages_probability_true_negative)) to: tmp_map at: epidemiological_probability_true_negative;
add list(epidemiological_fixed,string(init_all_ages_proportion_wearing_mask)) to: tmp_map at: epidemiological_proportion_wearing_mask;
add list(epidemiological_fixed,string(init_all_ages_factor_contact_rate_wearing_mask)) to: tmp_map at: epidemiological_factor_wearing_mask;
add list(init_all_ages_distribution_type_incubation_period_symptomatic,string(init_all_ages_parameter_1_incubation_period_symptomatic),string(init_all_ages_parameter_2_incubation_period_symptomatic)) to: tmp_map at: epidemiological_incubation_period_symptomatic;
add list(init_all_ages_distribution_type_incubation_period_asymptomatic,string(init_all_ages_parameter_1_incubation_period_asymptomatic),string(init_all_ages_parameter_2_incubation_period_asymptomatic)) to: tmp_map at: epidemiological_incubation_period_asymptomatic;
add list(init_all_ages_distribution_type_serial_interval,string(init_all_ages_parameter_1_serial_interval),string(init_all_ages_parameter_2_serial_interval)) to: tmp_map at: epidemiological_serial_interval;
add list(epidemiological_fixed,string(init_all_ages_proportion_hospitalisation)) to: tmp_map at: epidemiological_proportion_hospitalisation;
add list(epidemiological_fixed,string(init_all_ages_proportion_icu)) to: tmp_map at: epidemiological_proportion_icu;
add list(init_all_ages_distribution_type_infectious_period_symptomatic,string(init_all_ages_parameter_1_infectious_period_symptomatic),string(init_all_ages_parameter_2_infectious_period_symptomatic)) to: tmp_map at: epidemiological_infectious_period_symptomatic;
add list(init_all_ages_distribution_type_infectious_period_asymptomatic,string(init_all_ages_parameter_1_infectious_period_asymptomatic),string(init_all_ages_parameter_2_infectious_period_asymptomatic)) to: tmp_map at: epidemiological_infectious_period_asymptomatic;
add list(init_all_ages_distribution_type_onset_to_hospitalisation,string(init_all_ages_parameter_1_onset_to_hospitalisation),string(init_all_ages_parameter_2_onset_to_hospitalisation)) to: tmp_map at: epidemiological_onset_to_hospitalisation;
add list(init_all_ages_distribution_type_hospitalisation_to_ICU,string(init_all_ages_parameter_1_hospitalisation_to_ICU),string(init_all_ages_parameter_2_hospitalisation_to_ICU)) to: tmp_map at: epidemiological_hospitalisation_to_ICU;
add list(init_all_ages_distribution_type_stay_ICU,string(init_all_ages_parameter_1_stay_ICU),string(init_all_ages_parameter_2_stay_ICU)) to: tmp_map at: epidemiological_stay_ICU;
add tmp_map to: map_epidemiological_parameters at: aYear;
}
}

//In the case the user wanted to load parameters from the file, but change the value of some of them for an experiment,
// the force_parameters list should contain the key for the parameter, so that the value given will replace the one already
Expand All @@ -255,6 +259,9 @@ global {
match epidemiological_transmission_human{
allow_transmission_human <- allow_transmission_human;
}
match epidemiological_allow_viral_individual_factor{
allow_viral_individual_factor <- allow_viral_individual_factor;
}
match epidemiological_transmission_building{
allow_transmission_building <- allow_transmission_building;
}
Expand Down
9 changes: 9 additions & 0 deletions COMOKIT/Model/Parameters.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ global {
+"Epidemiological Parameters.csv"; //File for the parameters
file csv_parameters <- file_exists(epidemiological_parameters)?csv_file(epidemiological_parameters):nil;

//Dynamics
bool allow_transmission_human <- true; //Allowing human to human transmission
bool allow_transmission_building <- true; //Allowing environment contamination and infection
bool allow_viral_individual_factor <- false; //Allowing individual effects on the beta and viral release


//Environmental contamination
float successful_contact_rate_building <- 2.5 * 1/(14.69973*nb_step_for_one_day);//Contact rate for environment to human transmission derivated from the R0 and the mean infectious period
float reduction_coeff_all_buildings_inhabitants <- 0.01; //reduction of the contact rate for individuals belonging to different households leaving in the same building
float reduction_coeff_all_buildings_individuals <- 0.05; //reduction of the contact rate for individuals belonging to different households leaving in the same building
Expand Down Expand Up @@ -102,6 +106,11 @@ global {
string init_all_ages_distribution_type_stay_ICU <- "Lognormal";//Type of distribution of the time to stay in ICU
float init_all_ages_parameter_1_stay_ICU <- 3.034953;//First parameter of the time to stay in ICU
float init_all_ages_parameter_2_stay_ICU <- 0.34;//Second parameter of the time to stay in ICU
string init_all_ages_distribution_viral_individual_factor <- "Lognormal"; //Type of distribution of the individual factor for beta and viral release
float init_all_ages_parameter_1_viral_individual_factor <- -0.125; //First parameter of distribution of the individual factor for beta and viral release
float init_all_ages_parameter_2_viral_individual_factor <- 0.5; //Second parameter of distribution of the individual factor for beta and viral release
int ICU_capacity<-17; //Capacity of ICU for one hospital (from file)
int hospitalisation_capacity <- 200; //Capacity of hospitalisation admission for one hospital (assumed)
list<string> force_parameters;

//Synthetic population parameters
Expand Down

0 comments on commit f512b2b

Please sign in to comment.