29 #include <unordered_map> 46 std::string name =
"",
unsigned int popCount = 0U);
107 template <str
ide::ContactType::Id T>
124 template <str
ide::ContactType::Id T>
138 template <str
ide::ContactType::Id T>
unsigned int GetID() const
Gets ID of this Location.
Id
Enumerates the ContactPool types.
void AddIncomingCommute(std::shared_ptr< Location > otherLocation, double fraction)
Adds a Location and a proportion to the incoming commute vector.
void RegisterPool(stride::ContactPool *p)
Templated version of .
std::string GetName() const
Gets the name.
A group of Persons that potentially have contacts with one another.
stride::ContactType::IdSubscriptArray< stride::util::SegmentedVector< stride::ContactPool * > > m_pool_index
stride::util::SegmentedVector< stride::ContactPool * > & RefPools(stride::ContactType::Id id)
Access through reference to ContactPools of type 'id'.
double GetPopFraction() const
Get Location's population fraction (of the total populaion count).
int GetIncomingCommuteCount(double fractionCommuters) const
Calculates number of incomming commuters, given the fraction of the population that commutes...
unsigned int GetProvince() const
Gets the province.
unsigned int m_pop_count
Population count (number of individuals) at this Location.
Coordinate m_coordinate
Coordinate of the Location.
Interface and implementation for SegmentedVector class.
std::vector< std::pair< Location *, double > > m_outCommutes
The system holding pointers to the contactpools (for each type id) at this Location.
void RegisterPool(stride::ContactPool *p, stride::ContactType::Id typeId)
Register a ContactPool pointer in this Location's pool system.
double m_pop_fraction
Fraction of whole population at this Location.
std::vector< std::pair< Location *, double > > m_inCommutes
Incomming commutes stored as pair of Location and fraction of population at that Location.
void SetPopCount(unsigned int totalPopCount)
Set Location's population count using its population fraction and the total population count...
Container that stores objects "almost contiguously" (in a chain of blocks) and guarantees that pointe...
Definition of ContactPool Id Type.
unsigned int GetInfectedCount() const
Gets the number of people infected in the contactpools at this location.
Namespace for the geographic and demograhic classes.
Container for the contact pools of various type (household, work, ...).
const Coordinate GetCoordinate() const
Gets the Coordinate of this Location.
void AddOutgoingCommute(std::shared_ptr< Location > otherLocation, double fraction)
Adds a Location and a fraction to the outgoing commute vector.
An std::array modified to enable subscripting with the constact pool type indentifiers.
Location(unsigned int id, unsigned int province, Coordinate coordinate=Coordinate(0.0, 0.0), std::string name="", unsigned int popCount=0U)
Parametrized constructor with population count.
stride::util::SegmentedVector< stride::ContactPool * > & RefPools()
Templated version of for use when the type id is fixed.
void SetPopFraction(double relativePopulation)
Set Location's population fraction (of the total populaion count).
boost::geometry::model::point< double, 2, boost::geometry::cs::geographic< boost::geometry::degree >> Coordinate
const std::vector< std::pair< Location *, double > > & CRefIncomingCommutes() const
References incoming commute Locations + fraction of commutes to that Location.
unsigned int GetPopCount() const
Gets the absolute population.
bool operator==(const Location &other) const
Perform a full comparison with the other location.
const stride::util::SegmentedVector< stride::ContactPool * > & CRefPools(stride::ContactType::Id id) const
Access through const reference to ContactPools of type 'id'.
const stride::util::SegmentedVector< stride::ContactPool * > & CRefPools() const
Templated version of for use when the type id is fixed.
void SetCoordinate(const Coordinate &coordinate)
Sets the Coordinate of this Location.
Location for use within the GeoGrid, contains Coordinate and index to ContactPools.
unsigned int m_province
Province id.
Namespace for the simulator and related classes.
unsigned int GetOutgoingCommuteCount(double fractionCommuters) const
Calculates number of outgoing commuters, given the fraction of the population that commutes...
const std::vector< std::pair< Location *, double > > & CRefOutgoingCommutes() const
References outgoing commute Locations + fraction of commutes to that Location.