person.h Source File
|
CPP API
|
person.h
Go to the documentation of this file.
61 explicit Person(mio::RandomNumberGenerator& rng, LocationType location_type, LocationId location_id,
362 ScalarType get_protection_factor(TimePoint t, VirusVariant virus, const Parameters& params) const;
505 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:51
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:158
Counter< uint32_t > & get_rng_counter()
Get this persons RandomNumberGenerator counter.
Definition: person.h:396
mio::Key< uint64_t > get_rng_key()
Get this Person's key that is used for the RandomNumberGenerator.
Definition: person.h:414
LocationType m_location_type
Type of the current Location.
Definition: person.h:469
void set_location(LocationType type, LocationId id, int model_id)
Change the location of the person.
Definition: person.cpp:101
int m_location_model_id
Model id of the current Location. Only used for Graph ABM.
Definition: person.h:470
void remove_quarantine()
Removes the quarantine status of the Person.
Definition: person.cpp:163
Infection & get_infection()
Get the latest #Infection of the Person.
Definition: person.cpp:114
uint32_t get_rng_index()
Get this Person's index that is used for the RandomNumberGenerator.
Definition: person.h:405
ScalarType m_random_schoolgroup
Value to determine if the Person goes to school or stays at home during lockdown.
Definition: person.h:481
const std::vector< LocationId > & get_assigned_locations() const
Get the assigned Locations of the Person.
Definition: person.h:194
uint32_t m_rng_index
Index for PersonalRandomNumberGenerator.
Definition: person.h:494
Counter< uint32_t > m_rng_counter
counter for RandomNumberGenerator.
Definition: person.h:495
Mask & get_mask()
Get the current Mask of the Person.
Definition: person.h:299
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:473
const std::vector< ProtectionEvent > & get_vaccinations() const
Get all vaccinations of the Person.
Definition: person.h:91
int get_assigned_location_model_id(LocationType type) const
Returns the model id of an assigned location of the Person.
Definition: person.cpp:130
std::vector< LocationId > m_assigned_locations
Definition: person.h:471
bool is_infected(TimePoint t) const
Returns if the Person is infected at the TimePoint.
Definition: person.cpp:68
std::vector< uint32_t > m_cells
Vector with all Cells the Person visits at its current Location.
Definition: person.h:487
TimeSpan get_time_at_location() const
Get the time the Person has been at its current Location.
Definition: person.h:154
mio::abm::TransportMode get_last_transport_mode() const
Get the transport mode the Person used to get to its current Location.
Definition: person.h:378
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:168
std::vector< ProtectionEvent > & get_vaccinations()
Get all vaccinations of the Person.
Definition: person.h:86
std::vector< Infection > m_infections
Vector with all Infections the Person had.
Definition: person.h:474
TimePoint m_home_isolation_start
TimePoint when the Person started isolation at home.
Definition: person.h:475
ProtectionEvent get_latest_protection(TimePoint t) const
Get the latest ProtectionType and its initial TimePoint of the Person.
Definition: person.cpp:228
bool is_in_quarantine(TimePoint t, const Parameters ¶ms) const
Answers the question if a Person is currently in quarantine.
Definition: person.h:260
TestResult get_test_result(TestType type) const
Get the most recent TestResult performed from the Person based on the TestType.
Definition: person.cpp:278
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:135
bool operator==(const Person &other) const
Compare two Persons.
Definition: person.h:69
PersonId m_person_id
Unique identifier of a person.
Definition: person.h:492
mio::Key< uint64_t > m_rng_key
Key for PersonalRandomNumberGenerator.
Definition: person.h:493
void add_new_infection(Infection &&inf)
Adds a new Infection to the list of Infections.
Definition: person.cpp:91
AgeGroup get_age() const
Get the AgeGroup of this Person.
Definition: person.h:121
void set_compliance(InterventionType intervention_type, ScalarType value)
For every InterventionType a Person has a compliance value between 0 and 1.
Definition: person.h:325
TimeSpan get_go_to_school_time(const Parameters ¶ms) const
Draw at what time the Person goes to work.
Definition: person.cpp:149
ScalarType get_mask_protective_factor(const Parameters ¶ms) const
Get the protection of the Mask.
Definition: person.cpp:217
ScalarType m_random_goto_work_hour
Value to determine at what time the Person goes to work.
Definition: person.h:482
CustomIndexArray< TestResult, TestType > m_test_results
CustomIndexArray for TestResults.
Definition: person.h:489
bool is_compliant(PersonalRandomNumberGenerator &rng, InterventionType intervention) const
Checks whether the Person complies an Intervention.
Definition: person.cpp:222
ScalarType m_random_workgroup
Value to determine if the Person goes to work or works from home during lockdown.
Definition: person.h:479
InfectionState get_infection_state(TimePoint t) const
Get the InfectionState of the Person at a specific TimePoint.
Definition: person.cpp:81
PersonId get_id() const
Get the PersonId of the Person.
Definition: person.cpp:202
LocationId get_location() const
Get the current Location of the Person.
Definition: person.cpp:96
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:387
void set_assigned_location(LocationType type, LocationId id, int model_id)
Set an assigned Location of the Person.
Definition: person.cpp:119
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:335
void add_time_at_location(const TimeSpan dt)
Add to the time the Person has been at its current Location.
Definition: person.h:163
ScalarType m_random_goto_school_hour
Value to determine at what time the Person goes to school.
Definition: person.h:483
mio::abm::TransportMode m_last_transport_mode
TransportMode the Person used to get to its current Location.
Definition: person.h:488
std::vector< int > m_assigned_location_model_ids
Vector with model ids of the assigned locations. Only used in graph abm.
Definition: person.h:491
void add_new_vaccination(ProtectionType v, TimePoint t)
Add a new vaccination.
Definition: person.h:369
TimeSpan m_time_at_location
Time the Person has spent at its current Location so far.
Definition: person.h:477
std::vector< uint32_t > & get_cells()
Get index of Cells of the Person.
Definition: person.cpp:207
const std::vector< int > & get_assigned_location_model_ids() const
Get the assigned locations' model ids of the Person.
Definition: person.h:211
void set_mask(MaskType type, TimePoint t)
Change the mask to new type.
Definition: person.cpp:267
LocationId get_assigned_location(LocationType type) const
Returns the index of an assigned Location of the Person.
Definition: person.cpp:125
LocationId m_location
Current Location of the Person.
Definition: person.h:468
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:256
void add_test_result(TimePoint t, TestType type, bool result)
Add TestResult to the Person.
Definition: person.cpp:272
auto default_serialize()
This method is used by the default serialization feature.
Definition: person.h:426
TimeSpan get_go_to_work_time(const Parameters ¶ms) const
Draw at what time the Person goes to work.
Definition: person.cpp:140
std::vector< ScalarType > m_compliance
Vector of compliance values for all InterventionTypes. Values from 0 to 1.
Definition: person.h:486
Random number generator of individual persons.
Definition: personal_rng.h:50
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
The AgeGroup struct is used as a dynamically sized tag for all age dependent categories.
Definition: age_group.h:32
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