Aging alignment with EMOD-Generic - #228
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns EMOD’s susceptibility “aging” behavior with EMOD-Generic by removing Susceptibility’s private age tracking and instead reading age directly from the owning IIndividualHumanContext (parent->GetAge()). It also propagates signature updates (dropping redundant age parameters) across disease-specific susceptibility subclasses and updates several interfaces to use float for age/MC weight.
Changes:
- Refactor
Susceptibility(+ HIV/Malaria/STI/Vector subclasses) to stop maintaining an internal age copy; age-dependent calculations now useparent->GetAge(). - Update factory/initialize APIs to remove the age parameter and narrow age/MC weight interface return types from
doubletofloat. - Adjust
Nodedemographics distribution hooks to acceptNodeDemographics*and move the “other disease distributions” hook to run after demographics extraction; regenerate regression baselines.
Reviewed changes
Copilot reviewed 31 out of 45 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Regression/STI/86_STI_ReportRelationshipCensus/output/ReportRelationshipCensus.csv | Updated STI regression output baseline reflecting new age-alignment behavior. |
| Eradication/VectorToHumanAdapter.h | Interface return types updated (GetAge, GetMonteCarloWeight) to float. |
| Eradication/VectorToHumanAdapter.cpp | Implementation updated to match new float return types. |
| Eradication/SusceptibilityVector.h | Remove age parameter from factory/init; rename some age parameters for clarity. |
| Eradication/SusceptibilityVector.cpp | Use live parent age for biting-risk calculations; remove unused config accessor. |
| Eradication/SusceptibilitySTI.h | Remove age parameter from factory/init. |
| Eradication/SusceptibilitySTI.cpp | Wire factory/init to new signature (no explicit age). |
| Eradication/SusceptibilityMalaria.h | Remove age parameter from factory/init; make age-dependent helpers read from parent age. |
| Eradication/SusceptibilityMalaria.cpp | Convert malaria age-dependent logic to use parent->GetAge(); refactor innate variation selection. |
| Eradication/SusceptibilityHIV.h | Remove age parameter from factory/init. |
| Eradication/SusceptibilityHIV.cpp | Remove immune-age increment; rely on parent age and updated init signature. |
| Eradication/Susceptibility.h | Add IIndividualHumanContext include; remove getAge() from ISusceptibilityContext exposure; refactor initialization API. |
| Eradication/Susceptibility.cpp | Remove local age increment and getAge(); switch maternal/immune logic to parent age; tighten base virtuals with asserts. |
| Eradication/NodeEventContextHost.h | Minor formatting/cleanup. |
| Eradication/NodeEventContext.h | Forward declaration cleanup and formatting changes. |
| Eradication/NodeEventContext.cpp | Formatting cleanup; return explicit broadcaster interface pointer. |
| Eradication/Node.h | Change demographics distribution hooks to accept NodeDemographics*. |
| Eradication/Node.cpp | Call updated demographics distribution hooks with NodeDemographics* and adjust ordering. |
| Eradication/ISusceptibilityContext.h | Remove getAge() from susceptibility context interface. |
| Eradication/IndividualVector.cpp | Update susceptibility creation call to new signature (no explicit age). |
| Eradication/IndividualSTI.h | Friend/refcounting layout cleanup. |
| Eradication/IndividualSTI.cpp | Update STI susceptibility creation call; formatting cleanup. |
| Eradication/IndividualMalaria.cpp | Update malaria susceptibility creation call to new signature (no explicit age). |
| Eradication/IndividualHIV.cpp | Update HIV susceptibility creation call; formatting cleanup. |
| Eradication/IndividualEventContext.h | Update GetAge/GetMonteCarloWeight return types to float; formatting cleanup. |
| Eradication/Individual.h | Update individual event context accessors to float age/MC weight; minor API ordering/formatting. |
| Eradication/Individual.cpp | Rename parameters for clarity; some minor logic/formatting changes in migration duration helper. |
| Eradication/IIndividualHumanContext.h | Add GetAge() to context interface (as float). |
| Eradication/IIndividualHuman.h | Narrow interface return types for age/MC weight to float and reorder some accessors. |
| componentTests/IndividualHumanContextFake.h | Update fake to match interface type changes (float age/MC weight) and formatting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes from Claude:
What it does: refactors Susceptibility (and its HIV/Malaria/STI/Vector subclasses) to stop tracking its own private age copy and instead read age live from parent->GetAge() (the IndividualHuman). Mostly mechanical signature cleanup (CreateSusceptibility/Initialize drop the now-redundant age parameter everywhere), plus some cosmetic reformatting. The regression baselines were regenerated wholesale (huge CSV/JSON diffs), which is the tell that this is not behavior-neutral.
Real behavioral differences found
Other notable changes