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

Inside demonstrator munich #1169

Open
wants to merge 117 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
59d7ab5
first draft
xsaschako Mar 17, 2023
72f9c60
add another logger
xsaschako Mar 27, 2023
6e97737
change some things
xsaschako Mar 27, 2023
b49606f
example for testing purposes
xsaschako Mar 27, 2023
bf50995
barebone implementation
xsaschako Mar 30, 2023
7879f10
add simulation for abm demonstrator
jubicker Mar 30, 2023
cf260b7
add to cmakelist
xsaschako Mar 30, 2023
929753a
further enhance object file
xsaschako Apr 3, 2023
8cf13dd
some more
xsaschako Apr 3, 2023
2d7892e
comments
jubicker Apr 4, 2023
22c7e3e
convert size to int
jubicker Apr 4, 2023
93819a0
add another logger
xsaschako Apr 4, 2023
f9037d8
python abm demonstrator
jubicker Apr 5, 2023
ee57e2d
[CI SKIP] inside demonstrator
jubicker Apr 6, 2023
a3d3423
python demonstrator
jubicker Apr 12, 2023
8217776
[ci skip] add location capacities
jubicker Apr 14, 2023
ad215b7
[ci skip] comments
jubicker Apr 14, 2023
84d1135
add hiistory buffer
xsaschako Apr 14, 2023
80f4bf3
some additions
xsaschako Apr 18, 2023
1d80694
new additions
xsaschako Apr 20, 2023
284ed76
added julias output
xsaschako Apr 20, 2023
26d555d
[ci skip] simulation python binding
jubicker Apr 24, 2023
d25eec6
[ci skip] correct abm simulation bindings
jubicker Apr 24, 2023
cd4e51c
implement basic output for julia
xsaschako Apr 25, 2023
1ab0476
test output txt using output object
jubicker May 3, 2023
d9b8f37
log first time point
jubicker May 3, 2023
6703fa7
set initial time_since_transmission
jubicker May 3, 2023
6ef8eec
Merge branch '424-output-object-for-the-abm' into 604-enhancement-abm…
jubicker May 3, 2023
1b3eae2
output object for cpp demonstrator
jubicker May 3, 2023
e935bbe
Merge branch 'main' into 604-enhancement-abm-inside-demonstrator
jubicker May 3, 2023
153c3c3
write location mapping to file
jubicker May 5, 2023
3dce4d7
[ci skip] run simulation on linux
jubicker May 5, 2023
4711b9a
[ci skip] python demonstrator
jubicker May 5, 2023
ca11403
[ci skip] bug in python demonstrator
jubicker May 9, 2023
5c80091
[ci skip] set time until carrier
jubicker May 9, 2023
b46146a
paths and comments
jubicker May 9, 2023
3b2274e
comments and household distributions
jubicker May 10, 2023
e394edc
pre commit and fix CI
jubicker May 10, 2023
9534c3b
[ci skip] set seeds
jubicker May 15, 2023
688f592
merge main
jubicker Jun 26, 2023
8abd5c2
fix cpp demonstrator
jubicker Jun 27, 2023
62324fc
format
jubicker Jun 27, 2023
b3671d2
fix bindings
jubicker Jun 27, 2023
46f4360
assign_infection_state
jubicker Jun 27, 2023
fd1078f
add cemetery
jubicker Jun 27, 2023
5ae1e31
rename infection states
jubicker Jun 28, 2023
73f65db
delete old files
jubicker Jun 28, 2023
26c2692
fix merge with main
jubicker Jun 28, 2023
4fa83e1
add history object to test_abm
jubicker Jun 28, 2023
909dbc3
set time since transmission to -1 for recovered
jubicker Jun 30, 2023
02e7d91
Change recovered compartment in print
jubicker Jun 30, 2023
0620444
bug fix: dead people are not infectious
jubicker Jul 2, 2023
e08189d
read me
jubicker Jul 6, 2023
9c0b649
correct readMe and print console output to csv
jubicker Jul 10, 2023
fc4e054
set correct time since transmission at beginning
jubicker Jul 11, 2023
4bdafc3
Merge branch 'main' into inside-demonstrator-merge
jubicker Jul 12, 2023
183546d
Merge branch 'main' into inside-demonstrator-merge
jubicker Jul 12, 2023
fdc6687
remove wrong parameters
jubicker Jul 13, 2023
9c3da56
set seeds for location distribution
jubicker Jul 14, 2023
eaaf781
autopep
jubicker Jul 14, 2023
46eb63f
scale infectivity function
jubicker Jul 17, 2023
0823538
bindings and new default values
jubicker Jul 17, 2023
5179fb6
new probabilities for infection course
jubicker Jul 17, 2023
00cf250
write infection paths to file
jubicker Jul 18, 2023
af8ce7a
pre-commit
jubicker Jul 18, 2023
48033fc
scale infectiousness
jubicker Jul 26, 2023
07d340a
Merge branch 'inside-demonstrator-merge' of https://github.com/DLR-SC…
jubicker Jul 26, 2023
9d4cac2
scaling infectivity curve
jubicker Jul 27, 2023
dccb141
new output & bugfix
jubicker Aug 2, 2023
17c0fbd
add abm checks to anaylsis section
schminin Oct 6, 2023
e825967
move analysis to extra repo
schminin Oct 6, 2023
3e8ee9f
delete ipynb checkpoints
schminin Oct 8, 2023
246587a
delete png files
schminin Oct 8, 2023
1f10b33
load parameter values from file
schminin Oct 9, 2023
488cc7a
add at least one adult to other households
jubicker Oct 9, 2023
2291160
merge
jubicker Oct 9, 2023
f43fba9
platform independent file access
schminin Oct 10, 2023
53d31cb
change Location Id
jubicker Nov 7, 2023
0759722
merge main
jubicker Mar 21, 2024
1c07656
fix cpp demonstrator
jubicker Mar 21, 2024
71e1303
fix bindings
jubicker Mar 22, 2024
5f37103
introduce parameter distributions
jubicker Mar 27, 2024
8317074
minor changes
jubicker Mar 28, 2024
b745387
new parameters
jubicker Apr 2, 2024
b8c4a4f
bug fix
jubicker Apr 2, 2024
2a9e569
bug fix
jubicker Apr 2, 2024
c5ccc67
set aerosol transmission to 0
jubicker Apr 17, 2024
06d942a
bug fix and rework output
jubicker Aug 28, 2024
c21be46
new infectivity curve
jubicker Sep 2, 2024
f4e70d2
change t_peak and t_shift
jubicker Sep 6, 2024
26f708f
add individual return from work/school times
jubicker Sep 9, 2024
1ecf01e
seed and comp output
jubicker Sep 12, 2024
6842175
bug fix
jubicker Sep 12, 2024
95c537b
add comp output
jubicker Sep 12, 2024
6608a98
test
jubicker Sep 12, 2024
a4684d7
test
jubicker Sep 12, 2024
18e6337
test
jubicker Sep 12, 2024
a197f20
test
jubicker Sep 12, 2024
d73cf6e
test
jubicker Sep 12, 2024
e4fad2f
test
jubicker Sep 12, 2024
9c8ea31
test
jubicker Sep 12, 2024
dabbd19
new intialization
jubicker Sep 17, 2024
547c214
input files
jubicker Sep 23, 2024
7c40a57
new output format
jubicker Dec 17, 2024
cc1bee3
merge main
jubicker Dec 17, 2024
fc70de8
fix merge conflicts
jubicker Dec 17, 2024
21a5370
fix tests
jubicker Dec 18, 2024
fb5cef0
mock lognormal dist
jubicker Jan 2, 2025
e5e08c3
fix msvc tests
jubicker Jan 2, 2025
34db01a
abm bindings
jubicker Jan 3, 2025
c8eb6f5
fix demonstrator
jubicker Jan 3, 2025
952ebd6
set age groups for school and work
jubicker Jan 3, 2025
1db9ebd
Merge branch 'main' into inside-demonstrator-munich
jubicker Jan 7, 2025
afc0f4b
fix python unittest
jubicker Jan 7, 2025
352a8f9
demonstrator file
jubicker Jan 16, 2025
526946e
demonstrator_munich
jubicker Jan 18, 2025
f4b53c8
initialize model function
jubicker Jan 20, 2025
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
568 changes: 284 additions & 284 deletions .gitignore

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions cpp/memilio/utils/random_number_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,13 @@ IOResult<UniformDistributionParams> deserialize_internal(IOContext& io, Tag<Unif
template <class Int>
using PoissonDistribution = DistributionAdapter<std::poisson_distribution<Int>>;

/**
* adapted lognormal_distribution.
* @see DistributionAdapter
*/
template <class Real>
using LogNormalDistribution = DistributionAdapter<std::lognormal_distribution<Real>>;

} // namespace mio

#endif
123 changes: 111 additions & 12 deletions cpp/models/abm/analyze_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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.m();
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.s();
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 @@ -155,6 +244,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
Loading