person.h Source File
|
CPP API
|
person.h
Go to the documentation of this file.
60 explicit Person(mio::RandomNumberGenerator& rng, LocationType location_type, LocationId location_id,
361 ScalarType get_protection_factor(TimePoint t, VirusVariant virus, const Parameters& params) const;
483 return abm::Person(thread_local_rng(), abm::LocationType::Count, abm::LocationId(), 0, AgeGroup(0),
A class template for an array with custom indices.
Definition: custom_index_array.h:136
const ParameterTagTraits< Tag >::Type & get() const
get value of a parameter
Definition: parameter_set.h:262
Definition: infection.h:78
Parameters of the simulation that are the same everywhere within the Model.
Definition: abm/parameters.h:764
Agents in the simulated Model that can carry and spread the Infection.
Definition: person.h:50
bool goes_to_school(TimePoint t, const Parameters ¶ms) const
Draw if the Person goes to school or stays at home during lockdown.
Definition: person.cpp:155
Counter< uint32_t > & get_rng_counter()
Get this persons RandomNumberGenerator counter.
Definition: person.h:395
LocationType m_location_type
Type of the current Location.
Definition: person.h:449
void set_location(LocationType type, LocationId id, int model_id)
Change the location of the person.
Definition: person.cpp:98
int m_location_model_id
Model id of the current Location. Only used for Graph ABM.
Definition: person.h:450
void remove_quarantine()
Removes the quarantine status of the Person.
Definition: person.cpp:160
Infection & get_infection()
Get the latest #Infection of the Person.
Definition: person.cpp:111
ScalarType m_random_schoolgroup
Value to determine if the Person goes to school or stays at home during lockdown.
Definition: person.h:461
const std::vector< LocationId > & get_assigned_locations() const
Get the assigned Locations of the Person.
Definition: person.h:193
Counter< uint32_t > m_rng_counter
counter for RandomNumberGenerator.
Definition: person.h:473
Mask & get_mask()
Get the current Mask of the Person.
Definition: person.h:298
std::vector< ProtectionEvent > m_vaccinations
! Vector with the indices of the assigned Locations so that the Person always visits the same Home or...
Definition: person.h:453
const std::vector< ProtectionEvent > & get_vaccinations() const
Get all vaccinations of the Person.
Definition: person.h:90
int get_assigned_location_model_id(LocationType type) const
Returns the model id of an assigned location of the Person.
Definition: person.cpp:127
std::vector< LocationId > m_assigned_locations
Definition: person.h:451
bool is_infected(TimePoint t) const
Returns if the Person is infected at the TimePoint.
Definition: person.cpp:65
std::vector< uint32_t > m_cells
Vector with all Cells the Person visits at its current Location.
Definition: person.h:467
TimeSpan get_time_at_location() const
Get the time the Person has been at its current Location.
Definition: person.h:153
mio::abm::TransportMode get_last_transport_mode() const
Get the transport mode the Person used to get to its current Location.
Definition: person.h:377
bool get_tested(PersonalRandomNumberGenerator &rng, TimePoint t, const TestParameters ¶ms)
Simulates a viral test and returns the test result of the Person.
Definition: person.cpp:165
std::vector< ProtectionEvent > & get_vaccinations()
Get all vaccinations of the Person.
Definition: person.h:85
std::vector< Infection > m_infections
Vector with all Infections the Person had.
Definition: person.h:454
TimePoint m_home_isolation_start
TimePoint when the Person started isolation at home.
Definition: person.h:455
ProtectionEvent get_latest_protection(TimePoint t) const
Get the latest ProtectionType and its initial TimePoint of the Person.
Definition: person.cpp:225
bool is_in_quarantine(TimePoint t, const Parameters ¶ms) const
Answers the question if a Person is currently in quarantine.
Definition: person.h:259
TestResult get_test_result(TestType type) const
Get the most recent TestResult performed from the Person based on the TestType.
Definition: person.cpp:275
bool goes_to_work(TimePoint t, const Parameters ¶ms) const
Draw if the Person goes to work or is in home office during lockdown at a specific TimePoint.
Definition: person.cpp:132
bool operator==(const Person &other) const
Compare two Persons.
Definition: person.h:68
PersonId m_person_id
Unique identifier of a person.
Definition: person.h:472
void add_new_infection(Infection &&inf)
Adds a new Infection to the list of Infections.
Definition: person.cpp:88
AgeGroup get_age() const
Get the AgeGroup of this Person.
Definition: person.h:120
void set_compliance(InterventionType intervention_type, ScalarType value)
For every InterventionType a Person has a compliance value between 0 and 1.
Definition: person.h:324
TimeSpan get_go_to_school_time(const Parameters ¶ms) const
Draw at what time the Person goes to work.
Definition: person.cpp:146
ScalarType get_mask_protective_factor(const Parameters ¶ms) const
Get the protection of the Mask.
Definition: person.cpp:214
ScalarType m_random_goto_work_hour
Value to determine at what time the Person goes to work.
Definition: person.h:462
CustomIndexArray< TestResult, TestType > m_test_results
CustomIndexArray for TestResults.
Definition: person.h:469
bool is_compliant(PersonalRandomNumberGenerator &rng, InterventionType intervention) const
Checks whether the Person complies an Intervention.
Definition: person.cpp:219
ScalarType m_random_workgroup
Value to determine if the Person goes to work or works from home during lockdown.
Definition: person.h:459
InfectionState get_infection_state(TimePoint t) const
Get the InfectionState of the Person at a specific TimePoint.
Definition: person.cpp:78
PersonId get_id() const
Get the PersonId of the Person.
Definition: person.cpp:199
LocationId get_location() const
Get the current Location of the Person.
Definition: person.cpp:93
void set_last_transport_mode(const mio::abm::TransportMode mode)
Set the transport mode the Person used to get to its current Location.
Definition: person.h:386
void set_assigned_location(LocationType type, LocationId id, int model_id)
Set an assigned Location of the Person.
Definition: person.cpp:116
Person(mio::RandomNumberGenerator &rng, LocationType location_type, LocationId location_id, int location_model_id, AgeGroup age, PersonId person_id=PersonId::invalid_ID())
Create a Person.
Definition: person.cpp:36
ScalarType get_compliance(InterventionType intervention_type) const
Get the compliance of the Person for an Intervention.
Definition: person.h:334
void add_time_at_location(const TimeSpan dt)
Add to the time the Person has been at its current Location.
Definition: person.h:162
ScalarType m_random_goto_school_hour
Value to determine at what time the Person goes to school.
Definition: person.h:463
mio::abm::TransportMode m_last_transport_mode
TransportMode the Person used to get to its current Location.
Definition: person.h:468
std::vector< int > m_assigned_location_model_ids
Vector with model ids of the assigned locations. Only used in graph abm.
Definition: person.h:471
void add_new_vaccination(ProtectionType v, TimePoint t)
Add a new vaccination.
Definition: person.h:368
TimeSpan m_time_at_location
Time the Person has spent at its current Location so far.
Definition: person.h:457
std::vector< uint32_t > & get_cells()
Get index of Cells of the Person.
Definition: person.cpp:204
const std::vector< int > & get_assigned_location_model_ids() const
Get the assigned locations' model ids of the Person.
Definition: person.h:210
void set_mask(MaskType type, TimePoint t)
Change the mask to new type.
Definition: person.cpp:264
LocationId get_assigned_location(LocationType type) const
Returns the index of an assigned Location of the Person.
Definition: person.cpp:122
LocationId m_location
Current Location of the Person.
Definition: person.h:448
ScalarType get_protection_factor(TimePoint t, VirusVariant virus, const Parameters ¶ms) const
Get the multiplicative factor on how likely an #Infection is due to the immune system.
Definition: person.cpp:253
void add_test_result(TimePoint t, TestType type, bool result)
Add TestResult to the Person.
Definition: person.cpp:269
auto default_serialize()
This method is used by the default serialization feature.
Definition: person.h:407
TimeSpan get_go_to_work_time(const Parameters ¶ms) const
Draw at what time the Person goes to work.
Definition: person.cpp:137
std::vector< ScalarType > m_compliance
Vector of compliance values for all InterventionTypes. Values from 0 to 1.
Definition: person.h:466
Random number generator of individual persons.
Definition: personal_rng.h:49
InterventionType
Type of an Intervention.
Definition: intervention_type.h:35
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
RandomNumberGenerator & thread_local_rng()
Definition: random_number_generator.cpp:25
Creates an instance of T for later initialization.
Definition: default_serialize.h:173
Members< ValueTypes..., T > add(const char *member_name, T &member)
Add a class member.
Definition: default_serialize.h:139
static const PersonId invalid_ID()
Value for invalid IDs.
Definition: person_id.h:47
Parameters that describe the reliability of a test.
Definition: abm/parameters.h:465
Generated by