31 : m_coordinate(coordinate), m_id(id), m_name(move(name)), m_pop_count(popCount), m_pop_fraction(0.0),
32 m_province(province), m_inCommutes(), m_outCommutes(), m_pool_index()
38 using boost::geometry::get;
53 m_inCommutes.emplace_back(otherLocation.get(), fraction);
66 value += locProportion.second * (fractionCommuters * (
double)locProportion.first->GetPopCount());
68 return static_cast<int>(floor(value));
73 unsigned int total{0U};
74 for (
const auto& pool : CRefPools<Id::Household>()) {
75 for (
const auto& person : *pool) {
76 const auto& h = person->GetHealth();
77 total += h.IsInfected() || h.IsRecovered();
85 double totalProportion = 0;
88 totalProportion += locProportion.second;
90 return static_cast<unsigned int>(floor(totalProportion * (fractionCommuters *
m_pop_count)));
unsigned int GetID() const
Gets ID of this Location.
void AddIncomingCommute(std::shared_ptr< Location > otherLocation, double fraction)
Adds a Location and a proportion to the incoming commute vector.
std::string GetName() const
Gets the name.
Header file for the Person class.
Header for the core ContactPool class.
double GetPopFraction() const
Get Location's population fraction (of the total populaion count).
constexpr std::initializer_list< Id > IdList
To allow iteration over the type ids.
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.
std::vector< std::pair< Location *, double > > m_outCommutes
The system holding pointers to the contactpools (for each type id) at this Location.
double m_pop_fraction
Fraction of whole population at this Location.
Header for the Health class.
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...
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.
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.
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.
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.
Location for use within the GeoGrid, contains Coordinate and index to ContactPools.
unsigned int GetOutgoingCommuteCount(double fractionCommuters) const
Calculates number of outgoing commuters, given the fraction of the population that commutes...
Namespace to manage types of ContactPool.
const std::vector< std::pair< Location *, double > > & CRefOutgoingCommutes() const
References outgoing commute Locations + fraction of commutes to that Location.