36 const auto WorkplacesCount =
37 static_cast<unsigned int>(ceil(EmployeeCount / static_cast<double>(ggConfig.
people[Id::Workplace])));
40 vector<double> weights;
41 for (
const auto& loc : geoGrid) {
42 const double ActivePeopleCount =
48 const double weight = ActivePeopleCount / EmployeeCount;
49 AssertThrow(weight >= 0 && weight <= 1 && !std::isnan(weight),
"Invalid weight: " + to_string(weight),
51 weights.push_back(weight);
54 if (weights.empty()) {
59 const auto dist = m_rn_man.GetDiscreteGenerator(weights, 0U);
60 auto pop = geoGrid.GetPopulation();
62 for (
auto i = 0U; i < WorkplacesCount; i++) {
63 const auto loc = geoGrid[dist()];
64 AddPools(*loc, pop, ggConfig);
struct geopop::GeoGridConfig::@2 info
Configuration data mostly for generating a population, but also for computing the required number of ...
double particpation_workplace
Participation of workplace (fraction of people of work age and not going to college and having employ...
#define AssertThrow(CONDITION, MESSAGE, LOGGER)
A Geographic grid of simulation region contains Locations that in turn contain an index to the Contac...
unsigned int popcount_workplace
Number of individuals in Workplace.
Namespace for the geographic and demograhic classes.
stride::ContactType::IdSubscriptArray< unsigned int > people
People per unit (= Household, K12School, College, etc.) for each of the ContactTypes.
struct geopop::GeoGridConfig::@0 param
void Apply(GeoGrid &, const GeoGridConfig &)
Generate ContactPools for ContactType::Id as sepcified by data in GeoGridConfig.
double fraction_workplace_commuters
Fraction of people in the workplace that commute.
Namespace for the simulator and related classes.
Namespace to manage types of ContactPool.