Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow authored Aug 13, 2024
2 parents cc31593 + b1c033b commit 760cf99
Show file tree
Hide file tree
Showing 38 changed files with 4,323 additions and 627 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
WD := ../shared-svn/projects/episim/matsim-files

# All available Scenarios
ALL := BerlinWeek MunichWeek
ALL := BerlinBrandenburg

JAR := matsim-episim-*.jar
# Shortcut to the scenario creation tool
sc = java -Xmx20G -cp $(JAR) org.matsim.run.ScenarioCreation
sc = java -Xmx30G -cp $(JAR) org.matsim.run.ScenarioCreation

.PHONY: all clean $(ALL)

Expand All @@ -24,7 +24,7 @@ clean:

# Includes all the scenarios with local variables
# https://stackoverflow.com/questions/32904790/can-i-have-local-variables-in-included-makefiles
SUBDIRS := scenarios/Cologne.mk
SUBDIRS := scenarios/BerlinBrandenburg.mk
define INCLUDE_FILE
path = $S
include $S
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ The **MATSim input files, output files, analysis data and visualizations** are l
For more information about the methodology and preliminary results, see VSP working paper https://dx.doi.org/10.14279/depositonce-9835 .

For more information about MATSim, see here: https://www.matsim.org/.

160 changes: 160 additions & 0 deletions scenarios/BerlinBrandenburg.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# To run this, you need a newer version of make. 4.4.1 works (in macOS under the command of gmake)
# To run, execute "gmake BerlinBrandenburg" in terminal
in = $(WD)/snz/BerlinBrandenburg/original-data
out = $(WD)/snz/BerlinBrandenburg/episim-input
tmp = $(WD)/snz/BerlinBrandenburg/processed-data

