Skip to content

Commit

Permalink
Release COMOKIT 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Brugiere committed Jun 9, 2020
2 parents deb983f + f512b2b commit e7ae9da
Show file tree
Hide file tree
Showing 22 changed files with 358 additions and 72 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ model $TITLE$
import "All COMOKIT.gaml"

global {

// Parameter file folder
// by default parameter files are placed in Parameters/ folder of COMOKIT
// if you decide to redefine the path to that folder identify the place COMOKIT can find your parameter files
string parameter_folder_path <- "../../COMOKIT/Parameters/";

string POLICY_NAME <- "your_policy"; // Not mandatory but will be used in GUI
}

Expand Down
5 changes: 5 additions & 0 deletions COMOKIT Template Project/templates/Policy Comparison.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import "All COMOKIT.gaml"

global {

// Parameter file folder
// by default parameter files are placed in Parameters/ folder of COMOKIT
// if you decide to redefine the path to that folder identify the place COMOKIT can find your parameter files
string parameter_folder_path <- "../../COMOKIT/Parameters/";

string dataset_path <- "../Datasets/Case Study/"; // Relative path to the folder containing the boundary.shp, buildings.shp, satellite.png, etc. datafiles.
string POLICY_NAME <- "your_policy"; // Not mandatory but will be used in GUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ model $TITLE$
import "All COMOKIT.gaml"

global {

// Parameter file folder
// by default parameter files are placed in Parameters/ folder of COMOKIT
// if you decide to redefine the path to that folder identify the place COMOKIT can find your parameter files
string parameter_folder_path <- "../../COMOKIT/Parameters/";

string dataset_path <- "../Datasets/Case Study/"; // Relative path to the folder containing the boundary.shp, buildings.shp, satellite.png, etc. datafiles.

action define_policy{
Expand Down
6 changes: 5 additions & 1 deletion COMOKIT Template Project/templates/Simple Policy.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import "All COMOKIT.gaml"

global {

// Parameter file folder
// by default parameter files are placed in Parameters/ folder of COMOKIT
// if you decide to redefine the path to that folder identify the place COMOKIT can find your parameter files
string parameter_folder_path <- "../../COMOKIT/Parameters/";

string dataset_path <- "../Datasets/Case Study/"; // Relative path to the folder containing the boundary.shp, buildings.shp, satellite.png, etc. datafiles.


action define_policy{
// ***************************************************************************
// SEE Model/Entities/Authority.gaml for built-in functions to create policies
Expand Down
Binary file added COMOKIT/Datasets/Ben Tre/Population Records.csv
Binary file not shown.
Binary file added COMOKIT/Datasets/Vinh Phuc/Population Records.csv
Binary file not shown.
32 changes: 32 additions & 0 deletions COMOKIT/Experiments/Abstract Experiment.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ global {
* Gloabl three steps initialization of a any simulation
*/
init {
do before_init;
do init_epidemiological_parameters;
do global_init;
do create_authority;
do after_init;
}

}
Expand Down Expand Up @@ -158,6 +160,36 @@ experiment "Abstract Experiment" virtual: true {
}

}

// DEMOGRAPHICS

display "demographics_age" virtual: true {
chart "Ages" type: histogram {
loop i from: 0 to: max_age { data ""+i value: Individual count(each.age = i); }
}
}

display "demographics_sex" virtual: true {
chart "sex" type: pie {
data "Male" value: Individual count (each.sex=0);
data "Female" value: Individual count (each.sex=1);
}
}

display "demographics_employed" virtual: true {
chart "unemployed" type: pie {
data "Employed" value: Individual count not(each.is_unemployed);
data "Unemployed" value: Individual count each.is_unemployed;
}
}

display "demographics_household_size" virtual: true {
chart "Household size" type:histogram {
loop i from: 0 to:max(Individual collect (length(each.relatives))) {
data string(i) value: Individual count (length(each.relatives)=i);
}
}
}

}

Expand Down
5 changes: 5 additions & 0 deletions COMOKIT/Experiments/Baseline/No containment.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ experiment "No Containment" parent: "Abstract Experiment" autorun: true {

display "Main" parent: default_display {}
display "Plot" parent: states_evolution_chart {}

display "Population age" parent: demographics_age { }
display "Population gender" parent: demographics_sex { }
display "Population employment status" parent: demographics_employed { }
display "Household size" parent: demographics_household_size { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
model CoVid19

import "../../Model/Global.gaml"
import "../Abstract Experiment.gaml"
import "../Abstract Batch Experiment.gaml"

global{

list<string> force_parameters <- list(epidemiological_transmission_building,epidemiological_basic_viral_decrease,epidemiological_basic_viral_release);
}

experiment "Comparison" parent: "Abstract Experiment" autorun: true {

Expand Down Expand Up @@ -84,3 +89,10 @@ experiment "Comparison" parent: "Abstract Experiment" autorun: true {
display "Main" parent: default_display {}
}
}

experiment HeadlessComparison parent: "Abstract Headless" {
parameter "Allow Transmission Building" var: allow_transmission_building init: true;

parameter "Basic Viral Release" var: basic_viral_release init: 0.01 min: 0.01 max: 0.1 step: 0.01; // if: [allow_transmission_building,true]
parameter "Basic Viral Decrease" var: basic_viral_decrease init: 0.02 min: 0.02 max: 0.2 step: 0.02; // if: [allow_transmission_building,true]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import "../Abstract Batch Experiment.gaml"

global {
int cycle_limit <- 5000 const:true;
list<string> force_parameters <- list(epidemiological_successful_contact_rate_human);
}

experiment Sensitivity parent: "Abstract Batch"
Expand Down Expand Up @@ -50,3 +51,8 @@ experiment Sensitivity parent: "Abstract Batch"
}

experiment SensitivityHeadless parent: "Abstract Headless" {}


experiment ContactRateHumanHeadless parent: "Abstract Headless" {
parameter "Init All Ages Successful Contact Rate Human" var: init_all_ages_successful_contact_rate_human init: 0.01529959 among: [0.01529959, 0.02236774, 0.02993250, 0.03034067, 0.03319786, 0.034014, 0.03673534, 0.04043608, 0.04854507, 0.07120533];
}
8 changes: 8 additions & 0 deletions COMOKIT/Model/Constants.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ global {
string gravity <- "gravity";
string closest <- "closest";

//List of demogrphic attributes
string AGE <- "age";
string SEX <- "sex";
string EMP <- "is_unemployed";
string HID <- "household_id";
string IID <- "individual_id";

//number of the column for the epidemiological parameters CSV file
int epidemiological_csv_column_name <- 0; //Name of the parameter
Expand Down Expand Up @@ -91,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
4 changes: 3 additions & 1 deletion COMOKIT/Model/Entities/Building.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ species Building {

}

species outside parent: Building ;
species outside parent: Building{
string type <- "Outside";
}
9 changes: 3 additions & 6 deletions COMOKIT/Model/Entities/Hospital.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +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{
capacity_hospitalisation <- capacity_hospitalisation_per_hospital;
capacity_ICU <- capacity_ICU_per_hospital;
type <- "Hospital";
capacity_hospitalisation <- hospitalisation_capacity;
capacity_ICU <- ICU_capacity;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions COMOKIT/Model/Entities/Individual.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ species Individual parent: BiologicalEntity schedules: shuffle(Individual where
int sex; //0 M 1 F
//employement status of the individual
bool is_unemployed;
//COMOKIT identifier
string individual_id;

//Bool to consider only once the death
bool is_counted_dead <- false;
Expand Down Expand Up @@ -147,22 +149,20 @@ 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
action define_new_case
{
//Add the new case to the total number of infected (not mandatorily known)
total_number_of_infected <- total_number_of_infected +1;

//Add the infection to the infections having been caused in the building
if(building_infections.keys contains(current_place.type))
{
building_infections[current_place.type] <- building_infections[current_place.type] +1;
}
else
{
add 1 to: building_infections at: current_place.type;
}
//Add the infection to the infections of the same age
if(total_incidence_age.keys contains(self.age))
{
Expand Down Expand Up @@ -260,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
Loading

0 comments on commit e7ae9da

Please sign in to comment.