TestingStrategy Class Reference

CPP API: mio::abm::TestingStrategy Class Reference
mio::abm::TestingStrategy Class Reference

Set of TestingSchemes that are checked for testing. More...

#include <testing_strategy.h>

Classes

struct  LocalStrategy
 Vector of testing schemes used as an entry for either LocationId or LocationType in TestingStrategy. More...
 

Public Member Functions

void add_scheme (const LocationId &loc_id, const TestingScheme &scheme)
 Add a TestingScheme to the set of schemes that are checked for testing at a certain Location for a specific id. More...
 
void add_scheme (const LocationType &loc_type, const TestingScheme &scheme)
 Add a TestingScheme to the set of schemes that are checked for testing at a certain Location. More...
 
void add_scheme (const std::vector< LocationType > &loc_type, const TestingScheme &scheme)
 Add a TestingScheme to the set of schemes that are checked for testing at a certain Location. More...
 
auto default_serialize ()
 This method is used by the default serialization feature. More...
 
bool run_and_check (PersonalRandomNumberGenerator &rng, Person &person, const Location &location, TimePoint t)
 Runs the TestingStrategy and potentially tests a Person when entering. More...
 
 TestingStrategy ()=default
 Create a TestingStrategy. More...
 
 TestingStrategy (const std::vector< LocalStrategy > &location_to_schemes_id, const std::vector< LocalStrategy > &location_to_schemes_type)
 

Private Attributes

std::vector< LocalStrategym_testing_schemes_at_location_id
 Set of schemes that are checked for testing in specific locations. More...
 
std::vector< LocalStrategym_testing_schemes_at_location_type
 Set of schemes that are checked for testing in overall locations types. More...
 

Detailed Description

Set of TestingSchemes that are checked for testing.

Constructor & Destructor Documentation

◆ TestingStrategy() [1/2]

mio::abm::TestingStrategy::TestingStrategy ( )
default

Create a TestingStrategy.

Parameters
[in]testing_schemesVector of TestingSchemes that are checked for testing. The first vector is for LocationId and the second for LocationType. The index of the vector is the LocationId or LocationType and the value is the vektor of TestingScheme(s).

◆ TestingStrategy() [2/2]

mio::abm::TestingStrategy::TestingStrategy ( const std::vector< LocalStrategy > &  location_to_schemes_id,
const std::vector< LocalStrategy > &  location_to_schemes_type 
)
explicit

Member Function Documentation

◆ add_scheme() [1/3]

void mio::abm::TestingStrategy::add_scheme ( const LocationId loc_id,
const TestingScheme scheme 
)

Add a TestingScheme to the set of schemes that are checked for testing at a certain Location for a specific id.

Parameters
[in]loc_idLocationId key for TestingScheme to be added.
[in]schemeTestingScheme to be added.

◆ add_scheme() [2/3]

void mio::abm::TestingStrategy::add_scheme ( const LocationType loc_type,
const TestingScheme scheme 
)

Add a TestingScheme to the set of schemes that are checked for testing at a certain Location.

Parameters
[in]loc_typeLocationType key for TestingScheme to add.
[in]schemeTestingScheme to be added.

◆ add_scheme() [3/3]

void mio::abm::TestingStrategy::add_scheme ( const std::vector< LocationType > &  loc_type,
const TestingScheme scheme 
)
inline

Add a TestingScheme to the set of schemes that are checked for testing at a certain Location.

Parameters
[in]loc_typeVector of LocationType key for TestingScheme to add.
[in]schemeTestingScheme to be added.

◆ default_serialize()

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

This method is used by the default serialization feature.

◆ run_and_check()

bool mio::abm::TestingStrategy::run_and_check ( PersonalRandomNumberGenerator rng,
Person person,
const Location location,
TimePoint  t 
)

Runs the TestingStrategy and potentially tests a Person when entering.

The TestingStrategy runs the TestingSchemes in the order they are added but first IDs and then types. It also decides if one can enter, if there are no positive tests, home is always allowed.

Parameters
[in,out]rngPersonalRandomNumberGenerator of the Person being tested.
[in]personPerson to check.
[in]locationLocation to check.
[in]tTimePoint when to run the strategy.

Member Data Documentation

◆ m_testing_schemes_at_location_id

std::vector<LocalStrategy> mio::abm::TestingStrategy::m_testing_schemes_at_location_id
private

Set of schemes that are checked for testing in specific locations.

◆ m_testing_schemes_at_location_type

std::vector<LocalStrategy> mio::abm::TestingStrategy::m_testing_schemes_at_location_type
private

Set of schemes that are checked for testing in overall locations types.