BerlinBrandenburg: $(JAR) $(out)/bb_2020-week_snz_episim_events_wt_25pt_split.xml.gz $(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt_split.xml.gz \
$(out)/bb_2020-week_snz_episim_events_wt_100pt_split.xml.gz $(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt_split.xml.gz
echo "Building Berlin Brandenburg Week scenario"

BerlinBrandenburgSamples: $(JAR) $(out)/samples/bb_2020-week_snz_episim_events_wt_10pt_split.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_5pt_split.xml.gz \
$(out)/samples/bb_2020-week_snz_episim_events_wt_1pt_split.xml.gz
echo "Building Berlin Brandenburg Week samples"

$(tmp)/personIds.diluted.txt.gz:
$(sc) filterPersons $(in)/de2020gsmwt_events_reduced.xml.gz\
--facilities $(in)/facilities_assigned_simplified.xml.gz\
--attributes $(in)/populationAttributes.xml.gz\
--shape-file $(out)/shape-File/BerlinBrandenburg.shp\
--shape-crs EPSG:25833\
--output $@



$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_100pt.xml.gz: $(tmp)/personIds.diluted.txt.gz
$(sc) convertPersonAttributes $(in)/populationAttributes.xml.gz\
--ids $<\
--requireAttribute "microm:modeled:age"\
--output $@

$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt.xml.gz: $(out)/bb_2020-week_snz_entirePopulation_emptyPlans_100pt.xml.gz
$(sc) districtLookup $<\
--output $@\
--shp ../public-svn/matsim/scenarios/countries/de/episim/original-data/landkreise-in-germany/landkreise-in-germany.shp

########
# 25pct
########

$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_25pt.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt.xml.gz
$(sc) downSample 0.25\
--population $<\
--events $(in)/de2020gsmwt_events_reduced.xml.gz\
--events $(in)/de2020gsmsa_events_reduced.xml.gz\
--events $(in)/de2020gsmso_events_reduced.xml.gz\
--output $(tmp)

mv $(tmp)/population0.25.xml.gz $(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt.xml.gz
mv $(tmp)/de2020gsmwt_events_reduced-0.25.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_25pt.xml.gz
mv $(tmp)/de2020gsmsa_events_reduced-0.25.xml.gz $(out)/bb_2020-week_snz_episim_events_sa_25pt.xml.gz
mv $(tmp)/de2020gsmso_events_reduced-0.25.xml.gz $(out)/bb_2020-week_snz_episim_events_so_25pt.xml.gz

$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt_split.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_25pt_split.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_25pt.xml.gz
$(sc) splitHomeFacilities $<\
--events $(out)/bb_2020-week_snz_episim_events_wt_25pt.xml.gz\
--events $(out)/bb_2020-week_snz_episim_events_sa_25pt.xml.gz\
--events $(out)/bb_2020-week_snz_episim_events_so_25pt.xml.gz\
--shape-file $(out)/../shape-File/BerlinBrandenburg.shp\
--output $(out)

$(out)/wLeisure/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt_split.xml.gz $(out)/wLeisure/bb_2020-week_snz_episim_events_wt_25pt_split.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_25pt.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_25pt.xml.gz
$(sc) splitHomeFacilities $<\
--events $(out)/bb_2020-week_snz_episim_events_wt_25pt.xml.gz\
--events $(out)/bb_2020-week_snz_episim_events_sa_25pt.xml.gz\
--events $(out)/bb_2020-week_snz_episim_events_so_25pt.xml.gz\
--shape-file $(out)/../shape-File/dilutionArea.shp\
--remap visit --remap leisure\
--output $(out)/wLeisure

###########
# 100 pct
###########

$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt_filtered.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_100pt.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt.xml.gz
$(sc) downSample 1.0\
--population $<\
--events $(in)/de2020gsmwt_events_reduced.xml.gz\
--events $(in)/de2020gsmsa_events_reduced.xml.gz\
--events $(in)/de2020gsmso_events_reduced.xml.gz\
--output $(tmp)

mv $(tmp)/population1.0.xml.gz $(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt_filtered.xml.gz
mv $(tmp)/de2020gsmwt_events_reduced-1.0.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_100pt.xml.gz
mv $(tmp)/de2020gsmsa_events_reduced-1.0.xml.gz $(out)/bb_2020-week_snz_episim_events_sa_100pt.xml.gz
mv $(tmp)/de2020gsmso_events_reduced-1.0.xml.gz $(out)/bb_2020-week_snz_episim_events_so_100pt.xml.gz

$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt_split.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_100pt_split.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt_filtered.xml.gz $(out)/bb_2020-week_snz_episim_events_wt_100pt.xml.gz
$(sc) splitHomeFacilities $<\
--events $(out)/bb_2020-week_snz_episim_events_wt_100pt.xml.gz\
--events $(out)/bb_2020-week_snz_episim_events_sa_100pt.xml.gz\
--events $(out)/bb_2020-week_snz_episim_events_so_100pt.xml.gz\
--shape-file $(out)/../shape-File/dilutionArea.shp\
--output $(out)

#################
# 10pct 5pct 1pct
#################


$(out)/samples/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_10pt.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_10pt.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt.xml.gz
$(sc) downSample 0.1\
--population $<\
--events $(in)/de2020gsmwt_events_reduced.xml.gz\
--events $(in)/de2020gsmsa_events_reduced.xml.gz\
--events $(in)/de2020gsmso_events_reduced.xml.gz\
--output $(tmp)

mkdir $(out)/samples

mv $(tmp)/population0.1.xml.gz $(out)/samples//bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_10pt.xml.gz
mv $(tmp)/de2020gsmwt_events_reduced-0.1.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_10pt.xml.gz
mv $(tmp)/de2020gsmsa_events_reduced-0.1.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_sa_10pt.xml.gz
mv $(tmp)/de2020gsmso_events_reduced-0.1.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_so_10pt.xml.gz


$(out)/samples/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_5pt_split.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_5pt_split.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt.xml.gz
$(sc) downSample 0.05\
--population $<\
--events $(in)/de2020gsmwt_events_reduced.xml.gz\
--events $(in)/de2020gsmsa_events_reduced.xml.gz\
--events $(in)/de2020gsmso_events_reduced.xml.gz\
--output $(tmp)

mkdir $(out)/samples
mv $(tmp)/population0.05.xml.gz $(out)/samples//bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_5pt_split.xml.gz
mv $(tmp)/de2020gsmwt_events_reduced-0.05.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_5pt_split.xml.gz
mv $(tmp)/de2020gsmsa_events_reduced-0.05.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_sa_5pt_split.xml.gz
mv $(tmp)/de2020gsmso_events_reduced-0.05.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_so_5pt_split.xml.gz

$(out)/samples/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_1pt_split.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_1pt_split.xml.gz &: \
$(out)/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_100pt.xml.gz
$(sc) downSample 0.01\
--population $<\
--events $(in)/de2020gsmwt_events_reduced.xml.gz\
--events $(in)/de2020gsmsa_events_reduced.xml.gz\
--events $(in)/de2020gsmso_events_reduced.xml.gz\
--output $(tmp)

mkdir $(out)/samples
mv $(tmp)/population0.01.xml.gz $(out)/samples//bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_1pt_split.xml.gz
mv $(tmp)/de2020gsmwt_events_reduced-0.01.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_1pt_split.xml.gz
mv $(tmp)/de2020gsmsa_events_reduced-0.01.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_sa_1pt_split.xml.gz
mv $(tmp)/de2020gsmso_events_reduced-0.01.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_so_1pt_split.xml.gz


$(out)/samples/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_10pt_split.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_10pt_split.xml.gz &: \
$(out)/samples/bb_2020-week_snz_entirePopulation_emptyPlans_withDistricts_10pt.xml.gz $(out)/samples/bb_2020-week_snz_episim_events_wt_10pt.xml.gz
$(sc) splitHomeFacilities $<\
--events $(out)/samples/bb_2020-week_snz_episim_events_wt_10pt.xml.gz\
--events $(out)/samples/bb_2020-week_snz_episim_events_sa_10pt.xml.gz\
--events $(out)/samples/bb_2020-week_snz_episim_events_so_10pt.xml.gz\
--shape-file $(out)/../shape-File/dilutionArea.shp\
--output $(out)/samples
10 changes: 5 additions & 5 deletions src/main/R/analyseCases.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ imm_inf <- imm_inf_raw %>%

# mutate(vax = generic + mRNA + vector + ba1Update + ba5Update + natural)
ggplot() + #nShowingSymptoms # SARS_CoV_2
geom_line(snap_inf, mapping = aes(date, nShowingSymptoms , group = seed, col = "base")) +
geom_line(imm_inf, mapping = aes(date, nShowingSymptoms , group = seed, col = "imm-hist")) +
geom_line(snap_inf, mapping = aes(date, nShowingSymptoms , group = seed, col = "snapshot")) +
scale_color_manual(name='Regression Model',
breaks=c('snapshot', 'imm-hist'),
values=c('snapshot'='red', 'imm-hist'='blue'))+
labs(alt = "hello world") +
ggtitle("Infections")
breaks=c('base', 'imm-hist'),
values=c('base'='red', 'imm-hist'='blue'))+
ggtitle("Cologne Cases") +
labs(x="Date", y="New Cases")



Expand Down
Loading

0 comments on commit 760cf99

Please sign in to comment.