Stride Reference Manual  - generated for commit 9643b11
stride::Population Class Reference

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>

Inheritance diagram for stride::Population:
Inheritance graph
Collaboration diagram for stride::Population:
Collaboration graph

Public Member Functions

PersonCreatePerson (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 ContactPoolSysCRefPoolSys () const
 The ContactPoolSys of the simulator. More...
 
const geopop::GeoGridCRefGeoGrid () const
 Get the GeoGrid associated with this population (may be a nullptr). More...
 
std::shared_ptr< spdlog::logger > & RefContactLogger ()
 Return the contactlogger. More...
 
ContactPoolSysRefPoolSys ()
 Reference the ContactPoolSys of the Population. More...
 
geopop::GeoGridRefGeoGrid ()
 Reference the GeoGrid associated with this population (may be a nullptr). More...
 
- Public Member Functions inherited from stride::util::SegmentedVector< Person, 2048 >
 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...
 
SegmentedVectoroperator= (const self_type &other)
 Copy assignment. More...
 
SegmentedVectoroperator= (self_type &&other) noexcept
 Move assignment. More...
 
 ~SegmentedVector ()
 Destructor. More...
 
Personat (std::size_t pos)
 Access specified element with bounds checking. More...
 
const Personat (std::size_t pos) const
 Access specified element with bounds checking. More...
 
Personback ()
 Access the last element. More...
 
const Personback () const
 Access the last element. More...
 
Personoperator[] (size_t pos)
 Access specified element (no bounds checking). More...
 
const Personoperator[] (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...
 
Personemplace (size_type pos, Args &&...args)
 Constructs element in-place at position pos. More...
 
Personemplace_back (Args &&...args)
 Constructs element in-place at the end. More...
 
void pop_back ()
 Removes the last element. More...
 
Personpush_back (const Person &obj)
 Adds element to end. More...
 
Personpush_back (Person &&obj)
 Adds element to end. More...
 

Static Public Member Functions

static std::shared_ptr< PopulationCreate (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< PopulationCreate (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< PopulationCreate ()
 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

- Public Types inherited from stride::util::SegmentedVector< Person, 2048 >
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 >
 

Detailed Description

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.

Constructor & Destructor Documentation

stride::Population::Population ( )
private

Non-trivial default constructor.

Definition at line 45 of file Population.cpp.

Member Function Documentation

std::shared_ptr< Population > stride::Population::Create ( const boost::property_tree::ptree &  config,
util::RnMan  rnMan,
std::shared_ptr< spdlog::logger >  strideLogger = nullptr 
)
static
std::shared_ptr< Population > stride::Population::Create ( const std::string &  configString,
util::RnMan  rnMan,
std::shared_ptr< spdlog::logger >  stride_logger = nullptr 
)
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().

Here is the call graph for this function:

std::shared_ptr< Population > stride::Population::Create ( )
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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int stride::Population::GetInfectedCount ( ) const

Get the cumulative number of cases.

Definition at line 116 of file Population.cpp.

const ContactPoolSys& stride::Population::CRefPoolSys ( ) const
inline

The ContactPoolSys of the simulator.

Definition at line 71 of file Population.h.

Referenced by stride::SurveySeeder::Seed().

Here is the caller graph for this function:

const geopop::GeoGrid& stride::Population::CRefGeoGrid ( ) const
inline

Get the GeoGrid associated with this population (may be a nullptr).

Definition at line 74 of file Population.h.

std::shared_ptr<spdlog::logger>& stride::Population::RefContactLogger ( )
inline

Return the contactlogger.

Definition at line 77 of file Population.h.

Referenced by stride::SurveySeeder::Seed(), and stride::Sim::TimeStep().

Here is the caller graph for this function:

ContactPoolSys& stride::Population::RefPoolSys ( )
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().

Here is the caller graph for this function:

geopop::GeoGrid& stride::Population::RefGeoGrid ( )
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().

Here is the caller graph for this function:

Member Data Documentation

ContactPoolSys stride::Population::m_pool_sys
private

The global .

Definition at line 90 of file Population.h.

std::shared_ptr<spdlog::logger> stride::Population::m_contact_logger
private

Logger for contact/transmission.

Definition at line 91 of file Population.h.

geopop::GeoGrid stride::Population::m_geo_grid
private

Associated may be nullptr.

Definition at line 92 of file Population.h.


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