Stride Reference Manual  - generated for commit 9643b11
Infector.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 2017, Kuylen E, Willem L, Broeckhove J
14  */
15 
21 #pragma once
22 
23 #include "ContactLogMode.h"
24 #include "TransmissionProfile.h"
25 #include "calendar/Calendar.h"
27 #include "contact/ContactHandler.h"
28 
29 #include <memory>
30 #include <spdlog/spdlog.h>
31 
32 namespace {
33 
34 using namespace stride;
35 
38 template <ContactLogMode::Id LL>
39 struct UseOptimizedInfector
40 {
41  static constexpr bool value = false;
42 };
43 
45 template <>
46 struct UseOptimizedInfector<ContactLogMode::Id::None>
47 {
48  static constexpr bool value = true;
49 };
50 
52 template <>
53 struct UseOptimizedInfector<ContactLogMode::Id::Transmissions>
54 {
55  static constexpr bool value = true;
56 };
57 
58 } // namespace
59 
60 namespace stride {
61 
62 class ContactPool;
63 
68 template <ContactLogMode::Id LL, bool TIC, bool TO = UseOptimizedInfector<LL>::value>
69 class Infector
70 {
71 public:
73  static void Exec(ContactPool& pool, const AgeContactProfile& profile, const TransmissionProfile& transProfile,
74  ContactHandler& cHandler, unsigned short int simDay, std::shared_ptr<spdlog::logger> cLogger);
75 };
76 
80 template <ContactLogMode::Id LL, bool TIC>
81 class Infector<LL, TIC, true>
82 {
83 public:
85  static void Exec(ContactPool& pool, const AgeContactProfile& profile, const TransmissionProfile& transProfile,
86  ContactHandler& cHandler, unsigned short int simDay, std::shared_ptr<spdlog::logger> cLogger);
87 };
88 
90 extern template class Infector<ContactLogMode::Id::None, false>;
91 extern template class Infector<ContactLogMode::Id::None, true>;
94 extern template class Infector<ContactLogMode::Id::All, false>;
95 extern template class Infector<ContactLogMode::Id::All, true>;
98 
99 } // namespace stride
Header for the TransmissionProfile class.
A group of Persons that potentially have contacts with one another.
Definition: ContactPool.h:38
Contact profile.
Processes the contacts between persons and determines whether transmission occurs.
Header for the ContactHandler class.
Header for the ContactLogMode class.
Actual contacts and transmission in contactpool (primary template).
Definition: Infector.h:69
Transmission probabilities from disease data.
Contact rates as a function of age.
Header file for the Calendar class.
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28