Stride Reference Manual
- generated for commit 9643b11
|
Key Data structure: container for (a) all individuals in the population (b) the ContactPoolSys wchich is used to loop over ContactPools of each type (c) (if present) GeoGrid of Locations, each having an index of ContactPools at that location. More...
#include <Population.h>
Public Member Functions | |
Person * | CreatePerson (unsigned int id, double age, unsigned int householdId, unsigned int k12SchoolId, unsigned int collegeId, unsigned int workId, unsigned int primaryCommunityId, unsigned int secondaryCommunityId) |
Create Person in the population. More... | |
unsigned int | GetInfectedCount () const |
Get the cumulative number of cases. More... | |
const ContactPoolSys & | CRefPoolSys () const |
The ContactPoolSys of the simulator. More... | |
const geopop::GeoGrid & | CRefGeoGrid () const |
Get the GeoGrid associated with this population (may be a nullptr). More... | |
std::shared_ptr< spdlog::logger > & | RefContactLogger () |
Return the contactlogger. More... | |
ContactPoolSys & | RefPoolSys () |
Reference the ContactPoolSys of the Population. More... | |
geopop::GeoGrid & | RefGeoGrid () |
Reference the GeoGrid associated with this population (may be a nullptr). More... | |
![]() | |
SegmentedVector () | |
Construct empty SegmentedVector. More... | |
SegmentedVector (size_type i) | |
Construct with given number of elements but DO NOT INITIALIZE them. More... | |
SegmentedVector (size_type i, const value_type &value) | |
Construct with given number of elements and INITIALIZE them with value. More... | |
SegmentedVector (const self_type &other) | |
Copy constructor. More... | |
SegmentedVector (self_type &&other) noexcept | |
Move constructor. More... | |
SegmentedVector & | operator= (const self_type &other) |
Copy assignment. More... | |
SegmentedVector & | operator= (self_type &&other) noexcept |
Move assignment. More... | |
~SegmentedVector () | |
Destructor. More... | |
Person & | at (std::size_t pos) |
Access specified element with bounds checking. More... | |
const Person & | at (std::size_t pos) const |
Access specified element with bounds checking. More... | |
Person & | back () |
Access the last element. More... | |
const Person & | back () const |
Access the last element. More... | |
Person & | operator[] (size_t pos) |
Access specified element (no bounds checking). More... | |
const Person & | operator[] (size_t pos) const |
Access specified element (no bounds checking). More... | |
iterator | begin () |
Returns an iterator to the beginning of the container. More... | |
const_iterator | begin () const |
Returns a const_iterator to the beginning of the container. More... | |
const_iterator | cbegin () const |
Returns a const_iterator to the beginning of the container. More... | |
iterator | end () |
Returns an iterator to the end of the container. More... | |
const_iterator | end () const |
Returns a const_iterator to the end of the container. More... | |
const_iterator | cend () const |
Returns a const_iterator to the end. More... | |
std::size_t | capacity () const |
Returns number of elements that can be stored without allocating additional blocks. More... | |
bool | empty () const |
Checks whether container is empty. More... | |
std::size_t | get_block_count () const |
Returns number of currently allocated blocks. More... | |
std::size_t | get_elements_per_block () const |
Returns number of elements block (template parameter 'N'). More... | |
std::size_t | size () const |
Returns the number of elements. More... | |
void | resize (size_type new_size) |
Increases the number of elements (but DOES NOT INITIALIZE the additional elements) or pops elements (and DOES RUN those element's destructor). More... | |
void | resize (size_type new_size, const value_type &value) |
void | clear () |
Clears the content. More... | |
Person * | emplace (size_type pos, Args &&...args) |
Constructs element in-place at position pos. More... | |
Person * | emplace_back (Args &&...args) |
Constructs element in-place at the end. More... | |
void | pop_back () |
Removes the last element. More... | |
Person * | push_back (const Person &obj) |
Adds element to end. More... | |
Person * | push_back (Person &&obj) |
Adds element to end. More... | |
Static Public Member Functions | |
static std::shared_ptr< Population > | Create (const boost::property_tree::ptree &config, util::RnMan rnMan, std::shared_ptr< spdlog::logger > strideLogger=nullptr) |
Create a Population initialized by the configuration in property tree. More... | |
static std::shared_ptr< Population > | Create (const std::string &configString, util::RnMan rnMan, std::shared_ptr< spdlog::logger > stride_logger=nullptr) |
For use in python environment: create Population using configuration string i.o ptree. More... | |
static std::shared_ptr< Population > | Create () |
Create an empty Population, used in gengeopop. More... | |
Private Member Functions | |
Population () | |
Non-trivial default constructor. More... | |
Private Attributes | |
ContactPoolSys | m_pool_sys |
The global . More... | |
std::shared_ptr< spdlog::logger > | m_contact_logger |
Logger for contact/transmission. More... | |
geopop::GeoGrid | m_geo_grid |
Associated may be nullptr. More... | |
Additional Inherited Members | |
![]() | |
using | value_type = Person |
using | size_type = std::size_t |
using | self_type = SegmentedVector< Person, N > |
using | iterator = SVIterator< Person, N, true, Person *, Person &, false > |
using | const_iterator = SVIterator< Person, N, true > |
Key Data structure: container for (a) all individuals in the population (b) the ContactPoolSys wchich is used to loop over ContactPools of each type (c) (if present) GeoGrid of Locations, each having an index of ContactPools at that location.
Definition at line 47 of file Population.h.
|
private |
Non-trivial default constructor.
Definition at line 45 of file Population.cpp.
|
static |
Create a Population initialized by the configuration in property tree.
Definition at line 47 of file Population.cpp.
References stride::ImportPopBuilder::Build(), stride::DefaultPopBuilder::Build(), stride::GeoPopBuilder::Build(), stride::util::FileSys::BuildPath(), Create(), stride::util::LogUtils::CreateNullLogger(), and stride::util::LogUtils::CreateRotatingLogger().
|
static |
For use in python environment: create Population using configuration string i.o ptree.
Definition at line 90 of file Population.cpp.
References Create(), and stride::util::RunConfigManager::FromString().
|
static |
Create an empty Population, used in gengeopop.
Definition at line 96 of file Population.cpp.
Referenced by stride::GenPopController::Control(), stride::SimController::Control(), stride::StanController::Control(), and Create().
Person * stride::Population::CreatePerson | ( | unsigned int | id, |
double | age, | ||
unsigned int | householdId, | ||
unsigned int | k12SchoolId, | ||
unsigned int | collegeId, | ||
unsigned int | workId, | ||
unsigned int | primaryCommunityId, | ||
unsigned int | secondaryCommunityId | ||
) |
Create Person in the population.
Definition at line 108 of file Population.cpp.
References stride::util::SegmentedVector< Person, 2048 >::emplace_back().
Referenced by geopop::Populator< ID >::Apply(), geopop::GeoGridJSONReader::ParsePerson(), and geopop::GeoGridProtoReader::ParsePerson().
unsigned int stride::Population::GetInfectedCount | ( | ) | const |
Get the cumulative number of cases.
Definition at line 116 of file Population.cpp.
|
inline |
The ContactPoolSys of the simulator.
Definition at line 71 of file Population.h.
Referenced by stride::SurveySeeder::Seed().
|
inline |
Get the GeoGrid associated with this population (may be a nullptr).
Definition at line 74 of file Population.h.
|
inline |
Return the contactlogger.
Definition at line 77 of file Population.h.
Referenced by stride::SurveySeeder::Seed(), and stride::Sim::TimeStep().
|
inline |
Reference the ContactPoolSys of the Population.
Definition at line 80 of file Population.h.
Referenced by geopop::Generator< ID >::AddPools(), geopop::GeoGridJSONReader::ParseContactPool(), geopop::GeoGridProtoReader::ParseContactPool(), and stride::Sim::TimeStep().
|
inline |
Reference the GeoGrid associated with this population (may be a nullptr).
Definition at line 83 of file Population.h.
Referenced by geopop::GeoGridJSONReader::Read(), and geopop::GeoGridProtoReader::Read().
|
private |
The global .
Definition at line 90 of file Population.h.
|
private |
Logger for contact/transmission.
Definition at line 91 of file Population.h.
|
private |
Associated may be nullptr.
Definition at line 92 of file Population.h.