Skip to content

Commit

Permalink
Set default value of UUIDs to -1 for initializing Visit, InfectionOut…
Browse files Browse the repository at this point in the history
…come and ContactReport.

PiperOrigin-RevId: 341742831
  • Loading branch information
Pandemic-Sim Team authored and copybara-github committed Nov 16, 2020
1 parent 49ba724 commit 2f55cc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions agent_based_epidemic_sim/core/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ static_assert(absl::is_trivially_copy_constructible<ContactSummary>::value,
// An outcome of a visit to a location.
// May contain a contact, or background_exposure, representing an exposure
// to an INFECTIOUS entity (contact, fomite, location etc.) with a given
// infectivity.
// infectivity. Default UUIDs are set to -1.
// TODO: Rename to VisitOutcome. Also, consider a move to v<Contact>.
struct InfectionOutcome {
int64 agent_uuid;
int64 agent_uuid = -1;
Exposure exposure;
InfectionOutcomeProto::ExposureType exposure_type;
int64 source_uuid;
int64 source_uuid = -1;

friend bool operator==(const InfectionOutcome& a, const InfectionOutcome& b) {
return (a.agent_uuid == b.agent_uuid && a.exposure == b.exposure &&
Expand Down Expand Up @@ -282,11 +282,12 @@ struct TestResult {
static_assert(absl::is_trivially_copy_constructible<TestResult>::value,
"TestResult must be trivially copyable.");

// Health information that is to be broadcasted to a contact.
// Health information that is to be broadcasted to a contact. Default UUIDs are
// set to -1.
// TODO: Represent and report self-reported symptoms.
struct ContactReport {
int64 from_agent_uuid;
int64 to_agent_uuid;
int64 from_agent_uuid = -1;
int64 to_agent_uuid = -1;
TestResult test_result;

absl::optional<absl::Time> initial_symptom_onset_time;
Expand Down
6 changes: 3 additions & 3 deletions agent_based_epidemic_sim/core/visit.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ struct VisitLocationDynamics {
int random_location_edges = 0;
};

// A visit to a given location in time of an agent.
// A visit to a given location in time of an agent. Default UUIDs are set to -1.
struct Visit {
int64 location_uuid;
int64 agent_uuid;
int64 location_uuid = -1;
int64 agent_uuid = -1;
absl::Time start_time;
absl::Time end_time;
HealthState::State health_state;
Expand Down

0 comments on commit 2f55cc7

Please sign in to comment.