Location Class Reference

CPP API: mio::abm::Location Class Reference

All Locations in the simulated Model where Persons gather. More...

#include <location.h>

Collaboration diagram for mio::abm::Location:

Public Member Functions

auto default_serialize ()
 This method is used by the default serialization feature. More...
 
CellCapacity get_capacity (uint32_t cell_idx=0) const
 Get the capacity of a specific Cell in persons and volume. More...
 
const std::vector< Cell > & get_cells () const
 Get the Cells of this Location. More...
 
mio::geo::GeographicalLocation get_geographical_location () const
 Get the geographical location of the Location. More...
 
LocationId get_id () const
 Get the location's identifier in a Model. More...
 
int get_model_id () const
 Get the model id the location is in. More...
 
MaskType get_required_mask () const
 Get the type of Mask that is demanded when entering this Location. More...
 
LocationType get_type () const
 Get the type of this Location. More...
 
bool is_mask_required () const
 Get the information whether masks are required to enter this Location. More...
 
 Location (const Location &other, LocationId id, int model_id=0)
 Construct a copy of a Location with a new ID. More...
 
 Location (LocationType loc_type, LocationId loc_id, size_t num_agegroups=1, int model_id=0, uint32_t num_cells=1)
 Construct a Location with provided parameters. More...
 
bool operator!= (const Location &other) const
 
bool operator== (const Location &other) const
 Compare two Locations. More...
 
void set_capacity (uint32_t persons, uint32_t volume, uint32_t cell_idx=0)
 Set the CellCapacity of a Cell in the Location in persons and volume. More...
 
void set_geographical_location (mio::geo::GeographicalLocation location)
 Set the geographical location of the Location. More...
 
void set_required_mask (MaskType type)
 Set the required type of mask for entering this Location. More...
 
LocalInfectionParametersget_infection_parameters ()
 Get the Location specific Infection parameters. More...
 
const LocalInfectionParametersget_infection_parameters () const
 Get the Location specific Infection parameters. More...
 

Private Member Functions

 Location ()=default
 

Private Attributes

friend DefaultFactory< Location >
 
std::vector< Cellm_cells {}
 A vector of all Cells that the Location is divided in. More...
 
mio::geo::GeographicalLocation m_geographical_location
 Geographical location (longitude and latitude) of the Location. More...
 
LocationId m_id
 Unique identifier for the Location in the Model owning it. More...
 
int m_model_id
 Model id the location is in. Only used for ABM graph model or hybrid graph model. More...
 
LocalInfectionParameters m_parameters
 Infection parameters for the Location. More...
 
MaskType m_required_mask
 Least secure type of Mask that is needed to enter the Location. More...
 
LocationType m_type
 Type of the Location. More...
 

Detailed Description

All Locations in the simulated Model where Persons gather.

Constructor & Destructor Documentation

◆ Location() [1/3]

mio::abm::Location::Location ( LocationType  loc_type,
LocationId  loc_id,
size_t  num_agegroups = 1,
int  model_id = 0,
uint32_t  num_cells = 1 
)
explicit

Construct a Location with provided parameters.

Parameters
[in]loc_typeThe LocationType.
[in]loc_idThe index of the Location in the Model.
[in]num_agegroups[Default: 1] The number of age groups in the model.
[in]model_id[Default: 0] The model id the Location is in.
[in]num_cells[Default: 1] The number of Cells in which the Location is divided.

◆ Location() [2/3]

mio::abm::Location::Location ( const Location other,
LocationId  id,
int  model_id = 0 
)
inlineexplicit

Construct a copy of a Location with a new ID.

Parameters
[in]otherThe Location to copy from.
[in]idThe ID for the new Location.

◆ Location() [3/3]

mio::abm::Location::Location ( )
privatedefault

Member Function Documentation

◆ default_serialize()

auto mio::abm::Location::default_serialize ( )
inline

This method is used by the default serialization feature.

◆ get_capacity()

CellCapacity mio::abm::Location::get_capacity ( uint32_t  cell_idx = 0) const
inline

