Skip to content
Open
737 changes: 737 additions & 0 deletions GETTER_SETTER_RENAME_STRATEGY.md

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions documentation/flowcharts/flowchart_review_prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Use the `flowchart-update` skill.

Review committed SimPaths code change `221e9b3c7`.

Review focus: household_composition, cohabitation, union_matching

## Detector Result

Revision: `HEAD`
Commit: `221e9b3c7`

Changed code files:
- src/main/java/simpaths/model/Person.java
- src/main/java/simpaths/model/UnionMatching.java

Priority modules:
- household_composition (Household Composition): Person.cohabitation, UnionMatching.localGetValue -> documentation/flowcharts/modules/household_composition.md
- cohabitation (Cohabitation UK Case): Person.cohabitation -> documentation/flowcharts/modules/cohabitation.md
- union_matching (Union Matching): UnionMatching.localGetValue -> documentation/flowcharts/modules/union_matching.md

File-level candidate modules:
- household_composition (Household Composition) -> documentation/flowcharts/modules/household_composition.md [state: up_to_date]
- cohabitation (Cohabitation UK Case) -> documentation/flowcharts/modules/cohabitation.md [state: up_to_date]
- full_time_hourly_earnings (Full-Time Hourly Earnings) -> documentation/flowcharts/modules/full_time_hourly_earnings.md [state: up_to_date]
- fertility_give_birth (Fertility and GiveBirth) -> documentation/flowcharts/modules/fertility_give_birth.md [state: up_to_date]
- health_long_term_sick (Health and Long-Term Sick) -> documentation/flowcharts/modules/health_long_term_sick.md [state: up_to_date]
- health_mental_hm1_hm2_cases (Health Mental HM1 and HM2 Cases) -> documentation/flowcharts/modules/health_mental_hm1_hm2_cases.md [state: up_to_date]
- health_mental_hm1_hm2_level (Health Mental HM1 and HM2 Level) -> documentation/flowcharts/modules/health_mental_hm1_hm2_level.md [state: up_to_date]
- union_matching (Union Matching) -> documentation/flowcharts/modules/union_matching.md [state: up_to_date]
- inschool (InSchool) -> documentation/flowcharts/modules/inschool.md [state: up_to_date]

## Manifest Flagging

Manifest updates: 9
- household_composition: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- cohabitation: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- full_time_hourly_earnings: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- fertility_give_birth: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- health_long_term_sick: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- health_mental_hm1_hm2_cases: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- health_mental_hm1_hm2_level: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- union_matching: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
- inschool: up_to_date -> candidate_for_review; last_trigger_commit 569bb2ae0 -> 221e9b3c7
Manifest skips: 0

## Tasks

1. Inspect the committed code diff for `221e9b3c7`.
2. Review priority modules first.
3. Treat non-priority file-level matches as candidates, not confirmed documentation changes.
4. Update flowchart Markdown only where documented logic, schedule context, state dependencies, notes, or traceability metadata changed.
5. If Mermaid is unchanged, say so explicitly.
6. Update `documentation/flowcharts/modules.yml` review state:
- false positives -> `up_to_date`
- updated modules -> `up_to_date` after checking
- use `updated_unverified` only if not fully checked
7. Rerun the detector with `--update-manifest` and confirm idempotency.

Do not update flowcharts for formatting-only, comment-only, or implementation-only changes that do not alter documented logic. Redraw Mermaid only when control flow changes.
12 changes: 6 additions & 6 deletions src/main/java/simpaths/data/TestRegressions.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ private static <E extends Enum<E> & IntegerValuedEnum> void testDiscreteChoiceMo

personProxy.setDemMaleFlag(Gender.Female);
personProxy.setDemAge(28);
personProxy.setRegionLocal(Region.UKF);
personProxy.setYearLocal(2010);
personProxy.setI_demRgn(Region.UKF);
personProxy.setI_demYear(2010);
probs = ManagerRegressions.getProbabilities(personProxy, regression);

