Stride Reference Manual  1.0
stride::PopulationBuilder Class Reference

Initializes Population objects. More...

#include <PopulationBuilder.h>

Collaboration diagram for stride::PopulationBuilder:
Collaboration graph

Static Public Member Functions

static std::shared_ptr< Populationbuild (const boost::property_tree::ptree &pt_config, const boost::property_tree::ptree &pt_disease, const boost::property_tree::ptree &pt_pop, util::Random &rng)
 Initializes a Population: add persons, set immunity, seed infection. More...
 

Static Private Member Functions

static std::vector< doublegetDistribution (const boost::property_tree::ptree &pt_root, const std::string &xml_tag)
 Get distribution associateed with tag values. More...
 
static unsigned int sample (util::Random &rng, const std::vector< double > &distribution)
 Sample from the distribution. More...
 

Detailed Description

Initializes Population objects.

Definition at line 38 of file PopulationBuilder.h.

Member Function Documentation

shared_ptr< Population > stride::PopulationBuilder::build ( const boost::property_tree::ptree &  pt_config,
const boost::property_tree::ptree &  pt_disease,
const boost::property_tree::ptree &  pt_pop,
util::Random rng 
)
static

Initializes a Population: add persons, set immunity, seed infection.

Parameters
pt_configProperty_tree with generalconfiguration settings.
pt_diseaseProperty_tree with disease configuration settings.
Returns
Pointer to the initialized population.

Definition at line 35 of file PopulationBuilder.cpp.

References stride::util::InstallDirs::getDataDir(), stride::Person< BehaviourPolicy, BeliefPolicy >::getHealth(), stride::Person< BehaviourPolicy, BeliefPolicy >::isParticipatingInSurvey(), stride::Health::isSusceptible(), stride::Person< BehaviourPolicy, BeliefPolicy >::participateInSurvey(), stride::Health::setImmune(), stride::util::StringUtils::split(), and stride::Health::startInfection().

vector< double > stride::PopulationBuilder::getDistribution ( const boost::property_tree::ptree &  pt_root,
const std::string &  xml_tag 
)
staticprivate

Get distribution associateed with tag values.

Definition at line 165 of file PopulationBuilder.cpp.

unsigned int stride::PopulationBuilder::sample ( util::Random rng,
const std::vector< double > &  distribution 
)
staticprivate

Sample from the distribution.

Definition at line 174 of file PopulationBuilder.cpp.

References stride::util::Random::nextDouble().


The documentation for this class was generated from the following files: