CurrentModule = Daedalus
Daedalus.jl bundles demographic, economic, and epidemiological data that mirrors the R package {daedalus.data}.
All data access is provided through the DataLoader sub-module, which lazy-loads CSV files on first access and caches results for subsequent calls.
using Daedalus
# All countries with bundled demographic + economic data
countries = Daedalus.DataLoader.list_countries()
println("$(length(countries)) countries available")
println("First five: ", countries[1:5])
# All seven reference pathogens
Daedalus.DataLoader.list_pathogens()
# Pandemic response (economic closure) strategies
Daedalus.DataLoader.list_closure_strategies()
# Pre-pandemic vaccine investment scenarios
Daedalus.DataLoader.list_vaccination_scenarios()
DataLoader.get_country returns a DataLoader.CountryData struct containing demography, a 4×4 social contact matrix, sector workforce counts, gross value added (GVA) per sector, and hospital capacity.
using Daedalus
uk = Daedalus.DataLoader.get_country("United Kingdom")
println("Demography (4 age groups): ", uk.demography)
println("Hospital capacity (spare beds): ", uk.hospital_capacity)
println("Number of economic sectors: ", length(uk.workers))
# 4×4 social contact matrix
uk.contact_matrix
DataLoader.get_pathogen returns an DataLoader.InfectionData struct with all epidemiological parameters derived from the seven reference pathogens.
using Daedalus
delta = Daedalus.DataLoader.get_pathogen("sars-cov-2 delta")
delta
Pass a country name string and a pathogen name to daedalus to run the model with country-specific demography, contacts, and workforce data:
using Daedalus
result = daedalus("United Kingdom", "sars-cov-2 delta", time_end=600.0)
You can also pass a DataLoader.CountryData struct directly and customize infection parameters.
This is useful when you want to pre-fetch or modify country or infection data before running the model:
# Pre-fetch country data and pass the struct directly
uk = Daedalus.DataLoader.get_country("United Kingdom")
infection = Daedalus.DataLoader.get_pathogen("sars-cov-2 delta")
infection.r0 = 2.5
result2 = daedalus(uk, infection, time_end=600.0)
The Data sub-module also exposes lower-level functions for inspecting or manipulating the country arrays directly.
Each function accepts either a country name String or a CountryData struct:
| Function | Returns |
|---|---|
initial_state(country) |
Initial epidemic state array (N_GROUPS × N_COMPARTMENTS × N_VAX_STRATA) |
prepare_contacts(country) |
Scaled 49×49 contact matrix |
worker_contacts(country) |
Per-capita within-sector contact rates (length-45 vector) |
prepare_demog(country) |
49-element population vector |