|
Stride Reference Manual
1.0
|
Represents a location for social contacts, an group of people. More...
#include <Cluster.h>

Public Member Functions | |
| Cluster (std::size_t cluster_id, ClusterType cluster_type, GeoCoordinate coordinate=GeoCoordinate(0, 0)) | |
| Constructor. More... | |
| void | addPerson (Simulator::PersonType *p) |
| Add the given Person to the Cluster. More... | |
| void | removePerson (unsigned int id) |
| Remove the given Person from the Cluster. More... | |
| std::size_t | getSize () const |
| Return number of persons in this cluster. More... | |
| std::size_t | getActiveClusterMembers () const |
| Return number of persons in this cluster. More... | |
| std::size_t | getInfectedCount () const |
| Return the amount of infected people in this cluster. More... | |
| ClusterType | getClusterType () const |
| Return the type of this cluster. More... | |
| GeoCoordinate | getLocation () const |
| Return the geo coordinates (latitude-longitude) of the cluster. More... | |
| double | getContactRate (const Simulator::PersonType *p) const |
| Get basic contact rate in this cluster. More... | |
| std::size_t | getId () const |
| Get the ID of this cluster. More... | |
| const std::vector< std::pair< Simulator::PersonType *, bool > > & | getMembers () const |
| Get the members of this vector Rather for testing purposes. More... | |
Static Public Member Functions | |
| static void | addContactProfile (ClusterType cluster_type, const ContactProfile &profile) |
| Add contact profile. More... | |
Private Member Functions | |
| std::tuple< bool, size_t > | sortMembers () |
| Sort members w.r.t. health status (order: exposed/infected/recovered, susceptible, immune). More... | |
| void | updateMemberPresence () |
| Calculate which members are present in the cluster on the current day. More... | |
Private Attributes | |
| std::size_t | m_cluster_id |
| The ID of the Cluster (for logging purposes). More... | |
| ClusterType | m_cluster_type |
| The type of the Cluster (for logging purposes). More... | |
| std::size_t | m_index_immune |
| Index of the first immune member in the Cluster. More... | |
| std::vector< std::pair< Simulator::PersonType *, bool > > | m_members |
| Container with pointers to Cluster members. More... | |
| const ContactProfile & | m_profile |
| const GeoCoordinate | m_coordinate |
| The location of the cluster. More... | |
Static Private Attributes | |
| static std::array< ContactProfile, numOfClusterTypes()> | g_profiles |
Friends | |
| template<LogMode log_level, bool track_index_case, typename local_information_policy > | |
| class | Infector |
| Infector calculates contacts and transmissions. More... | |
| class | Hdf5Loader |
| class | Hdf5Saver |
Represents a location for social contacts, an group of people.
| stride::Cluster::Cluster | ( | std::size_t | cluster_id, |
| ClusterType | cluster_type, | ||
| GeoCoordinate | coordinate = GeoCoordinate(0, 0) |
||
| ) |
Constructor.
Definition at line 34 of file Cluster.cpp.
| void stride::Cluster::addPerson | ( | Simulator::PersonType * | p | ) |
Add the given Person to the Cluster.
Definition at line 45 of file Cluster.cpp.
References m_index_immune, and m_members.
| void stride::Cluster::removePerson | ( | unsigned int | id | ) |
Remove the given Person from the Cluster.
Definition at line 60 of file Cluster.cpp.
References m_index_immune, and m_members.
|
inline |
Return number of persons in this cluster.
Definition at line 58 of file Cluster.h.
Referenced by stride::ClusterSaver::getClusterJSON(), and stride::ClusterSaver::saveClusterCSV().
| std::size_t stride::Cluster::getActiveClusterMembers | ( | ) | const |
Return number of persons in this cluster.
Definition at line 70 of file Cluster.cpp.
References m_members.
| std::size_t stride::Cluster::getInfectedCount | ( | ) | const |
Return the amount of infected people in this cluster.
Definition at line 50 of file Cluster.cpp.
References m_members.
Referenced by stride::ClusterSaver::getClusterJSON(), and stride::ClusterSaver::saveClusterCSV().
|
inline |
Return the type of this cluster.
Definition at line 67 of file Cluster.h.
Referenced by stride::ClusterSaver::getClusterJSON(), and stride::ClusterSaver::saveClusterCSV().
|
inline |
Return the geo coordinates (latitude-longitude) of the cluster.
Definition at line 70 of file Cluster.h.
Referenced by stride::ClusterSaver::getClusterJSON(), and stride::ClusterSaver::saveClusterCSV().
|
inline |
Get basic contact rate in this cluster.
Definition at line 73 of file Cluster.h.
References stride::effectiveAge(), stride::Person< BehaviourPolicy, BeliefPolicy >::getAge(), and stride::toSizeType().
Referenced by stride::Infector< log_level, track_index_case, local_information_policy >::execute(), stride::Infector< log_level, track_index_case, NoLocalInformation >::execute(), and stride::Infector< LogMode::Contacts, track_index_case, NoLocalInformation >::execute().
|
inline |
Get the ID of this cluster.
Definition at line 78 of file Cluster.h.
Referenced by stride::ClusterSaver::getClusterJSON(), and stride::ClusterSaver::saveClusterCSV().
|
inline |
|
static |
Add contact profile.
Definition at line 40 of file Cluster.cpp.
References g_profiles, and stride::toSizeType().
|
private |
Sort members w.r.t. health status (order: exposed/infected/recovered, susceptible, immune).
Definition at line 81 of file Cluster.cpp.
References m_index_immune, and m_members.
Referenced by stride::Infector< log_level, track_index_case, NoLocalInformation >::execute().
|
private |
Calculate which members are present in the cluster on the current day.
Definition at line 115 of file Cluster.cpp.
References m_cluster_type, and m_members.
Referenced by stride::Infector< log_level, track_index_case, local_information_policy >::execute(), stride::Infector< log_level, track_index_case, NoLocalInformation >::execute(), and stride::Infector< LogMode::Contacts, track_index_case, NoLocalInformation >::execute().
|
friend |
|
friend |
|
private |
|
private |
The type of the Cluster (for logging purposes).
Definition at line 101 of file Cluster.h.
Referenced by stride::Infector< log_level, track_index_case, local_information_policy >::execute(), stride::Infector< log_level, track_index_case, NoLocalInformation >::execute(), stride::Infector< LogMode::Contacts, track_index_case, NoLocalInformation >::execute(), and updateMemberPresence().
|
private |
Index of the first immune member in the Cluster.
Definition at line 102 of file Cluster.h.
Referenced by addPerson(), stride::Infector< log_level, track_index_case, NoLocalInformation >::execute(), removePerson(), and sortMembers().
|
private |
Container with pointers to Cluster members.
Definition at line 103 of file Cluster.h.
Referenced by addPerson(), stride::Infector< log_level, track_index_case, local_information_policy >::execute(), stride::Infector< log_level, track_index_case, NoLocalInformation >::execute(), stride::Infector< LogMode::Contacts, track_index_case, NoLocalInformation >::execute(), getActiveClusterMembers(), getInfectedCount(), removePerson(), sortMembers(), and updateMemberPresence().
|
private |
|
private |
|
staticprivate |
Definition at line 107 of file Cluster.h.
Referenced by addContactProfile().