personProxy.setDemMaleFlag(Gender.Male);
personProxy.setDemAge(23);
personProxy.setRegionLocal(Region.UKF);
personProxy.setYearLocal(2010);
personProxy.setI_demRgn(Region.UKF);
personProxy.setI_demYear(2010);
probs = ManagerRegressions.getProbabilities(personProxy, regression);

personProxy.setDemMaleFlag(Gender.Female);
personProxy.setDemAge(42);
personProxy.setRegionLocal(Region.UKF);
personProxy.setYearLocal(2010);
personProxy.setI_demRgn(Region.UKF);
personProxy.setI_demYear(2010);
probs = ManagerRegressions.getProbabilities(personProxy, regression);

System.out.println("regression test complete");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public CanBePartneredCSfilter() {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
boolean inContinuousEducation = (person.getDemAge() <= 29 && person.getLes_c4().equals(Les_c4.Student) && person.isLeftEducation() == false);
boolean inContinuousEducation = (person.getDemAge() <= 29 && person.getLabC4().equals(Les_c4.Student) && person.isLeftEducation() == false);
return (person.getPartner() == null && !inContinuousEducation);
}
else throw new IllegalArgumentException("Object passed to GenderEducationWorkingCSfilter must be of type Person!");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/simpaths/data/filters/EducationCSfilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public EducationCSfilter(Education edu) {

public boolean isFiltered(Object object) {
Person person = (Person) object;
return person.getDeh_c4().equals(education);
return person.getEduHighestC4().equals(education);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public EducationEmployedCSfilter(Education edu) {

public boolean isFiltered(Object object) {
Person person = (Person) object;
return (person.getDeh_c4().equals(education) && person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed));
return (person.getEduHighestC4().equals(education) && person.getLabC4().equals(Les_c4.EmployedOrSelfEmployed));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public boolean isFiltered(Object object) {

if (object instanceof Person){
Person person = (Person) object;
return (person.getLes_c4_lag1().equals(employmentLag1));
return (person.getLabC4L1().equals(employmentLag1));
}
else throw new IllegalArgumentException("Argument passed to EmploymentHistoryFilter must be of object type Person");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public FemaleAgeGroupEducationCSfilter(int ageFrom, int ageTo, Education educati

public boolean isFiltered(Object object) {
Person person = (Person) object;
return ( person.getDemMaleFlag().equals(Gender.Female) && (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && person.getDeh_c4().equals(education) );
return ( person.getDemMaleFlag().equals(Gender.Female) && (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && person.getEduHighestC4().equals(education) );
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public FemalesAgeGroupEducationCSfilter(int ageFrom, int ageTo, Education edu) {

public boolean isFiltered(Object object) {
Person person = (Person) object;
if( person.getDeh_c4() == null ) return false; //Better just to check on Education being null, rather than assuming anything about the Students. In future models, it may be possible to go back to education after already working.
if( person.getEduHighestC4() == null ) return false; //Better just to check on Education being null, rather than assuming anything about the Students. In future models, it may be possible to go back to education after already working.
// if(person.getActivity_status().equals(Les_c4.Student)) { //Need to check they are not still students, otherwise education level is not defined
// return false;
// }
else return ( person.getDemMaleFlag().equals(Gender.Female) &&
(person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) &&
( person.getDeh_c4().equals(edu) )
( person.getEduHighestC4().equals(edu) )
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public boolean isFiltered(Object object) {
(person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) &&
( person.getBenefitUnit().getIndicatorChildren(0,3).equals(Indicator.True) ||
person.getBenefitUnit().getIndicatorChildren(4,12).equals(Indicator.True) ) &&
(person.getDeh_c4().equals(edu))
(person.getEduHighestC4().equals(edu))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public boolean isFiltered(Object o) {
return (person.getDemAge() >= Parameters.MIN_AGE_FLEXIBLE_LABOUR_SUPPLY && person.getDemAge() <= Parameters.MAX_AGE_FLEXIBLE_LABOUR_SUPPLY &&
person.getDemAge() >= ageFrom && person.getDemAge() <= ageTo &&
person.getDemMaleFlag().equals(demSex) &&
person.getLes_c4() != Les_c4.Student && person.getLes_c4() != Les_c4.Retired &&
person.getDlltsd() != Indicator.True);
person.getLabC4() != Les_c4.Student && person.getLabC4() != Les_c4.Retired &&
person.getHealthDsblLongtermFlag() != Indicator.True);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public boolean isFiltered(Object o) {
*/

return (person.getDemAge() >= Parameters.MIN_AGE_FLEXIBLE_LABOUR_SUPPLY && person.getDemAge() <= Parameters.MAX_AGE_FLEXIBLE_LABOUR_SUPPLY &&
person.getLes_c4() != Les_c4.Student && person.getLes_c4() != Les_c4.Retired &&
person.getDlltsd() != Indicator.True &&
person.getDeh_c4().equals(education));
person.getLabC4() != Les_c4.Student && person.getLabC4() != Les_c4.Retired &&
person.getHealthDsblLongtermFlag() != Indicator.True &&
person.getEduHighestC4().equals(education));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public boolean isFiltered(Object o) {
*/

return (person.getDemAge() >= Parameters.MIN_AGE_FLEXIBLE_LABOUR_SUPPLY && person.getDemAge() <= Parameters.MAX_AGE_FLEXIBLE_LABOUR_SUPPLY &&
person.getLes_c4() != Les_c4.Student && person.getLes_c4() != Les_c4.Retired &&
person.getDlltsd() != Indicator.True);
person.getLabC4() != Les_c4.Student && person.getLabC4() != Les_c4.Retired &&
person.getHealthDsblLongtermFlag() != Indicator.True);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public boolean evaluate(T person) {


return (person.getDemAge() >= 18 && person.getDemAge() <= 64 &&
person.getLes_c4() != Les_c4.Student && person.getLes_c4() != Les_c4.Retired &&
person.getDlltsd() != Indicator.True);
person.getLabC4() != Les_c4.Student && person.getLabC4() != Les_c4.Retired &&
person.getHealthDsblLongtermFlag() != Indicator.True);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public GenderEducationCSfilter(Gender demSex, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getDemMaleFlag().equals(demSex) && person.getDeh_c4().equals(education) && person.getGrossEarningsYearly() >= 0.);
return (person.getDemMaleFlag().equals(demSex) && person.getEduHighestC4().equals(education) && person.getGrossEarningsYearly() >= 0.);
}
else throw new IllegalArgumentException("Object passed to GenderEducationWorkingCSfilter must be of type Person!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getDemMaleFlag().equals(demSex) &&
person.getDeh_c4().equals(education) &&
person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed) &&
person.getEduHighestC4().equals(education) &&
person.getLabC4().equals(Les_c4.EmployedOrSelfEmployed) &&
person.getGrossEarningsYearly() >= 1. &&
person.getLabourSupplyHoursWeekly() > 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public GenderWorkingCSfilter(Gender demSex) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
return (person.getDemMaleFlag().equals(demSex) && person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed) && person.getGrossEarningsYearly() >= 0.);
return (person.getDemMaleFlag().equals(demSex) && person.getLabC4().equals(Les_c4.EmployedOrSelfEmployed) && person.getGrossEarningsYearly() >= 0.);
}
else throw new IllegalArgumentException("Object passed to GenderEducationWorkingCSfilter must be of type Person!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public MaleAgeGroupEducationCSfilter(int ageFrom, int ageTo, Education education

public boolean isFiltered(Object object) {
Person person = (Person) object;
return ( person.getDemMaleFlag().equals(Gender.Male) && (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && person.getDeh_c4().equals(education) );
return ( person.getDemMaleFlag().equals(Gender.Male) && (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && person.getEduHighestC4().equals(education) );
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public RegionEducationAtRiskOfWorkCSfilter(Region demRgn, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
if (person.getDeh_c4()==null) {
if (person.getEduHighestC4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education) && person.atRiskOfWork());
return (person.getRegion().equals(demRgn) && person.getEduHighestC4().equals(education) && person.atRiskOfWork());
}
}
else throw new IllegalArgumentException("Object passed to RegionEducationCSfilter must be of type Person!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public RegionEducationCSfilter(Region demRgn, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
if (person.getDeh_c4()==null) {
if (person.getEduHighestC4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education));
return (person.getRegion().equals(demRgn) && person.getEduHighestC4().equals(education));
}
}
else throw new IllegalArgumentException("Object passed to RegionEducationCSfilter must be of type Person!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public RegionEducationWorkingCSfilter(Region demRgn, Education education) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
if (person.getDeh_c4()==null || person.getLes_c4()==null) {
if (person.getEduHighestC4()==null || person.getLabC4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && person.getDeh_c4().equals(education) && person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed) && person.getGrossEarningsYearly() >= 0.);
return (person.getRegion().equals(demRgn) && person.getEduHighestC4().equals(education) && person.getLabC4().equals(Les_c4.EmployedOrSelfEmployed) && person.getGrossEarningsYearly() >= 0.);
}
}
else throw new IllegalArgumentException("Object passed to RegionEducationWorkingCSfilter must be of type Person!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public ValidEducationAgeGroupCSfilter(int ageFrom, int ageTo) {

public boolean isFiltered(Object object) {
Person person = (Person) object;
if (person.getLes_c4()==null) {
if (person.getLabC4()==null) {
return false;
} else {
return ( (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && !person.getLes_c4().equals(Les_c4.Student));
return ( (person.getDemAge() >= ageFrom) && (person.getDemAge() <= ageTo) && !person.getLabC4().equals(Les_c4.Student));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public ValidEducationRegionCSfilter(Region demRgn) {
public boolean isFiltered(Object object) {
if(object instanceof Person) {
Person person = (Person) object;
if (person.getLes_c4()==null) {
if (person.getLabC4()==null) {
return false;
} else {
return (person.getRegion().equals(demRgn) && !person.getLes_c4().equals(Les_c4.Student) && person.getDemAge() >= 18 && person.getDeh_c4() != null);
return (person.getRegion().equals(demRgn) && !person.getLabC4().equals(Les_c4.Student) && person.getDemAge() >= 18 && person.getEduHighestC4() != null);
}
}
else if(object instanceof BenefitUnit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public void update(SimPathsModel model) {
.filter(p -> p.getDemAge() >= Parameters.MIN_AGE_COHABITATION)
.count();
long numPersonsPartnered = model.getPersons().stream()
.filter(p -> Dcpst.Partnered.equals(p.getDcpst()))
.filter(p -> Dcpst.Partnered.equals(p.getDemPartnerStatus()))
.count();
setShareCohabitingSim(numPersonsCohabEligible > 0
? (double) numPersonsPartnered / numPersonsCohabEligible : 0.0);
Expand All @@ -271,12 +271,12 @@ public void update(SimPathsModel model) {
.filter(p -> p.getDemAge() >= Parameters.MIN_AGE_TO_LEAVE_EDUCATION
&& p.getDemAge() <= Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION
&& !p.isToLeaveSchool()
&& Les_c4.Student.equals(p.getLes_c4()))
&& Les_c4.Student.equals(p.getLabC4()))
.count();
long numInSchoolAge = model.getPersons().stream()
.filter(p -> p.getDemAge() >= Parameters.MIN_AGE_TO_LEAVE_EDUCATION
&& p.getDemAge() <= Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION
&& p.getLes_c4() != null)
&& p.getLabC4() != null)
.count();
setInSchoolShareSim(numInSchoolAge > 0 ? (double) numStudents / numInSchoolAge : 0.0);
setInSchoolShareTgt(Parameters.getTargetShare(year, TargetShares.Students));
Expand Down
Loading
Loading