Skip to content

Simplify A+ cohort handling: positive contiguous IDs instead of negative-ID namespace#16

Merged
pletzer merged 2 commits into
mainfrom
aplus3
Jun 30, 2026
Merged

Simplify A+ cohort handling: positive contiguous IDs instead of negative-ID namespace#16
pletzer merged 2 commits into
mainfrom
aplus3

Conversation

@pletzer

@pletzer pletzer commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@pletzer

pletzer commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

A+ cohorts previously lived in a separate negative-ID namespace with hand-rolled arithmetic (-timeStep-1, aPlusId+1, etc.), forcing every consumer to branch on task_id < 0 / std::abs(task_id). This PR makes A+ cohorts ordinary one-step cohorts appended right after the last normal ID (firstAPlusId = numAgeGroups + numTimeSteps - 1), exposed via a new getFirstAPlusCohortId() accessor.

SeapodymCohortDependencyAnalyzer.h/.cpp: rewrote the A+ branch of the constructor; updated doc comments/diagram; added getFirstAPlusCohortId().
tests/testTaskStepFarmingCohortAPlus.cxx: replaced sign-based checks with the new ID threshold.
No behavior change: verified the new dependency graph is structurally identical to the old one (isomorphic under the old↔new A+ ID mapping) across several (numAgeGroups, numTimeSteps, ageMature) cases including edge cases.

@pletzer pletzer merged commit c433552 into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant