Feature/182 add statisticswellbeingjava to calculate statistics#183
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds aggregate wellbeing statistics functionality to the simulation, closing issue #182. Key changes include:
- Introducing a new HealthStatistics class to calculate and store health-related statistics.
- Modifying SimPathsCollector to integrate health statistics with event scheduling and persistence.
- Updating processes to include DumpHealthStatistics alongside existing employment statistics.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/java/simpaths/experiment/SimPathsCollector.java | Added fields and event scheduling to update and export health statistics. |
| src/main/java/simpaths/data/statistics/HealthStatistics.java | New class to compute statistical aggregates for various health and wellbeing indicators. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds functionality to compute and export aggregate wellbeing statistics alongside existing employment metrics. Key changes include:
- Integration of health statistics calculations and exports in SimPathsCollector.
- Introduction of the HealthStatistics class that computes various aggregate metrics.
- Updates to the simulation event scheduling to include health statistics dumping.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/java/simpaths/experiment/SimPathsCollector.java | Added parameters, HealthStatistics instance, and event scheduling for health statistics |
| src/main/java/simpaths/data/statistics/HealthStatistics.java | Implemented calculations for multiple wellbeing metrics using cross-sectional functions |
|
I've added @justin-ven and @pbronka as reviewers - do sense-check: this should just be adding an additional optional statistics output file. As above though, is there a good practice for how best to output subgroup statistics? Looping over nested age*sex filtered statistics to populate multiple rows? Or doing it by column? |
|
I don't have a clear preference over the looping vs by column - I am guessing that there will be differences in execution time that would decide the matter (at least for me). Unfortunately, I have not run associated tests myself... Also, have you seen the copilot suggestions? They look sensible to me and I would normally implement these sorts of things before finalising on the commit. |
justin-ven
left a comment
There was a problem hiding this comment.
Hard for me to say if this is all ok without actually running it myself - I struggle to know how to review these things effectively. The copilot suggestions look sensible, though again it is hard for me know without associated testing.
|
Thanks Justin for your comments! Yeah that's great feedback - ideally wanted to check with you whether this fitted with the 'logic' of statistics calculations in SimPaths. Perhaps we make a practice of setting specific queries for requested reviewers on future PRs? Can add that to agenda for tomorrow.
Will perhaps experiment with loop vs extra variables then. I would lean towards looping as doing separate columns for male/female/total would triple the width of the file and triple the lines of code in
Yeah they seem like good suggestions actually. I could try to do:
|
pbronka
left a comment
There was a problem hiding this comment.
That all looks good to me; more generally the copilot's suggestion that the way in which we calculate statistics could likely be simplified is a good one...
|
Have updated this with:
Potentially for further work in separate branches:
Pending passing tests, will merge these stable updates. |
…o-calculate-statistics
This reverts commit 6c476e7.
What
Why
Questions outstanding