Batches
Overview Structs
GEMS.Batch
GEMS.Batch
GEMS.Batch
GEMS.Batch
GEMS.Batch
GEMS.BatchData
GEMS.BatchData
GEMS.BatchData
GEMS.BatchData
GEMS.BatchData
GEMS.BatchProcessor
GEMS.BatchProcessor
GEMS.DefaultBatchData
Overview Functions
Base.append!
Base.merge
Base.merge
GEMS.GEMS_version
GEMS.add!
GEMS.allocations
GEMS.allocations
GEMS.attack_rate
GEMS.attack_rate
GEMS.config_files
GEMS.cpu_data
GEMS.cumulative_disease_progressions
GEMS.cumulative_disease_progressions
GEMS.cumulative_quarantines
GEMS.cumulative_quarantines
GEMS.customlogger!
GEMS.dataframes
GEMS.effectiveR
GEMS.effectiveR
GEMS.execution_date
GEMS.exportJLD
GEMS.free_mem_size
GEMS.git_branch
GEMS.git_commit
GEMS.git_repo
GEMS.id
GEMS.import_batchdata
GEMS.info
GEMS.julia_version
GEMS.kernel
GEMS.meta_data
GEMS.number_of_individuals
GEMS.number_of_runs
GEMS.pathogens
GEMS.pathogens_by_name
GEMS.population_files
GEMS.population_pyramid
GEMS.remove!
GEMS.run!
GEMS.run_ids
GEMS.rundata
GEMS.runs
GEMS.runtime
GEMS.runtime
GEMS.setting_age_contacts
GEMS.settingdata
GEMS.sim_data
GEMS.simulations
GEMS.start_conditions
GEMS.stop_criteria
GEMS.strategies
GEMS.symptom_triggers
GEMS.system_data
GEMS.tests
GEMS.tests
GEMS.testtypes
GEMS.threads
GEMS.tick_cases
GEMS.tick_cases
GEMS.tick_unit
GEMS.total_infections
GEMS.total_infections
GEMS.total_mem_size
GEMS.total_quarantines
GEMS.total_quarantines
GEMS.total_tests
GEMS.total_tests
GEMS.word_size
Batch
Constructors
GEMS.Batch
— MethodBatch(;n_runs::Integer = 0, print_infos::Bool = false, simargs...)
Creates a Batch
object with a number of Simulation
objects as specified in n_runs
. The Simulation
objects are not passed but rather instantiated inside this function. Therefore, you can specify any keyworded argument using simargs...
, that you would otherwise pass to the Simulation()
constructor.
This function suppresses the console info outputs of the Simulation()
function. If you want to enable them, set the optional print_info
argument to True
.
GEMS.Batch
— MethodBatch(simulations::Simulation...)
Creates a Batch
object from Simulation
objects. Note: All Simulation
objects must be unique. You cannot pass the same simulation twice.
GEMS.Batch
— MethodBatch(simulations::Vector{Simulation})
Creates a Batch
object from a vector of Simulation
objects. Note: All Simulation
objects must be unique. You cannot pass the same simulation twice.
GEMS.Batch
— MethodBatch(batches::Batch...)
Merge multiple Batch
es into one.
GEMS.Batch
— MethodBatch(batches::Vector{Batch})
Merge multiple Batch
es into one.
Functions
GEMS.add!
— Methodadd!(sim::Simulation, batch::Batch)
Adds a Simulation
to a Batch
.
Base.append!
— Methodappend!(batch1::Batch, batch2::Batch)
Appends all simulations of batch2
to batch1
.
GEMS.customlogger!
— Methodcustomlogger!(batch::Batch, cl::CustomLogger)
Adds a CustomLogger
to each of the Simulation
objects that are contained in this batch. Note: This function will generate a duplicate of the passed logger for each of the simulation objects as otherwise, als data from all simulations would we written to the same logger.
Base.merge
— Methodmerge(batches::Batch...)
merge(batches::Vector{Batch})
Generates a new Batch
that contains all simulations of the input Batch
es.
GEMS.remove!
— Methodremove!(sim::Simulation, batch::Batch)
Removes a Simulation
from a Batch
.
GEMS.run!
— Methodrun!(batch::Batch; stepmod!::Function = x -> x)
Run all simulations within a Batch
. You can pass a stepmod!
function that is being executed for each simulation in each step. But be aware that it will be the same instance of the stepmod!
function. So if you have any internal data collection, this might cause inconsistencies.
GEMS.simulations
— Methodsimulations(batch::Batch)
Returns the list of Simulation
s associated with a Batch
.
BatchProcessor
SConstructors
GEMS.BatchProcessor
— MethodBatchProcessor(rundata::Vector{ResultData})
Creates a BatchProcessor
object for a vector of ResultData
objects.
GEMS.BatchProcessor
— MethodBatchProcessor(batch::Batch; stysle::String = "LightRD", print_infos::Bool = false)
Creates a BatchProcessor
object from a Batch
object. This constructor generates the ResultData
object for each of the Simulation
s contained in the Batch
. It supresses the usual info outputs that are being made during the ResultData
generation. If you want to enable them, pass print_infos = true
.
Functions
GEMS.allocations
— Methodallocations(batchProcessor::BatchProcessor)
Returns a dataframe for the memory allocations of the associated simulation runs in this batch. The columns correspond to the names of the inner timers while each row corresponds to one run. (Note: This data is only available if the simulation runs were done via the main()
function)
GEMS.attack_rate
— Methodattack_rate(batchProcessor::BatchProcessor)
Returns a vector of the attack_rate
accross the simulation runs in this batch.
GEMS.config_files
— Methodconfig_files(batchProcessor::BatchProcessor)
Returns the associated config file.
GEMS.cumulative_disease_progressions
— Methodcumulative_disease_progressions(batchProcessor::BatchProcessor)
Returns cumulative quarantines per tick accross the simulation runs in this batch.
GEMS.cumulative_quarantines
— Methodcumulative_quarantines(batchProcessor::BatchProcessor)
Returns cumulative quarantines per tick accross the simulation runs in this batch.
GEMS.effectiveR
— MethodeffectiveR(batchProcessor::BatchProcessor)
Returns the effective R value for each tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.number_of_individuals
— Methodnumber_of_individuals(batchProcessor::BatchProcessor)
Returns a vector of number_of_individuals
that were used in the associated simulations. Values are unique and can originate from multiple simulation runs.
GEMS.pathogens
— Methodpathogens(batchProcessor::BatchProcessor)
Returns a vector of pathogens
that were used in the associated simulations. Values are unique and can originate from multiple simulation runs.
GEMS.pathogens_by_name
— Methodpathogens_by_name(batchProcessor::BatchProcessor)
Returns a {name, pathogen[]} dictionary of pathogens
that were used in the associated simulations. This is done to keep multiple pathogen configurations of the same name with varying parameters. Names are unique and can originate from multiple simulation runs.
GEMS.population_files
— Methodpopulation_files(batchProcessor::BatchProcessor)
Returns the associated population file.
GEMS.population_pyramid
— Methodpopulation_pyramid(batchProcessor::BatchProcessor)
Returns a {String, DataFrame}
dictionary containing data to generate a population pyramid for each population files of this batch.
Dataframe Columns
Name | Type | Description |
---|---|---|
age | Int8 | 1-year age classes |
sex | Int8 | Sex according to population DataFame (0 = female, 1 = male) |
gender | String | String variant of Sex [Female, Male] |
sum | Int64 | Total of all genders in all ages (females multiplied by -1) |
GEMS.run_ids
— Methodrun_ids(batchProcessor::BatchProcessor)
Returns the vector of simulation run IDs that are associated with this batch.
GEMS.rundata
— Methodrundata(batchProcessor::BatchProcessor)
Returns the vector of ResultData
objects of simulation runs that are associated with this batch.
GEMS.runtime
— Methodruntime(batchProcessor::BatchProcessor)
Returns dataframe of the runtimes of the associated simulation runs in this batch. The columns correspond to the names of the inner timers while each row corresponds to one run. (Note: This data is only available if the simulation runs were done via the main()
function)
GEMS.setting_age_contacts
— Methodsetting_age_contacts(batchProcessor::BatchProcessor, settingtype::DataType)
Returns a {String, DataFrame}
dictionary containing an age X age matrix with sampled contacts for a provided settingtype
(i.e. Households) for each population files of this batch.
GEMS.settingdata
— Methodsettingdata(batchProcessor::BatchProcessor)
Returns a {String, DataFrame}
dictionary containing information about setting types in the population files in the simulation runs of this batch. Populations are distinguished by their population file name stored in the key of the result dictionary.
Dataframe Columns
Name | Type | Description |
---|---|---|
setting_type | String | Setting type identifier (name) |
number_of_settings | Int64 | Overall number of settings of that type |
min_individuals | Float64 | Lowest number of individuals assigned to a setting of this type |
max_individuals | Float64 | Highest number of individuals assigned to a setting of this type |
avg_individuals | Float64 | Average number of individuals assigned to a setting of this type |
GEMS.start_conditions
— Methodstart_conditions(batchProcessor::BatchProcessor)
Returns a vector of start_conditions
that were used in the associated simulations. Values are unique and can originate from multiple simulation runs.
GEMS.stop_criteria
— Methodstop_criteria(batchProcessor::BatchProcessor)
Returns a vector of stop_criteria
that were used in the associated simulations. Values are unique and can originate from multiple simulation runs.
GEMS.strategies
— Methodstrategies(batchProcessor::BatchProcessor)
Returns a vector of the strategies
accross the simulation runs in this batch.
GEMS.symptom_triggers
— Methodsymptom_triggers(batchProcessor::BatchProcessor)
Returns a vector of the symptom_triggers
accross the simulation runs in this batch.
GEMS.tests
— Methodtests(batchProcessor::BatchProcessor)
Returns newly exposed inviduals per tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.testtypes
— Methodtesttypes(batchProcessor::BatchProcessor)
Returns a vector of the testtypes
accross the simulation runs in this batch.
GEMS.tick_cases
— Methodtick_cases(batchProcessor::BatchProcessor)
Returns newly exposed inviduals per tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.tick_unit
— Methodtick_unit(batchProcessor::BatchProcessor)
Returns a vector of tick_units
that were used in the associated simulations. Values are unique and can originate from multiple simulation runs.
GEMS.total_infections
— Methodtotal_infections(batchProcessor::BatchProcessor)
Returns a vector of the total_infections
accross the simulation runs in this batch.
GEMS.total_quarantines
— Methodtotal_quarantines(batchProcessor::BatchProcessor)
Returns a vector of the total_quarantines
accross the simulation runs in this batch.
GEMS.total_tests
— Methodtotal_tests(batchProcessor::BatchProcessor)
Returns a Dict of vectors of the total_tests
per TestType accross the simulation runs in this batch.
BatchData
Constructors
GEMS.BatchData
— MethodBatchData(batchProcessor::BatchProcessor; style::String = "DefaultBatchData")
Create a BatchData
object using a BatchProcessor
and a style
, that defines which calculations should be done. Post Processing requires a simulation to be done.
GEMS.BatchData
— MethodBatchData(batch::Batch; style::String = "DefaultBatchData", rd_style = "LightRD")
Create a BatchData
object using a Batch
and a style
, that defines which calculations should be done during batch processing. As the provided batch
has unprocessed simulation runs inside, this function also triggers post processing for the individual simulation runs. The rd_style
argument defines the calculations that should be done during post processing of the individual runs. Post processing requires a simulation to be done.
GEMS.BatchData
— MethodBatchData(rds::Vector{ResultData}; style::String = "DefaultBatchData")
Create a BatchData
object using a vector of ResultData
objects and a style
, that defines which calculations should be done during batch processing.
GEMS.BatchData
— MethodBatchData(bds::BatchData...; style::String = "DefaultBatchData")
Calls the merge()
function for the input BatchData
objects.
GEMS.BatchData
— MethodBatchData(bds::Vector{BatchData}; style::String = "DefaultBatchData")
Calls the merge()
function for the input vector of BatchData
objects.
Functions
GEMS.allocations
— Methodallocations(bd::BatchData)
Returns allocation data of the simulation runs in this batch. (Note: This data is only available if the simulation runs were done via the main()
function)
GEMS.attack_rate
— Methodattack_rate(bd::BatchData)
Returns aggregated values for the attack_rate
accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.cpu_data
— Methodcpu_data(bd::BatchData)
Returns the processor information (not available for ARM Macs)
GEMS.cumulative_disease_progressions
— Methodcumulative_disease_progressions(bd::BatchData)
Returns aggregated values for cumulativediseaseprogressions per tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.cumulative_quarantines
— Methodcumulative_quarantines(bd::BatchData)
Returns aggregated values cumulative_quarantines per tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.dataframes
— Methoddataframes(batchData)
Returns the dataframes dict of the batch data object.
GEMS.effectiveR
— MethodeffectiveR(bd::BatchData)
Returns aggregated values for the effective R value for each tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.execution_date
— Methodexecution_date(bd::BatchData)
Returns the timestamp of batch data generation.
GEMS.exportJLD
— MethodexportJLD(batchData, directory)
Exports the BatchData
object as a JLD2 file, storing it in the specified directory
.
GEMS.free_mem_size
— Methodfree_mem_size(bd::BatchData)
Returns the available system memory
GEMS.GEMS_version
— MethodGEMS_version(bd::BatchData)
Returns the GEMS version this BatchData object was generated with.
GEMS.git_branch
— Methodgit_branch(bd::BatchData)
Returns the current git branch.
GEMS.git_commit
— Methodgit_commit(bd::BatchData)
Returns the current git commit.
GEMS.git_repo
— Methodgit_repo(bd::BatchData)
Returns the current git repository.
GEMS.id
— Methodid(bd::BatchData)
Returns the stringified SHA1 hash that serves as a unique identifier.
GEMS.import_batchdata
— Methodimport_batchdata(filepath::AbstractString)
Import the BatchData object from a jld2 file. Returns the BatchData object.
GEMS.info
— Methodinfo(bd::BatchData)
Prints info about available fields in the BatchData
object.
GEMS.julia_version
— Methodjulia_version(bd::BatchData)
Returns the Julia version that was used to generate this result data object.
GEMS.kernel
— Methodkernel(bd::BatchData)
Returns the system kernel information
Base.merge
— Methodmerge(bds::BatchData...; style::String = "DefaultBatchData")
merge(bds::Vector{BatchData}; style::String = "DefaultBatchData")
Generates a new BatchData
object from the union of all ResultData
objects out of all the passed BatchData
objects. Naturally, this requires the input BatchData
objects to have internal ResultData
objects. This requirement is met if the default style (DefaultBatchData
) was used during the creation of the input objects. Simply: If you didn't apply any custom style, this should work.
Returns
BatchData
: (New) combinedBatchData
object with all internalResultData
objects
GEMS.meta_data
— Methodmeta_data(bd::BatchData)
Returns the metadata dict of the batch data object.
GEMS.number_of_runs
— Methodnumber_of_runs(bd::BatchData)
Returns the number of runs in this batch.
GEMS.runs
— Methodruns(bd::BatchData)
Returns the ResultData
objects of each of the runs in the the batch data object.
GEMS.runtime
— Methodruntime(bd::BatchData)
Returns runtime data of the simulation runs in this batch. (Note: This data is only available if the simulation runs were done via the main()
function)
GEMS.sim_data
— Methodsim_data(bd::BatchData)
Returns the simdata dict of the batch data object.
GEMS.system_data
— Methodsystem_data(bd::BatchData)
Returns the systemdata dict of the batch data object.
GEMS.tests
— Methodtests(bd::BatchData)
Returns aggregated values for tests per tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.tick_cases
— Methodtick_cases(bd::BatchData)
Returns aggregated values for newly exposed inviduals per tick accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.threads
— Methodthreads(bd::BatchData)
Returns the number of threads this Julia instance was started with
GEMS.total_infections
— Methodtotal_infections(bd::BatchData)
Returns aggregated values for total_infections
accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.total_mem_size
— Methodtotal_mem_size(bd::BatchData)
Returns the total system memory
GEMS.total_quarantines
— Methodtotal_quarantines(batchData)
Returns aggregated values for total_quarantines
accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.total_tests
— Methodtotal_tests(bd::BatchData)
Returns aggregated values for total_tests
accross the simulation runs in this batch. It returns mean, standard deviation, range, and confidence intervals.
GEMS.word_size
— Methodword_size(bd::BatchData)
Returns the system word size
BatchDataStyle
GEMS.DefaultBatchData
— TypeDefaultBatchData <: BatchDataStyle
The default style for BatchData
objects. It contains all that can currently be calculated in the BatchProcessor
and all ResultData
objects of the individual runs.
Fields
data::Dict{String, Any}
meta_data::Dict{String, Any}
execution_date::String
: Time this BatchData object was generatedGEMS_version::VersionNumber
: GEMS version this BatchData object was generated with
system_data::Dict{String, Any}
kernel::String
: System kerneljulia_version::String
: Julia version that was used to generate this data objectword_size::Int64
: System word sizethreads::Int64
: Number of threads this Julia instance was started withcpu_data::Markdown.MD
: Information on the processor (not available for ARM Macs)total_mem_size::Float64
: Total system memoryfree_mem_size::Float64
: Available system memorygit_repo::SubString{String}
: Current Git repositorygit_branch::SubString{String}
: Current Git branchgit_commit::SubString{String}
: Current Git commit ID
sim_data::Dict{String, Any}
runs::Vector{ResultData}
: ResultData objects of individual simulation runs runsnumber_of_runs::Int64
: Number of simulation runstotal_infections::Dict{String, Real}
: Summary statistics on total infections across simulation runsattack_rate::Dict{String, Real}
: Summary statistics on attack rates across simulation runstotal_quarantines::Dict{String, Real}
: Summary statistics on total quarantines across simulation runstotal_tests::Dict{String, Real}
: Summary statistics on total tests across simulation runs
dataframes::Dict{String, Any}
tick_cases::Dataframe
: Aggregated data on infections per tick across simulation runseffectiveR::Dataframe
: Aggregated data on the effective reproduction number per tick across simulation runstests::Dataframe
: Aggregated data on tests per tick across simulation runscumulative_quarantines::Dataframe
: Aggregated data on cumulative quarantines per tick across simulation runscumulative_disease_progressions::Dataframe
: Aggregated data on cumulative disease progressions per tick across simulation runs