Batches

Overview Structs

Overview Functions

Batch

Constructors

GEMS.BatchMethod
Batch(;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.BatchMethod
Batch(simulations::Simulation...)

Creates a Batch object from Simulation objects. Note: All Simulation objects must be unique. You cannot pass the same simulation twice.

GEMS.BatchMethod
Batch(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.BatchMethod
Batch(batches::Batch...)

Merge multiple Batches into one.

GEMS.BatchMethod
Batch(batches::Vector{Batch})

Merge multiple Batches into one.

Functions

GEMS.add!Method
add!(sim::Simulation, batch::Batch)

Adds a Simulation to a Batch.

Base.append!Method
append!(batch1::Batch, batch2::Batch)

Appends all simulations of batch2 to batch1.

GEMS.customlogger!Method
customlogger!(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.mergeMethod
merge(batches::Batch...)
merge(batches::Vector{Batch})

Generates a new Batch that contains all simulations of the input Batches.

GEMS.remove!Method
remove!(sim::Simulation, batch::Batch)

Removes a Simulation from a Batch.

GEMS.run!Method
run!(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.simulationsMethod
simulations(batch::Batch)

Returns the list of Simulations associated with a Batch.

BatchProcessor

SConstructors

GEMS.BatchProcessorMethod
BatchProcessor(rundata::Vector{ResultData})

Creates a BatchProcessor object for a vector of ResultData objects.

GEMS.BatchProcessorMethod
BatchProcessor(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 Simulations 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.allocationsMethod
allocations(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_rateMethod
attack_rate(batchProcessor::BatchProcessor)

Returns a vector of the attack_rate accross the simulation runs in this batch.

GEMS.config_filesMethod
config_files(batchProcessor::BatchProcessor)

Returns the associated config file.

GEMS.cumulative_disease_progressionsMethod
cumulative_disease_progressions(batchProcessor::BatchProcessor)

Returns cumulative quarantines per tick accross the simulation runs in this batch.

GEMS.cumulative_quarantinesMethod
cumulative_quarantines(batchProcessor::BatchProcessor)

Returns cumulative quarantines per tick accross the simulation runs in this batch.

GEMS.effectiveRMethod
effectiveR(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_individualsMethod
number_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.pathogensMethod
pathogens(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_nameMethod
pathogens_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_filesMethod
population_files(batchProcessor::BatchProcessor)

Returns the associated population file.

GEMS.population_pyramidMethod
population_pyramid(batchProcessor::BatchProcessor)

Returns a {String, DataFrame} dictionary containing data to generate a population pyramid for each population files of this batch.

Dataframe Columns

NameTypeDescription
ageInt81-year age classes
sexInt8Sex according to population DataFame (0 = female, 1 = male)
genderStringString variant of Sex [Female, Male]
sumInt64Total of all genders in all ages (females multiplied by -1)
GEMS.run_idsMethod
run_ids(batchProcessor::BatchProcessor)

Returns the vector of simulation run IDs that are associated with this batch.

GEMS.rundataMethod
rundata(batchProcessor::BatchProcessor)

Returns the vector of ResultData objects of simulation runs that are associated with this batch.

GEMS.runtimeMethod
runtime(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_contactsMethod
setting_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.settingdataMethod
settingdata(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

NameTypeDescription
setting_typeStringSetting type identifier (name)
number_of_settingsInt64Overall number of settings of that type
min_individualsFloat64Lowest number of individuals assigned to a setting of this type
max_individualsFloat64Highest number of individuals assigned to a setting of this type
avg_individualsFloat64Average number of individuals assigned to a setting of this type
GEMS.start_conditionsMethod
start_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_criteriaMethod
stop_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.strategiesMethod
strategies(batchProcessor::BatchProcessor)

Returns a vector of the strategies accross the simulation runs in this batch.

GEMS.symptom_triggersMethod
symptom_triggers(batchProcessor::BatchProcessor)

Returns a vector of the symptom_triggers accross the simulation runs in this batch.

GEMS.testsMethod
tests(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.testtypesMethod
testtypes(batchProcessor::BatchProcessor)

Returns a vector of the testtypes accross the simulation runs in this batch.

GEMS.tick_casesMethod
tick_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_unitMethod
tick_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_infectionsMethod
total_infections(batchProcessor::BatchProcessor)

Returns a vector of the total_infections accross the simulation runs in this batch.

GEMS.total_quarantinesMethod
total_quarantines(batchProcessor::BatchProcessor)

Returns a vector of the total_quarantines accross the simulation runs in this batch.

GEMS.total_testsMethod
total_tests(batchProcessor::BatchProcessor)

Returns a Dict of vectors of the total_tests per TestType accross the simulation runs in this batch.

BatchData

Constructors

GEMS.BatchDataMethod
BatchData(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.BatchDataMethod
BatchData(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.BatchDataMethod
BatchData(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.BatchDataMethod
BatchData(bds::BatchData...; style::String = "DefaultBatchData")

Calls the merge() function for the input BatchData objects.

GEMS.BatchDataMethod
BatchData(bds::Vector{BatchData}; style::String = "DefaultBatchData")

Calls the merge() function for the input vector of BatchData objects.

Functions

GEMS.allocationsMethod
allocations(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_rateMethod
attack_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_dataMethod
cpu_data(bd::BatchData)

Returns the processor information (not available for ARM Macs)

GEMS.cumulative_disease_progressionsMethod
cumulative_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_quarantinesMethod
cumulative_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.dataframesMethod
dataframes(batchData)

Returns the dataframes dict of the batch data object.

GEMS.effectiveRMethod
effectiveR(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_dateMethod
execution_date(bd::BatchData)

Returns the timestamp of batch data generation.

GEMS.exportJLDMethod
exportJLD(batchData, directory)

Exports the BatchData object as a JLD2 file, storing it in the specified directory.

GEMS.free_mem_sizeMethod
free_mem_size(bd::BatchData)

Returns the available system memory

GEMS.GEMS_versionMethod
GEMS_version(bd::BatchData)

Returns the GEMS version this BatchData object was generated with.

GEMS.git_branchMethod
git_branch(bd::BatchData)

Returns the current git branch.

GEMS.git_commitMethod
git_commit(bd::BatchData)

Returns the current git commit.

GEMS.git_repoMethod
git_repo(bd::BatchData)

Returns the current git repository.

GEMS.idMethod
id(bd::BatchData)

Returns the stringified SHA1 hash that serves as a unique identifier.

GEMS.import_batchdataMethod
import_batchdata(filepath::AbstractString)

Import the BatchData object from a jld2 file. Returns the BatchData object.

GEMS.infoMethod
info(bd::BatchData)

Prints info about available fields in the BatchData object.

GEMS.julia_versionMethod
julia_version(bd::BatchData)

Returns the Julia version that was used to generate this result data object.

GEMS.kernelMethod
kernel(bd::BatchData)

Returns the system kernel information

Base.mergeMethod
merge(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) combined BatchData object with all internal ResultData objects
GEMS.meta_dataMethod
meta_data(bd::BatchData)

Returns the metadata dict of the batch data object.

GEMS.number_of_runsMethod
number_of_runs(bd::BatchData)

Returns the number of runs in this batch.

GEMS.runsMethod
runs(bd::BatchData)

Returns the ResultData objects of each of the runs in the the batch data object.

GEMS.runtimeMethod
runtime(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_dataMethod
sim_data(bd::BatchData)

Returns the simdata dict of the batch data object.

GEMS.system_dataMethod
system_data(bd::BatchData)

Returns the systemdata dict of the batch data object.

GEMS.testsMethod
tests(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_casesMethod
tick_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.threadsMethod
threads(bd::BatchData)

Returns the number of threads this Julia instance was started with

GEMS.total_infectionsMethod
total_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_quarantinesMethod
total_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_testsMethod
total_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_sizeMethod
word_size(bd::BatchData)

Returns the system word size

BatchDataStyle

GEMS.DefaultBatchDataType
DefaultBatchData <: 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 generated
      • GEMS_version::VersionNumber: GEMS version this BatchData object was generated with
    • system_data::Dict{String, Any}

      • kernel::String: System kernel
      • julia_version::String: Julia version that was used to generate this data object
      • word_size::Int64: System word size
      • threads::Int64: Number of threads this Julia instance was started with
      • cpu_data::Markdown.MD: Information on the processor (not available for ARM Macs)
      • total_mem_size::Float64: Total system memory
      • free_mem_size::Float64: Available system memory
      • git_repo::SubString{String}: Current Git repository
      • git_branch::SubString{String}: Current Git branch
      • git_commit::SubString{String}: Current Git commit ID
    • sim_data::Dict{String, Any}

      • runs::Vector{ResultData}: ResultData objects of individual simulation runs runs
      • number_of_runs::Int64: Number of simulation runs
      • total_infections::Dict{String, Real}: Summary statistics on total infections across simulation runs
      • attack_rate::Dict{String, Real}: Summary statistics on attack rates across simulation runs
      • total_quarantines::Dict{String, Real}: Summary statistics on total quarantines across simulation runs
      • total_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 runs
      • effectiveR::Dataframe: Aggregated data on the effective reproduction number per tick across simulation runs
      • tests::Dataframe: Aggregated data on tests per tick across simulation runs
      • cumulative_quarantines::Dataframe: Aggregated data on cumulative quarantines per tick across simulation runs
      • cumulative_disease_progressions::Dataframe: Aggregated data on cumulative disease progressions per tick across simulation runs