Get the capacity of a specific Cell in persons and volume.

Parameters
[in]cell_idxThe index of the Cell.
Returns
The CellCapacity of the Cell.

◆ get_cells()

const std::vector<Cell>& mio::abm::Location::get_cells ( ) const
inline

Get the Cells of this Location.

Returns
The vector of all Cells of the Location.

◆ get_geographical_location()

mio::geo::GeographicalLocation mio::abm::Location::get_geographical_location ( ) const
inline

Get the geographical location of the Location.

Returns
The geographical location of the Location.

◆ get_id()

LocationId mio::abm::Location::get_id ( ) const
inline

Get the location's identifier in a Model.

Returns
The location's LocationId by value.

◆ get_infection_parameters() [1/2]

LocalInfectionParameters& mio::abm::Location::get_infection_parameters ( )
inline

Get the Location specific Infection parameters.

Returns
Parameters of the Infection that are specific to this Location.

◆ get_infection_parameters() [2/2]

const LocalInfectionParameters& mio::abm::Location::get_infection_parameters ( ) const
inline

Get the Location specific Infection parameters.

Returns
Parameters of the Infection that are specific to this Location.

◆ get_model_id()

int mio::abm::Location::get_model_id ( ) const
inline

Get the model id the location is in.

Is only relevant for graph ABM or hybrid model.

Returns
Model id of the location

◆ get_required_mask()

MaskType mio::abm::Location::get_required_mask ( ) const
inline

Get the type of Mask that is demanded when entering this Location.

Returns
Least secure MaskType that is demanded when entering this Location.

◆ get_type()

LocationType mio::abm::Location::get_type ( ) const
inline

Get the type of this Location.

Returns
The LocationType of the Location.

◆ is_mask_required()

bool mio::abm::Location::is_mask_required ( ) const
inline

Get the information whether masks are required to enter this Location.

Returns
True if masks are required to enter this Location.

◆ operator!=()

bool mio::abm::Location::operator!= ( const Location other) const
inline

◆ operator==()

bool mio::abm::Location::operator== ( const Location other) const
inline

Compare two Locations.

◆ set_capacity()

void mio::abm::Location::set_capacity ( uint32_t  persons,
uint32_t  volume,
uint32_t  cell_idx = 0 
)
inline

Set the CellCapacity of a Cell in the Location in persons and volume.

Parameters
[in]personsMaximum number of Persons that can visit the Cell at the same time.
[in]volumeVolume of the Cell in m^3.
[in]cell_idxIndex of the Cell.

◆ set_geographical_location()

void mio::abm::Location::set_geographical_location ( mio::geo::GeographicalLocation  location)
inline

Set the geographical location of the Location.

Parameters
[in]locationThe geographical location of the Location.

◆ set_required_mask()

void mio::abm::Location::set_required_mask ( MaskType  type)
inline

Set the required type of mask for entering this Location.

Parameters
[in]typeThe Least secure MaskType that is demanded when entering this Location.

Member Data Documentation

◆ DefaultFactory< Location >

friend mio::abm::Location::DefaultFactory< Location >
private

◆ m_cells

std::vector<Cell> mio::abm::Location::m_cells {}
private

A vector of all Cells that the Location is divided in.

◆ m_geographical_location

mio::geo::GeographicalLocation mio::abm::Location::m_geographical_location
private

Geographical location (longitude and latitude) of the Location.

◆ m_id

LocationId mio::abm::Location::m_id
private

Unique identifier for the Location in the Model owning it.

◆ m_model_id

int mio::abm::Location::m_model_id
private

Model id the location is in. Only used for ABM graph model or hybrid graph model.

◆ m_parameters

LocalInfectionParameters mio::abm::Location::m_parameters
private

Infection parameters for the Location.

◆ m_required_mask

MaskType mio::abm::Location::m_required_mask
private

Least secure type of Mask that is needed to enter the Location.

◆ m_type

LocationType mio::abm::Location::m_type
private

Type of the Location.