Settings
Overview Structs
GEMS.ContainerSettingGEMS.DepartmentGEMS.GlobalSettingGEMS.HouseholdGEMS.IndividualSettingGEMS.MunicipalityGEMS.OfficeGEMS.SchoolGEMS.SchoolClassGEMS.SchoolComplexGEMS.SchoolYearGEMS.SettingGEMS.SettingsContainerGEMS.WorkplaceGEMS.WorkplaceSite
Overview Functions
GEMS.activate!GEMS.add!GEMS.add_member!GEMS.add_type!GEMS.add_types!GEMS.agsGEMS.avg_individualsGEMS.close!GEMS.contact_sampling_methodGEMS.contact_sampling_method!GEMS.deactivate!GEMS.geolocationGEMS.householdGEMS.idGEMS.individualsGEMS.individualsGEMS.individualsGEMS.individuals!GEMS.is_openGEMS.isactiveGEMS.latGEMS.lonGEMS.max_individualsGEMS.min_individualsGEMS.min_max_avg_individualsGEMS.open!GEMS.remove_member!GEMS.sample_individualsGEMS.schoolclassGEMS.settingGEMS.settingcharGEMS.settingsGEMS.settingstringGEMS.settingtypes
Structs
GEMS.ContainerSetting — Type
Supertype for all simulation settings which act as containers of settings.
GEMS.Department — Type
Department <: ContainerSettingRepresents a department within a workplace in the simulation.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
d1 = Department(id = 1)
d2 = Department(id = 2, contains = [13, 14, 15]) # contains IDs of OfficesParameters
id::Int32: Unique identifier of the department.contains::Vector{Int32} = [](optional): List of associatedOfficescontained::Int32 = DEFAULT_SETTING_ID(optional): Parent setting id (Workplace)type::Int32 = -1(optional): Numerical code representing the type of department.last_infectious::Int16 = -1(optional): The last simulation tick when an infectious individual was present.contact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.isactive::Bool = false(optional): Whether the department is active in the simulation.isopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.GlobalSetting — Type
GlobalSetting <: IndividualSettingA type to a setting that contains all individuals at once (mainly for testing purposes). With this type, each individual can theoretically connect with any other individual.
There should only be one GlobalSetting instance in any simulation.
Fields
individuals::Vector{Individual}: List of associated individualscontact_sampling_method::ContactSamplingMethod: Sampling Method, defining how contacts are drawn.isactive::Bool: A flag to represent if the setting is considered active for simulationisopen::Bool: Whether the setting is open for contacts. conditions
GEMS.Household — Type
Household <: GeolocatedA type to represent households with associated individuals as members.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
h1 = Household(id = 1)
h2 = Household(id = 2, individuals = [i1, i2, i3])Parameters
id::Int32: Unique identifier of the householdindividuals::Vector{Individual} = [](optional): List of associated individualsincome::Int8 = -1(optional): Category of income for the householddwelling::Int8 = -1 *(optional)*: Category of dwelliung sizelast_infectious::Int16 = -1(optional): Tick indicating the last presence of an infected individualcontact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.ags::AGS = AGS()(optional): The Amtlicher Gemeindeschlüssel (AGS) of the Household.lon::Float32 = NaN(optional): Longitude of the householdlat::Float32 = NaN: Latitude of the householdisactive::Bool = false(optional): A flag to represent if the setting is considered active for simulationisopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.IndividualSetting — Type
Supertype for all simulation settings which directly contain individuals.
GEMS.Municipality — Type
Municipality <: IndividualSettingA type to represent (geographical) municipalities.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
m1 = Municipality(id = 1)
m2 = Municipality(id = 2, individuals = [i1, i2, i3])Parameters
id::Int32: Unique identifier of the municipalityindividuals::Vector{Individual} = [](optional): List of associated individualscontact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.ags::AGS = AGS()(optional): The Amtlicher Gemeindeschlüssel (AGS) of the municipality.isactive::Bool = false(optional): A flag to represent if the setting is considered active for simulationisopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.Office — Type
Office <: GeolocatedRepresents an office within a department in the simulation.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
o1 = Office(id = 1)
o2 = Office(id = 2, individuals = [i1, i2, i3])Parameters
id::Int32: Unique identifier of the office.individuals::Vector{Individual} = [](optional): List of individuals associated with this officecontained::Int32 = DEFAULT_SETTING_ID(optional): Parent setting id (Department)contained_type::DataType = Department(optional): Parent setting tye (Department)type::Int32 = -1(optional): Numerical code representing the type of officelast_infectious::Int16 = -1(optional): The last simulation tick when an infectious individual was presentcontact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawnags::AGS = AGS()(optional): The Amtlicher Gemeindeschlüssel (AGS) of the officeinroom::Int8 = -1(optional): Describes the amount of indoor work done in the officeworkhome::Int8 = -1(optional): Describes the amount of work done from homelon::Float32 = NaN(optional): Longitude of the officelat::Float32 = NaN(optional): Latitude of the officeisactive::Bool = false(optional): Whether the office is active in the simulationisopen::Bool = true(optional): Whether the setting is open for contacts
GEMS.School — Type
School <: ContainerSettingA type to represent a school (which has years and classes).
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
s1 = School(id = 1)
s2 = School(id = 2, contains = [13, 14, 15]) # contains IDs of school yearsParameters
id::Int32: Unique identifier of the schoolcontains::Vector{Int32} = [](optional): List of associatedSchoolYearsscontained::Int32 = DEFAULT_SETTING_ID(optional): Parent setting id (SchoolComplex)type::Int32 = -1(optional): Type of school (e.g. primary, highschool, ...)contact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.isactive::Bool = false(optional): A flag to represent if the setting is considered active for simulationisopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.SchoolClass — Type
SchoolClass <: GeolocatedA type to represent school classes. Should always be part of a school.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
c1 = SchoolClass(id = 1)
c2 = SchoolClass(id = 2, individuals = [i1, i2, i3])Parameters
id::Int32: Unique identifier of the school classindividuals::Vector{Individual} = [](optional): List of associated individualstype::Int32 = -1(optional): Type of school class (e.g. grade)contained::Int32 = DEFAULT_SETTING_ID(optional): Parent setting id (SchoolYear)last_infectious::Int16 = -1(optional): Tick indicating the last presence of an infected individualcontact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.ags::Int32 = AGS()(optional): The Amtlicher Gemeindeschlüssel (AGS) of the schoolclass.lon::Float32 = NaN(optional): Longitude of the schoolclasslat::Float32 = NaN(optional): Latitude of the schoolclassisactive::Bool = false(optional): A flag to represent if the setting is considered active for simulationisopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.SchoolComplex — Type
SchoolComplex <: ContainerSettingA type to represent a school complex (which has schools).
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
sc1 = SchoolComplex(id = 1)
sc2 = SchoolComplex(id = 2, contains = [13, 14, 15]) # contains IDs of schoolsParameters
id::Int32: Unique identifier of the school complexcontains::Vector{Int32} = [](optional): List of associatedSchoolscontact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.isactive::Bool = false(optional): A flag to represent if the setting is considered active for simulationisopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.SchoolYear — Type
SchoolYear <: ContainerSettingA type to represent a schoolyear (which has classes).
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
y1 = SchoolYear(id = 1)
y2 = SchoolYear(id = 2, contains = [13, 14, 15]) # contains IDs of school classesParameters
id::Int32: Unique identifier of the schoolyearcontains::Vector{Int32} = [](optional): List of associatedSchoolClassescontained::Int32 = DEFAULT_SETTING_ID(optional): Parent setting id (School)type::Int32 = -1(optional): Type of school year (e.g. grade)contact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.isactive::Bool = false(optional): A flag to represent if the setting is considered active for simulationisopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.Setting — Type
Supertype for all simulation settings
GEMS.SettingsContainer — Type
SettingsContainerA container structure for all settings.
Fields
settings::Dict{DataType, Vector}: A dictionary holding all known settings structured by type. Each value is a concretely-typedVector{T}whereTis the corresponding setting type; the dict value type is widened toVectorto allow this.
GEMS.Workplace — Type
Workplace <: ContainerSettingRepresents a workplace in the simulation.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
ws1 = Workplace(id = 1)
ws2 = Workplace(id = 2, contains = [13, 14, 15]) # contains IDs of DepartmentsParameters
id::Int32: Unique identifier of the workplace.contains::Vector{Int32} = [](optional): List of associatedDepartmentscontained::Int32 = DEFAULT_SETTING_ID(optional): Parent setting id (WorkplaceSite)type::Int32 = -1(optional): Numerical code representing the type of workplace (e.g., farm, office).last_infectious::Int16 -1(optional): The last simulation tick when an infectious individual was present.contact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.isactive::Bool = false(optional): Whether the workplace is active in the simulation.isopen::Bool = true(optional): Whether the setting is open for contacts.
GEMS.WorkplaceSite — Type
WorkplaceSite <: ContainerSettingRepresents a Workplace site in the simulation.
Instantiation
The instantiation requires at least an id that be supplied as a keyword argument. All other fields are optional parameters.
ws1 = WorkplaceSite(id = 1)
ws2 = WorkplaceSite(id = 2, contains = [13, 14, 15]) # contains IDs of WorkplacesParameters
id::Int32: Unique identifier of the workplace.contains::Vector{Int32} = [](optional): List of associatedWorkplacestype::Int32 = -1(optional): Numerical code representing the type of workplace site.last_infectious::Int16 = -1(optional): The last simulation tick when an infectious individual was present.contact_sampling_method::ContactSamplingMethod = ContactparameterSampling(0)(optional): Sampling Method, defining how contacts are drawn.isactive::Bool = false(optional): Whether the workplace is active in the simulation.isopen::Bool = true(optional): Whether the setting is open for contacts.
Functions
GEMS.activate! — Function
activate!(setting::Setting)Sets the setting active for simulation.
activate!(setting::Setting, sim::Simulation)Activates setting and recursively activates the the containing setting.
GEMS.add! — Method
add!(container::SettingsContainer, setting::Setting)Add a setting to the container.
GEMS.add_member! — Method
add_member!(setting::IndividualSetting, individual::Individual)Adds the given individual to the setting and records the membership on the individual. setting_id! is a no-op for setting types without an id field on Individual (GlobalSetting).
Must not be called while the threaded transmission phase is running.
GEMS.remove_member! — Method
remove_member!(setting::IndividualSetting, individual::Individual)Removes the given individual from the setting and clears the membership on the individual. Does nothing if it is not a member.
The member is swapped with the last element, so member order is not preserved.
Must not be called while the threaded transmission phase is running.
GEMS.add_type! — Function
add_type!(container::SettingsContainer, settingtype::DataType)Add a settingtype to the container if it is not yet included. Creates a new concretely-typed vector for the provided type in the settings dictionary.
GEMS.add_types! — Function
add_types!(container::SettingsContainer, settingtypes::Vector{DataType})Adds settingtypes to the container if they are not yet included. Calls the add_type! function for each settingtype in the vector.
Missing docstring for ags(::ContainerSetting, ::Simulation). Check Documenter's build log for details.
Missing docstring for ags(::IndividualSetting, ::Simulation). Check Documenter's build log for details.
GEMS.ags — Method
ags(stng::Setting)Get the statically computed ags of any Setting.
GEMS.avg_individuals — Function
avg_individuals(stngs::Vector{<:Setting}, simulation::Simulation)Returns the average number of individuals across all provided settings.
GEMS.close! — Function
close!(setting::Setting)Closes the setting.
close!(setting::Setting, simulation::Simulation)Sets the setting and all settings contained by it as closed (not open).
GEMS.contact_sampling_method! — Function
contact_sampling_method(setting::Setting, csm::ContactSamplingMethod)Sets the ContactSamplingMethod of this setting to the provided method.
GEMS.contact_sampling_method — Function
contact_sampling_method(setting::Setting)Returns ContactSamplingMethod of this setting.
Missing docstring for contained(::Setting). Check Documenter's build log for details.
Missing docstring for contained_type(::Setting). Check Documenter's build log for details.
Missing docstring for contains_type(::ContainerSetting). Check Documenter's build log for details.
GEMS.deactivate! — Method
deactivate!(setting::Setting)Sets the setting as inactive for simulation.
Missing docstring for delete_dangling_ids!(::SettingsContainer). Check Documenter's build log for details.
GEMS.geolocation — Function
geolocation(stng::ContainerSetting, sim::Simulation)Get the location of a ContainerSetting by getting the location of the first contained setting.
geolocation(stng::IndividualSetting, sim::Simulation)Get the location of a IndividualSetting. Fallback for non geolocated settings.
geolocation(stng::IndividualSetting)Get the location of a IndividualSetting. Fallback for non geolocated settings.
geolocation(stng::IndividualSetting, sim::Simulation)Get the location of a IndividualSetting.
geolocation(stng::IndividualSetting)Get the location of a IndividualSetting.
Missing docstring for get_open_contained!. Check Documenter's build log for details.
GEMS.household — Method
household(i::Individual, sim::Simulation)::HouseholdReturns the Household instance referenced in an individual.
GEMS.id — Method
id(setting::Setting)Returns the unique identifier of the setting.
GEMS.individuals! — Function
individuals!(setting::IndividualSetting, indivs::Vector{Individual}, simulation::Simulation)Appends the individuals associated with a given IndividualSetting to the provided indivs vector.
Parameters
setting::IndividualSetting: Setting to get the individuals fromindivs::Vector{Individual}: List that will be appeneded with the setting's individualssimulation::Simulation: Simulation object
individuals!(setting::ContainerSetting, indivs::Vector{Individual}, simulation::Simulation)Appends the individuals associated with a given ContainerSetting to the provided indivs vector by recursively calling the individuals! function.
Parameters
setting::ContainerSetting: Setting to get the individuals fromindivs::Vector{Individual}: List that will be appeneded with the setting's individualssimulation::Simulation: Simulation object
GEMS.individuals — Method
individuals(setting::IndividualSetting)Returns the individuals associated with the given setting.
GEMS.individuals — Method
individuals(setting::IndividualSetting, simulation::Simulation)Returns the individuals associated with a given IndividualSetting.
GEMS.individuals — Method
individuals(setting::ContainerSetting, indivs::Vector{Individual}, simulation::Simulation)Returns the individuals associated with a given ContainerSetting by recursively getting the individuals of all contained settings using the individuals! function.
GEMS.is_open — Method
isopen(setting::Setting)Returns wether the setting is opened (contacts can occur) or not. Without considering its containers.
GEMS.isactive — Method
isactive(setting::Setting)Returns whether the setting is considered active for simulation, e.g. an infection could spread in the setting.
GEMS.lat — Method
lat(stng::Geolocated)Returns latitude of geolocated setting.
GEMS.lon — Method
lon(stng::Geolocated)Returns longitude of geolocated setting.
GEMS.max_individuals — Method
max_individuals(stngs::Vector{<:Setting}, simulation::Simulation)Returns the maximum number of individuals across all provided settings.
GEMS.min_individuals — Method
min_individuals(stngs::Vector{<:Setting}, simulation::Simulation)Returns the minimum number of individuals across all provided settings.
GEMS.min_max_avg_individuals — Method
min_max_avg_individuals(stngs::Vector{<:Setting}, simulation::Simulation)Returns a three-way tuple with (minimum, maximum, mean) number of individuals associated with a setting in the provided stngs vector.
Missing docstring for new_setting_ids!(::SettingsContainer, ::Dict). Check Documenter's build log for details.
GEMS.open! — Function
open!(setting::Setting)Opens the setting.
open!(setting::Setting, simulation::Simulation)Sets the setting and all settings contained by it as open.
Missing docstring for present_individuals!. Check Documenter's build log for details.
GEMS.schoolclass — Method
schoolclass(i::Individual, sim::Simulation)::SchoolClassReturns the SchoolClass instance referenced in an individual.
GEMS.sample_individuals — Function
sample_individuals(individuals::Vector{Individual}, n::Int64; rng::Xoshiro = default_gems_rng())Returns a subsample of a vector of Individuals of sample size n.
sample_individuals(setting::IndividualSetting, n::Int64; rng::Xoshiro = default_gems_rng())Returns a subsample of the setting's Individuals of sample size n.
GEMS.setting — Method
setting(container::SettingsContainer, type::DataType, id::Int32)Returns a particular setting of a particular type and ID.
GEMS.settingchar — Method
settingchar(setting::Setting)Returns a character that represents the type of setting.
GEMS.settings — Method
settings(container::SettingsContainer)Returns a dictionary with all concrete setting types as keys and vectors of all known settings as values.
Missing docstring for settings(::SettingsContainer, ::DataType). Check Documenter's build log for details.
Missing docstring for settings_from_jld2!(::String, ::SettingsContainer, ::Dict). Check Documenter's build log for details.
Missing docstring for settings_from_population(::Population, ::Bool). Check Documenter's build log for details.
GEMS.settingstring — Method
settingstring(c::Char)Returns a string that represents the type of setting based on a char that is returned from the function settingchar.
GEMS.settingtypes — Function
settingtypes(container::SettingsContainer)Returns all known setting types of the provided container.