crowdfightcovid19 / req-550-Syria

Repository to host the code of request 550 coming from the Pax Syriana Foundation
Other
3 stars 2 forks source link

Identification of compartments from var.names names during the simulations #35

Open apascualgarcia opened 4 years ago

apascualgarcia commented 4 years ago

With the current code, several operations to identify variables describing a type of individuals across all population classes (e.g. infectious individuals) is performed making a grep to the names of the variables, for instance all death individuals will be searched with the regexp ".D$".
This makes the code prone to errors if the names change, for instance I added a compartment called PI and using grep with the above regexp will return both PI and I (because the correct regexp should be "\.PI$". A possible enhancement is to prestore these indexes and skip the greps, which would also accelerate the code.