Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/hepce/model/person.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created Date: 2025-04-17 //
// Author: Matthew Carroll //
// ----- //
// Last Modified: 2025-10-09 //
// Last Modified: 2025-11-12 //
// Modified By: Matthew Carroll //
// ----- //
// Copyright (c) 2025 Syndemics Lab at Boston Medical Center //
Expand Down Expand Up @@ -32,6 +32,7 @@ class Person {
Die(data::DeathReason deathReason = data::DeathReason::kBackground) = 0;

virtual void SetPersonDetails(const data::PersonSelect &select) = 0;
virtual void SetStartTime(const int start_time = 0) = 0;

// HCV
virtual data::HCVDetails GetHCVDetails() const = 0;
Expand Down
6 changes: 5 additions & 1 deletion src/model/internals/person_internals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created Date: 2025-04-18 //
// Author: Matthew Carroll //
// ----- //
// Last Modified: 2025-10-09 //
// Last Modified: 2025-11-12 //
// Modified By: Matthew Carroll //
// ----- //
// Copyright (c) 2025 Syndemics Lab at Boston Medical Center //
Expand Down Expand Up @@ -45,6 +45,10 @@ class PersonImpl : public Person {

void SetPersonDetails(const data::PersonSelect &select) override;

void SetStartTime(const int start_time) override {
_current_time = start_time;
}

// Section Getters
inline data::HCVDetails GetHCVDetails() const override {
return _hcv_details;
Expand Down
6 changes: 6 additions & 0 deletions src/model/simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ HepceImpl::ReadICPopulation(const int population_size,
std::vector<data::PersonSelect> vec =
std::any_cast<std::vector<data::PersonSelect>>(storage);
std::vector<std::unique_ptr<model::Person>> population = {};
int start_time =
utils::GetIntFromConfig("simulation.start_time", model_data);
for (const auto &ps : vec) {
auto person = model::Person::Create(GetLogName());
person->SetPersonDetails(ps);
person->SetStartTime(start_time);
population.push_back(std::move(person));
}
return population;
Expand Down Expand Up @@ -160,9 +163,12 @@ HepceImpl::ReadPopPopulation(const int population_size,
std::vector<data::PersonSelect> vec =
std::any_cast<std::vector<data::PersonSelect>>(storage);
std::vector<std::unique_ptr<model::Person>> population = {};
int start_time =
utils::GetIntFromConfig("simulation.start_time", model_data);
for (const auto &ps : vec) {
auto person = model::Person::Create(GetLogName());
person->SetPersonDetails(ps);
person->SetStartTime(start_time);
population.push_back(std::move(person));
}
return population;
Expand Down
3 changes: 2 additions & 1 deletion tests/mocks/person_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created: 2025-01-06 //
// Author: Matthew Carroll //
// ----- //
// Last Modified: 2025-10-09 //
// Last Modified: 2025-11-12 //
// Modified By: Matthew Carroll //
// ----- //
// Copyright (c) 2025 Syndemics Lab at Boston Medical Center //
Expand All @@ -31,6 +31,7 @@ class MockPerson : public virtual Person {
MOCK_METHOD(void, Die, (data::DeathReason deathReason), (override));
MOCK_METHOD(void, SetPersonDetails, (const data::PersonSelect &select),
(override));
MOCK_METHOD(void, SetStartTime, (const int), (override));

// HCV
MOCK_METHOD(data::HCVDetails, GetHCVDetails, (), (const, override));
Expand Down
Loading