Settings

Overview Structs

Overview Functions

Structs

GEMS.DepartmentType
Department <: ContainerSetting

Represents 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 Offices

Parameters

  • id::Int32: Unique identifier of the department.
  • contains::Vector{Int32} = [] (optional): List of associated Offices
  • contained::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.GlobalSettingType
GlobalSetting <: IndividualSetting

A 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 individuals
  • contact_sampling_method::ContactSamplingMethod: Sampling Method, defining how contacts are drawn.
  • isactive::Bool: A flag to represent if the setting is considered active for simulation
  • isopen::Bool: Whether the setting is open for contacts. conditions
GEMS.HouseholdType
Household <: Geolocated

A 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 household
  • individuals::Vector{Individual} = [] (optional): List of associated individuals
  • income::Int8 = -1 (optional): Category of income for the household
  • dwelling::Int8 = -1 *(optional)*: Category of dwelliung size
  • last_infectious::Int16 = -1 (optional): Tick indicating the last presence of an infected individual
  • contact_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 household
  • lat::Float32 = NaN: Latitude of the household
  • isactive::Bool = false (optional): A flag to represent if the setting is considered active for simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts.
GEMS.MunicipalityType
Municipality <: IndividualSetting

A 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 municipality
  • individuals::Vector{Individual} = [] (optional): List of associated individuals
  • contact_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 simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts.
GEMS.OfficeType
Office <: Geolocated

Represents 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 office
  • contained::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 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
  • ags::AGS = AGS() (optional): The Amtlicher Gemeindeschlüssel (AGS) of the office
  • inroom::Int8 = -1 (optional): Describes the amount of indoor work done in the office
  • workhome::Int8 = -1 (optional): Describes the amount of work done from home
  • lon::Float32 = NaN (optional): Longitude of the office
  • lat::Float32 = NaN (optional): Latitude of the office
  • isactive::Bool = false (optional): Whether the office is active in the simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts
GEMS.SchoolType
School <: ContainerSetting

A 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 years

Parameters

  • id::Int32: Unique identifier of the school
  • contains::Vector{Int32} = [] (optional): List of associated SchoolYearss
  • contained::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 simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts.
GEMS.SchoolClassType
SchoolClass <: Geolocated

A 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 class
  • individuals::Vector{Individual} = [] (optional): List of associated individuals
  • type::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 individual
  • contact_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 schoolclass
  • lat::Float32 = NaN (optional): Latitude of the schoolclass
  • isactive::Bool = false (optional): A flag to represent if the setting is considered active for simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts.
GEMS.SchoolComplexType
SchoolComplex <: ContainerSetting

A 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 schools

Parameters

  • id::Int32: Unique identifier of the school complex
  • contains::Vector{Int32} = [] (optional): List of associated Schools
  • 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 simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts.
GEMS.SchoolYearType
SchoolYear <: ContainerSetting

A 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 classes

Parameters

  • id::Int32: Unique identifier of the schoolyear
  • contains::Vector{Int32} = [] (optional): List of associated SchoolClasses
  • contained::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 simulation
  • isopen::Bool = true (optional): Whether the setting is open for contacts.
GEMS.SettingsContainerType
SettingsContainer

A container structure for all settings.

Fields

  • settings::Dict{DataType, Vector}: A dictionary holding all known settings structured by type. Each value is a concretely-typed Vector{T} where T is the corresponding setting type; the dict value type is widened to Vector to allow this.
GEMS.WorkplaceType
Workplace <: ContainerSetting

Represents 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 Departments

Parameters

  • id::Int32: Unique identifier of the workplace.
  • contains::Vector{Int32} = [] (optional): List of associated Departments
  • contained::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.WorkplaceSiteType
WorkplaceSite <: ContainerSetting

Represents 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 Workplaces

Parameters

  • id::Int32: Unique identifier of the workplace.
  • contains::Vector{Int32} = [] (optional): List of associated Workplaces
  • type::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.

Missing docstring for ags(::ContainerSetting, ::Simulation). Check Documenter's build log for details.

Missing docstring.

Missing docstring for ags(::IndividualSetting, ::Simulation). Check Documenter's build log for details.

GEMS.agsMethod
ags(stng::Setting)

Get the statically computed ags of any Setting.

GEMS.avg_individualsFunction
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.

Missing docstring.

Missing docstring for contained(::Setting). Check Documenter's build log for details.

Missing docstring.

Missing docstring for contained_type(::Setting). Check Documenter's build log for details.

Missing docstring.

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.

Missing docstring for delete_dangling_ids!(::SettingsContainer). Check Documenter's build log for details.

GEMS.geolocationFunction
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.

Missing docstring for get_contained!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for get_containers!. Check Documenter's build log for details.

Missing docstring.

Missing docstring for get_open_contained!. Check Documenter's build log for details.

GEMS.householdMethod
household(i::Individual, sim::Simulation)::Household

Returns the Household instance referenced in an individual.

GEMS.idMethod
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 from
  • indivs::Vector{Individual}: List that will be appeneded with the setting's individuals
  • simulation::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 from
  • indivs::Vector{Individual}: List that will be appeneded with the setting's individuals
  • simulation::Simulation: Simulation object
GEMS.individualsMethod
individuals(setting::IndividualSetting)

Returns the individuals associated with the given setting.

GEMS.individualsMethod
individuals(setting::IndividualSetting, simulation::Simulation)

Returns the individuals associated with a given IndividualSetting.

GEMS.individualsMethod
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_openMethod
isopen(setting::Setting)

Returns wether the setting is opened (contacts can occur) or not. Without considering its containers.

GEMS.isactiveMethod
isactive(setting::Setting)

Returns whether the setting is considered active for simulation, e.g. an infection could spread in the setting.

GEMS.latMethod
lat(stng::Geolocated)

Returns latitude of geolocated setting.

GEMS.lonMethod
lon(stng::Geolocated)

Returns longitude of geolocated setting.

GEMS.max_individualsMethod
max_individuals(stngs::Vector{<:Setting}, simulation::Simulation)

Returns the maximum number of individuals across all provided settings.

GEMS.min_individualsMethod
min_individuals(stngs::Vector{<:Setting}, simulation::Simulation)

Returns the minimum number of individuals across all provided settings.

GEMS.min_max_avg_individualsMethod
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.

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.

Missing docstring for present_individuals!. Check Documenter's build log for details.

GEMS.schoolclassMethod
schoolclass(i::Individual, sim::Simulation)::SchoolClass

Returns the SchoolClass instance referenced in an individual.

GEMS.sample_individualsFunction
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.settingMethod
setting(container::SettingsContainer, type::DataType, id::Int32)

Returns a particular setting of a particular type and ID.

GEMS.settingcharMethod
settingchar(setting::Setting)

Returns a character that represents the type of setting.

GEMS.settingsMethod
settings(container::SettingsContainer)

Returns a dictionary with all concrete setting types as keys and vectors of all known settings as values.

Missing docstring.

Missing docstring for settings(::SettingsContainer, ::DataType). Check Documenter's build log for details.

Missing docstring.

Missing docstring for settings_from_jld2!(::String, ::SettingsContainer, ::Dict). Check Documenter's build log for details.

Missing docstring.

Missing docstring for settings_from_population(::Population, ::Bool). Check Documenter's build log for details.

GEMS.settingstringMethod
settingstring(c::Char)

Returns a string that represents the type of setting based on a char that is returned from the function settingchar.

GEMS.settingtypesFunction
settingtypes(container::SettingsContainer)

Returns all known setting types of the provided container.