Skip to content

Commit

Permalink
Modification of parameter values for micro and some minor enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaillandier committed Jun 15, 2023
1 parent 0d56003 commit da87c48
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
5 changes: 4 additions & 1 deletion COMOKIT/Core/Models/Entities/Policy.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,17 @@ species DynamicSpatialPolicy parent: SpatialPolicy {

action apply {
if(every(1#day)) {
list<AbstractIndividual> infecteds <- all_individuals where(each.report_status = tested_positive);
list<AbstractIndividual> infecteds <- all_individuals where((each.report_status = tested_positive) and each.is_infectious );
write sample(length(infecteds));
//ask targets {do die;}
//target <- target;
application_area <- nil;
//loop i over: infecteds {
if (not empty(infecteds)) {
// write "la: " + length(infecteds);
application_area<-union(infecteds collect (circle(radius) at_location each.location));
write sample(application_area.perimeter);

// SpatialPolicy with: [target::target, application_area::union(infecteds collect (circle(radius) at_location each.location))] returns: result;
//targets << first(result);

Expand Down
2 changes: 2 additions & 0 deletions COMOKIT/Meso/Models/Entities/Activity.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ global {
species Activity parent: AbstractActivity frequency: 0 {
list<string> types_of_building <- [];
map<string,list<Building>> buildings;
bool always_allowed <- false;

map<Building,list<Individual>> find_target (Individual i) {
float start <- BENCHMARK ? machine_time : 0.0;
Expand Down Expand Up @@ -318,6 +319,7 @@ species studying parent: Activity {

species staying_home parent: Activity {
string name <- act_home;
bool always_allowed <- true;
map<Building,list<Individual>> find_target (Individual i) {
return [i.home::list<Individual>(i.relatives)];
}
Expand Down
4 changes: 2 additions & 2 deletions COMOKIT/Meso/Models/Entities/Individual.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ species Individual parent: AbstractIndividual schedules: use_activity_precomputa
is_activity_allowed<- Authority[0].allows(self, act.key);
nb_max_fellow <- Authority[0].limitGroupActivity(self, act.key) - 1;
}
else if (Authority[0].allows(self, act.key)) {
else if (act.key.always_allowed or Authority[0].allows(self, act.key)) {
int nb_fellows <- Authority[0].limitGroupActivity(self, act.key) - 1;
if (nb_fellows > 0) {
if (nb_fellows > 0) {
activity_fellows <-nb_fellows among act.value;
} else {
activity_fellows <- [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ global{
bool sim_stop { return (all_individuals all_match ([susceptible, removed] contains each.state)); }

init{
mode_batch <- true;
if (idSimulation = -1){
idSimulation <- int(self);
}
Expand Down
3 changes: 2 additions & 1 deletion COMOKIT/Meso/Models/Global.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ global {
list agents_history;
list<int> all_individuals_id;

bool mode_batch <- false;
list<Building> all_buildings;
geometry shape <- envelope(file_exists(shp_boundary_path) ?shape_file(shp_boundary_path) : shape_file(shp_buildings_path) );
Outside the_outside;
Expand Down Expand Up @@ -191,7 +192,7 @@ global {
firsts <- false;
}

reflex end when: cycle > 24 and (use_activity_precomputation ? empty(all_individuals): ((all_individuals count (each.is_susceptible or (each.state = removed))) = length(all_individuals))) {
reflex end when: not mode_batch and cycle > 24 and (use_activity_precomputation ? empty(all_individuals): ((all_individuals count (each.is_susceptible or (each.state = removed))) = length(all_individuals))) {
write "nb cycle: " + cycle;
write "time tot: " + (machine_time - t_ref);
write "time cycle: " + (machine_time - t_ref2) / cycle;
Expand Down
10 changes: 9 additions & 1 deletion COMOKIT/Micro/Models/Entities/BuildingIndividual.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ global {
int infection_direct;
int infection_object;
int infection_air;
int infection_restaurant;
int infection_office;
}

species IndividualScheduler schedules: shuffle(agents of_generic_species BuildingIndividual) where (each.clinical_status != dead);
Expand Down Expand Up @@ -111,7 +113,13 @@ species BuildingIndividual parent: AbstractIndividual skills: [moving] schedule

if flip(proba) {
do infect_someone(succesful_contact);

if (succesful_contact.current_room.type = "restaurant") {
infection_restaurant <- infection_restaurant + 1;
}
if (succesful_contact.current_room.type = "office") {
infection_office <- infection_office + 1;
}

infection_direct <- infection_direct + 1;
}
}
Expand Down
3 changes: 2 additions & 1 deletion COMOKIT/Micro/Models/Global.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ global {
//map<string, list<Room>> rooms_type <- Room group_by each.type;

do create_individuals;

ventilation_viral_decrease <- ventilated_viral_air_decrease_per_day;

do init_epidemiological_parameters;
do init_sars_cov_2;
viral_agent <- viruses first_with (each.name = variant);
Expand Down
14 changes: 7 additions & 7 deletions COMOKIT/Micro/Models/Parameters.gaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ global {
//EPIDEMIOLOGIC PARAMETERS
string variant <- DELTA;

float infectionDistance <- 1.5#m;
float infectionDistance <- 1.4#m;
float unit_cell_size <- 1#m;

float basic_viral_air_increase_per_day <- 2.0;
float basic_viral_local_increase_per_day <- 1.0;
float basic_viral_air_decrease_per_day <- 0.3;
float basic_viral_local_decrease_per_day <- 0.3;
float ventilated_viral_air_decrease_per_day <- 1.8;
float basic_viral_air_increase_per_day <- 1.0;
float basic_viral_local_increase_per_day <- 0.8;
float basic_viral_air_decrease_per_day <- 0.2;
float basic_viral_local_decrease_per_day <- 0.5;
float ventilated_viral_air_decrease_per_day <- 100.0;

bool allow_air_transmission <- true;
bool allow_direct_transmission <- true;
Expand Down

0 comments on commit da87c48

Please sign in to comment.