Skip to content

Commit

Permalink
Fixed age and death update to allow maximum age in population. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
israel-vieira authored Jun 24, 2022
1 parent 268a968 commit bb824a0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/HealthGPS/demographic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ namespace hgps {
}
else {

// calculate death probability based on the health status
// Calculate death probability based on the health status
auto residual_death_rate = get_residual_death_rate(entity.age, entity.gender);
auto product = 1.0 - residual_death_rate;
for (const auto& item : entity.diseases) {
Expand All @@ -356,12 +356,8 @@ namespace hgps {
}
}

// Update basic information
if (entity.is_active()) {
entity.age = entity.age + 1;
if (entity.age >= max_age) {
entity.die(context.time_now());
}
}
}

Expand Down

0 comments on commit bb824a0

Please sign in to comment.