Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

664 Define and use parameters that handle the state transitions in the Infection #710

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 111 additions & 12 deletions cpp/models/abm/analyze_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,128 @@ std::vector<Model> ensemble_params_percentile(const std::vector<std::vector<Mode

for (size_t node = 0; node < num_nodes; node++) {
for (auto age_group = AgeGroup(0); age_group < AgeGroup(num_groups); age_group++) {
for (auto virus_variant = VirusVariant(0); virus_variant < VirusVariant::Count;
virus_variant = static_cast<VirusVariant>((uint32_t)virus_variant + 1)) {
for (auto virus_variant : enum_members<VirusVariant>()) {
// Global infection parameters
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<IncubationPeriod>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<IncubationPeriod>()[{virus_variant, age_group}].params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<IncubationPeriod>()[{virus_variant, age_group}].params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedNoSymptomsToSymptoms>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedNoSymptomsToSymptoms>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedNoSymptomsToRecovered>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedNoSymptomsToRecovered>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedSymptomsToSevere>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedSymptomsToSevere>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedSymptomsToRecovered>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<TimeInfectedSymptomsToRecovered>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<InfectedNoSymptomsToSymptoms>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedSevereToCritical>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<InfectedNoSymptomsToRecovered>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedSevereToCritical>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<InfectedSymptomsToRecovered>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedSevereToRecovered>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<InfectedSymptomsToSevere>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedSevereToRecovered>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<SevereToCritical>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedCriticalToDead>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<SevereToRecovered>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedCriticalToDead>()[{virus_variant, age_group}]
.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<CriticalToDead>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedCriticalToRecovered>()[{virus_variant, age_group}]
.params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<CriticalToRecovered>()[{virus_variant, age_group}];
static auto result =
model.parameters.template get<TimeInfectedCriticalToRecovered>()[{virus_variant, age_group}]
.params.b();
return result;
});

param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<RecoveredToSusceptible>()[{virus_variant, age_group}];
return model.parameters.template get<SymptomsPerInfectedNoSymptoms>()[{virus_variant, age_group}];
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<SeverePerInfectedSymptoms>()[{virus_variant, age_group}];
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<CriticalPerInfectedSevere>()[{virus_variant, age_group}];
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<DeathsPerInfectedCritical>()[{virus_variant, age_group}];
});

param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
return model.parameters.template get<DetectInfection>()[{virus_variant, age_group}];
});
Expand Down Expand Up @@ -158,6 +247,16 @@ std::vector<Model> ensemble_params_percentile(const std::vector<std::vector<Mode
.infectivity_beta.params.b();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<VirusShedFactor>()[{virus_variant, age_group}].params.a();
return result;
});
param_percentil(node, [age_group, virus_variant](auto&& model) -> auto& {
static auto result =
model.parameters.template get<VirusShedFactor>()[{virus_variant, age_group}].params.b();
return result;
});
param_percentil(node, [virus_variant](auto&& model) -> auto& {
return model.parameters.template get<AerosolTransmissionRates>()[{virus_variant}];
});
Expand Down
Loading