Stride Reference Manual  - generated for commit 9643b11
Person.cpp
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 #include "Person.h"
22 
23 #include "contact/ContactType.h"
24 #include "pop/Age.h"
25 
26 namespace stride {
27 
28 using namespace std;
29 using namespace stride::ContactType;
30 
31 void Person::Update(bool isWorkOff, bool isSchoolOff, bool adaptiveSymptomaticBehavior)
32 {
33  // Update health and disease status
34  m_health.Update();
35 
36  // Update presence in contact pools.
37  if (m_health.IsSymptomatic() && adaptiveSymptomaticBehavior) {
38  m_in_pools[Id::K12School] = false;
39  m_in_pools[Id::College] = false;
40  m_in_pools[Id::Workplace] = false;
41  m_in_pools[Id::PrimaryCommunity] = false;
42  m_in_pools[Id::SecondaryCommunity] = false;
43  } else if (isWorkOff || (m_age <= MinAdultAge() && isSchoolOff)) {
44  m_in_pools[Id::K12School] = false;
45  m_in_pools[Id::College] = false;
46  m_in_pools[Id::Workplace] = false;
47  m_in_pools[Id::PrimaryCommunity] = true;
48  m_in_pools[Id::SecondaryCommunity] = false;
49  } else {
50  m_in_pools[Id::K12School] = true;
51  m_in_pools[Id::College] = true;
52  m_in_pools[Id::Workplace] = true;
53  m_in_pools[Id::PrimaryCommunity] = false;
54  m_in_pools[Id::SecondaryCommunity] = true;
55  }
56 }
57 
58 } // namespace stride
Header file for the Person class.
STL namespace.
Definition of ContactPool Id Type.
Helpers for age.
constexpr unsigned int MinAdultAge()
Maximum age for Person&#39;s.
Definition: Age.h:29
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28
void Update(bool isWorkOff, bool isSchoolOff, bool adaptiveSymptomaticBehavior)
Update the health status and presence in contact pools.
Definition: Person.cpp:31
Namespace to manage types of ContactPool.
Definition: ContactType.cpp:28