40 template<
typename PopT,
typename IterT>
44 : m_pop(pop), m_in_planner(in_planner), m_index(index), m_day(day) {}
50 if (not m_in_planner) {
51 if (m_index >= m_pop.m_original.size()) {
55 m_day_iter = m_pop.m_visitors.getAgenda().begin();
60 if (m_day >= m_pop.m_visitors.days()) {
63 }
else if ((m_index >= m_pop.m_visitors.getDay(m_day)->size())) {
83 if (m_in_planner or (not(*(*
this)).isOnVacation())) {
96 return &m_pop == &(other.
m_pop)
99 and m_day == other.
m_day;
103 return not(*
this == other);
107 if (m_in_planner)
return *((*m_day_iter->get()).at(m_index));
108 else return m_pop.m_original.at(m_index);
114 and m_day == m_pop.m_visitors.days();
141 unsigned int getInfectedCount()
const;
144 return getInfectedCount() / (this->m_original.size() + this->m_visitors.size());
148 return m_original.size() + m_visitors.size();
151 template<
typename BeliefPolicy>
152 unsigned int getAdoptedCount()
const;
193 template<
typename BeliefPolicy>
195 unsigned int total {0U};
197 for (
const auto& p: *
this) {
198 auto belief_data = p.getBeliefData();
199 bool adopted = BeliefPolicy::hasAdopted(belief_data);
Person< BehaviourPolicy, BeliefPolicy > PersonType
bool operator==(const _PopulationIterator &other) const
Time Dependent Person DataType.
Header file for the Person class.
Header for the Simulator class.
bool operator!=(const _PopulationIterator &other) const
Container for persons in population.
Forward declaration of class Person.
unsigned int getAdoptedCount() const
double getFractionInfected() const
vector< PersonType > VectorType
_PopulationIterator(PopT &pop, unsigned int index, bool in_planner=false, unsigned int day=0)
const PopT::PersonType & operator*() const