Stride Reference Manual  - generated for commit 9643b11
HealthSeeder.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2018, Kuylen E, Willem L, Broeckhove J
14  */
15 
21 #pragma once
22 
23 #include <boost/property_tree/ptree_fwd.hpp>
24 #include <memory>
25 #include <string>
26 #include <vector>
27 
28 namespace stride {
29 
30 class ContactHandler;
31 class Population;
32 
37 {
38 public:
40  explicit HealthSeeder(const boost::property_tree::ptree& diseasePt);
41 
43  void Seed(const std::shared_ptr<Population>& pop, std::vector<ContactHandler>& handlers);
44 
45 private:
47  void GetDistribution(std::vector<double>& distribution, const boost::property_tree::ptree& rootPt,
48  const std::string& xmlTag);
49 
51  unsigned short int Sample(const std::vector<double>& distribution, double random01);
52 
53 private:
54  std::vector<double> m_start_symptomatic;
55  std::vector<double> m_time_asymptomatic;
56  std::vector<double> m_time_infectious;
57  std::vector<double> m_time_symptomatic;
58 };
59 
60 } // namespace stride
void Seed(const std::shared_ptr< Population > &pop, std::vector< ContactHandler > &handlers)
Seeds the population with Health data.
void GetDistribution(std::vector< double > &distribution, const boost::property_tree::ptree &rootPt, const std::string &xmlTag)
Utility method to etract distribution from data in ptree.
std::vector< double > m_time_symptomatic
Definition: HealthSeeder.h:57
std::vector< double > m_start_symptomatic
Definition: HealthSeeder.h:54
unsigned short int Sample(const std::vector< double > &distribution, double random01)
Sample for each of the health data item individually.
std::vector< double > m_time_asymptomatic
Definition: HealthSeeder.h:55
std::vector< double > m_time_infectious
Definition: HealthSeeder.h:56
HealthSeeder(const boost::property_tree::ptree &diseasePt)
Constructor requires diease data.
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
Seeds the population with Health data.
Definition: HealthSeeder.h:36