Skip to content

Dynamic groups in backend

Luis Aleixo requested to merge feature/dynamic_groups into master

Structure in which the root class is the ExposureModelGroup, having as parameter a tuple of ExposureModel. The idea is to consider the dynamic occupancy for the exposed population as different groups of exposure models, to separately assess the expected number of new cases, as well as the probability of infection with the incidence rate.

Dynamic infected population will remain as already is in the model, and as defined here - backend and here - frontend.

However, for the short-range and exposed population, the groups are now defined in a dict structure. E.g.:

short_range_interactions = {
      "group_1": [
            {"expiration": "Shouting", "start_time": "10:00", "duration": 30},
            {"expiration": "Shouting", "start_time": "10:10", "duration": 15}
      ],
      "group_2": [{"expiration": "Shouting", "start_time": "10:00", "duration": 30}],
}

While the dynamic_exposed_occupancy structure should be defined as:

dynamic_exposed_occupancy = {
      "group_1": {
            "total_people": 5,
            "presence": [
                  {"start_time": "09:00", "finish_time": "12:00"}, 
                  {"start_time": "13:00", "finish_time": "17:00"}
            ],
      "group_2": {
            "total_people": 10,
            "presence": [
                  {"start_time": "09:00", "finish_time": "12:00"},
                  {"start_time": "13:00", "finish_time": "17:00"}
            ]
      }
}

...and dynamic_infected_occupancy as:

dynamic_infected_occupancy = [{"total_people": 2, "start_time": "10:00", "finish_time": "12:00"}, {"total_people": 3, "start_time": "13:00", "finish_time": "17:00"}]

Removed the possibility to define exposure groups with different number of total_people.

Several tests were added.

Edited by Luis Aleixo

Merge request reports

Loading