TestingScheme Class Reference

CPP API: mio::abm::TestingScheme Class Reference

TestingScheme to regular test Persons. More...

#include <testing_strategy.h>

Collaboration diagram for mio::abm::TestingScheme:

Public Member Functions

auto default_serialize ()
 This method is used by the default serialization feature. More...
 
bool is_active (TimePoint t) const
 Gets the activity status of the scheme. More...
 
bool operator== (const TestingScheme &other) const
 Compares two TestingSchemes for functional equality. More...
 
bool run_and_test (PersonalRandomNumberGenerator &rng, Person &person, TimePoint t) const
 Runs the TestingScheme and potentially tests a Person. More...
 
 TestingScheme (const TestingCriteria &testing_criteria, TimeSpan validity_period, TimePoint start_date, TimePoint end_date, TestParameters test_parameters, ScalarType probability)
 Create a TestingScheme. More...
 

Private Member Functions

mio::abm::TimePoint get_end_date () const
 Gets the end date of the scheme. More...
 
mio::abm::TimePoint get_start_date () const
 Gets the start date of the scheme. More...
 
 TestingScheme ()=default
 

Private Attributes

friend DefaultFactory< TestingScheme >
 
TimePoint m_end_date
 Ending date of the scheme. More...
 
ScalarType m_probability
 Probability of performing the test. More...
 
TimePoint m_start_date
 Starting date of the scheme. More...
 
TestParameters m_test_parameters
 Parameters of the test. More...
 
TestingCriteria m_testing_criteria
 TestingCriteria of the scheme. More...
 
TimeSpan m_validity_period
 The valid TimeSpan of the test. More...
 

Detailed Description

TestingScheme to regular test Persons.

Constructor & Destructor Documentation

◆ TestingScheme() [1/2]

mio::abm::TestingScheme::TestingScheme ( const TestingCriteria testing_criteria,
TimeSpan  validity_period,
TimePoint  start_date,
TimePoint  end_date,
TestParameters  test_parameters,
ScalarType  probability 
)

Create a TestingScheme.

Parameters
[in]testing_criteriaVector of TestingCriteria that are checked for testing.
validity_periodThe valid TimeSpan of the test.
start_dateStarting date of the scheme.
end_dateEnding date of the scheme.
test_parametersThe parameters of test to be performed.
probabilityProbability of the test to be performed if a testing rule applies.

◆ TestingScheme() [2/2]

mio::abm::TestingScheme::TestingScheme ( )
privatedefault

Member Function Documentation

◆ default_serialize()

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

This method is used by the default serialization feature.

◆ get_end_date()

mio::abm::TimePoint mio::abm::TestingScheme::get_end_date ( ) const
inlineprivate

Gets the end date of the scheme.

Returns
The end date of the scheme.

◆ get_start_date()

mio::abm::TimePoint mio::abm::TestingScheme::get_start_date ( ) const
inlineprivate

Gets the start date of the scheme.

Returns
The start date of the scheme.

◆ is_active()

bool mio::abm::TestingScheme::is_active ( TimePoint  t) const

Gets the activity status of the scheme.

Returns
Whether the TestingScheme is currently active.

◆ operator==()

bool mio::abm::TestingScheme::operator== ( const TestingScheme other) const

Compares two TestingSchemes for functional equality.

◆ run_and_test()

bool mio::abm::TestingScheme::run_and_test ( PersonalRandomNumberGenerator rng,
Person person,
TimePoint  t 
) const

Runs the TestingScheme and potentially tests a Person.

Parameters
[in,out]rngPersonalRandomNumberGenerator of the Person being tested.
[in]personPerson to check.
[in]tTimePoint when to run the scheme.
Returns
Whether the Person is assumed to have a positive test result (could be not complying to the test).

Member Data Documentation

◆ DefaultFactory< TestingScheme >

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

◆ m_end_date

TimePoint mio::abm::TestingScheme::m_end_date
private

Ending date of the scheme.

◆ m_probability

ScalarType mio::abm::TestingScheme::m_probability
private

Probability of performing the test.

◆ m_start_date

TimePoint mio::abm::TestingScheme::m_start_date
private

Starting date of the scheme.

◆ m_test_parameters

TestParameters mio::abm::TestingScheme::m_test_parameters
private

Parameters of the test.

◆ m_testing_criteria

TestingCriteria mio::abm::TestingScheme::m_testing_criteria
private

TestingCriteria of the scheme.

◆ m_validity_period

TimeSpan mio::abm::TestingScheme::m_validity_period
private

The valid TimeSpan of the test.