diff --git a/GETTER_SETTER_RENAME_STRATEGY.md b/GETTER_SETTER_RENAME_STRATEGY.md new file mode 100644 index 000000000..8d2a1ac6b --- /dev/null +++ b/GETTER_SETTER_RENAME_STRATEGY.md @@ -0,0 +1,737 @@ +# Getter and Setter Rename Strategy + +## 1. Goal + +Align Java getter and setter method names with the backing field names they expose or update. + +Example in `simpaths.model.Person`: + +```java +private Education eduHighestC4; + +public Education getEduHighestC4() { + return eduHighestC4; +} + +public void setEduHighestC4(Education eduHighestC4) { + this.eduHighestC4 = eduHighestC4; +} +``` + +## 2. Core Rule + +Treat each getter and setter as a Java API rename. + +For each accessor: + +1. Confirm the backing field used by the method body. +2. Rename the method suffix to match the backing field in UpperCamelCase. +3. Rename all Java call sites in the same batch. +4. Compile after the batch. +5. Search for the old method name and resolve any remaining references. + +Avoid global text replacement across the repository. Some old names may also be survey variable names, database columns, CSV headers, comments, or external configuration values, and those should not be changed unless they are genuinely Java method references. + +## 3. Progress Summary + +| Batch | Status | Validation | Notes | +| --- | --- | --- | --- | +| `Person` education fields | Completed | `mvn test -DskipTests` and `mvn -Dtest=PersonTest test` passed on 2026-04-28 | No compatibility wrappers retained. Old method references removed from Java source and tests. | +| `Person` labour status fields | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | No compatibility wrappers retained. Old method references removed from Java source, tests, and reflective getter strings. | +| `Person` health fields | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | No compatibility wrappers retained. Old `Person` method references removed from Java source and reflective getter strings. Non-`Person` `States.getDlltsd()` remains intentionally retained as a decision-state API. | +| `Person` income fields | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | No compatibility wrappers retained. Old income method references removed from Java source, tests, XML/properties, and reflective getter strings. | +| `Person` demographic fields | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | No compatibility wrappers retained. Old `Person` demographic method references removed from Java source and reflective getter strings. Non-`Person` `States.getDcpst()` API was intentionally retained. | +| Remaining `Person` education/social-care flags | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | Strict field-name rule used for social-care methods. No compatibility wrappers retained. Old method references removed from Java source, tests, XML, and properties. | +| `BenefitUnit` local proxy state | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | Updated to preserve the `I_` prefix for methods setting `i_...` fields. `Person.setYearLocal(...)` intentionally retained outside this batch. | +| `BenefitUnit` children and poverty lags | Completed | `mvn test -DskipTests` and `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | `BenefitUnit` poverty API renamed to `yPvrtyFlag` field style. `Person.getAtRiskOfPoverty()` intentionally retained as a person-level derived API. | +| `BenefitUnit` household income and quintile fields | Completed | `mvn test -DskipTests` and checkpoint `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | Reflective collector string updated. Statistics percentile methods such as `getYdses_p20()` intentionally retained. | +| `BenefitUnit` wealth and costs | Completed | `mvn test -DskipTests` and checkpoint `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | Renamed only `BenefitUnit` APIs and direct `BenefitUnit` call sites. Similar `Person`, `Parameters`, decision-grid, and tax-key APIs intentionally retained. | +| `Household` original ID accessor | Completed | `mvn test -DskipTests` passed on 2026-04-28 | Renamed `getIdOriginalHH()` to `getIdHhOriginal()`. | +| Original household ID accessors | Completed | `mvn test -DskipTests` and local checkpoint `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | Renamed `Person` and `BenefitUnit` `getIdOriginalHH()` to `getIdHhOriginal()`. | +| Original person/benefit-unit ID accessors | Completed | `mvn test -DskipTests` and local checkpoint `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` passed on 2026-04-28 | Renamed `getIdOriginalPerson()` and `getIdOriginalBU()` to match `idPersOriginal` and `idBuOriginal`. | +| `i_` accessor naming correction | Completed | `mvn test -DskipTests` passed on 2026-04-28 | Corrected completed `BenefitUnit` `i_...` accessors to keep `I_`, including `getI_yNonBenHhGrossAsinh...` and local proxy setters. | +| Remaining `Person` direct field-backed residuals | Completed | `mvn test -DskipTests` passed on 2026-04-28 | Combined batch covering direct residuals, benefit lag setters, and local proxy setters. Boolean `is...` predicates and computed helpers intentionally excluded. | +| Statistics output beans | Completed | `mvn test -DskipTests` passed on 2026-04-29 | Renamed direct field-backed statistics output accessors in `Statistics` and `HealthStatistics`. Persisted `@Column` names unchanged. | +| Final runtime checkpoint | Completed | Focused tests, single run, and multirun passed on 2026-04-29 | Rename scope frozen before colleague discussion. Remaining computed/helper APIs stay deferred. | + +## 4. Naming Convention + +Use standard JavaBean-style accessor names: + +- `fieldName` -> `getFieldName()` / `setFieldName(...)` +- Boolean fields may use either the existing project convention or `isFieldName()` if already established locally. +- Lag fields should preserve the field suffix: + - `eduHighestC4L1` -> `getEduHighestC4L1()` / `setEduHighestC4L1(...)` +- Fields whose names begin with `i_` should keep the `I_` prefix in accessor names: + - `i_yNonBenHhGrossAsinh` -> `getI_yNonBenHhGrossAsinh()` / `setI_yNonBenHhGrossAsinh(...)` +- Local/transient helper accessors should keep meaningful qualifiers: + - `setRegionLocal(...)` can remain distinct from `setRegion(...)` where both have different behavior. + +## 5. Completed: Person Education Fields + +Completed education-related accessor renames in `src/main/java/simpaths/model/Person.java` and Java call sites under `src/main/java` and `src/test/java`. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getDeh_c4()` | `getEduHighestC4()` | `eduHighestC4` | +| `setDeh_c4(...)` | `setEduHighestC4(...)` | `eduHighestC4` | +| `setDeh_c4_lag1(...)` | `setEduHighestC4L1(...)` | `eduHighestC4L1` | +| `getDehm_c4()` | `getEduHighestMotherC4()` | `eduHighestMotherC4` | +| `setDehm_c4(...)` | `setEduHighestMotherC4(...)` | `eduHighestMotherC4` | +| `getDehf_c4()` | `getEduHighestFatherC4()` | `eduHighestFatherC4` | +| `setDehf_c4(...)` | `setEduHighestFatherC4(...)` | `eduHighestFatherC4` | +| `getDed()` | `getEduSpellFlag()` | `eduSpellFlag` | +| `setDed(...)` | `setEduSpellFlag(...)` | `eduSpellFlag` | +| `getDed_lag1()` | `getEduSpellFlagL1()` | `eduSpellFlagL1` | +| `setDed_lag1(...)` | `setEduSpellFlagL1(...)` | `eduSpellFlagL1` | +| `setDehsp_c4_lag1(...)` | `setEduHighestPartnerC4L1(...)` | `eduHighestPartnerC4L1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn -Dtest=PersonTest test` +- Focused test result: passed, 25 tests run +- Remaining old method references in Java source/tests: none +- Compatibility wrappers: none retained + +## 6. Completed: Person Labour Status Fields + +Completed labour-status accessor renames in `src/main/java/simpaths/model/Person.java` and Java call sites under `src/main/java` and `src/test/java`. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getLes_c4()` | `getLabC4()` | `labC4` | +| `setLes_c4(...)` | `setLabC4(...)` | `labC4` | +| `getLes_c4_lag1()` | `getLabC4L1()` | `labC4L1` | +| `setLes_c4_lag1(...)` | `setLabC4L1(...)` | `labC4L1` | +| `getLes_c7_covid()` | `getLabC7Covid()` | `labC7Covid` | +| `setLes_c7_covid(...)` | `setLabC7Covid(...)` | `labC7Covid` | +| `getLes_c7_covid_lag1()` | `getLabC7CovidL1()` | `labC7CovidL1` | +| `setLes_c7_covid_lag1(...)` | `setLabC7CovidL1(...)` | `labC7CovidL1` | +| `getLesdf_c4()` | `getLabStatusPartnerAndOwnC4()` | computed from `labC4` and partner `labC4` | +| `getLesdf_c4_lag1()` | `getLabStatusPartnerAndOwnC4L1()` | `labStatusPartnerAndOwnC4L1` | +| `setLesdf_c4_lag1(...)` | `setLabStatusPartnerAndOwnC4L1(...)` | `labStatusPartnerAndOwnC4L1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old method references in Java source/tests/XML/properties: none +- Reflective getter strings updated: `@Lag(getter="getLabStatusPartnerAndOwnC4")` +- Compatibility wrappers: none retained + +Work-history accessors such as `getLiwwh()` / `setLiwwh(...)` were not included in this batch. Handle them in a separate labour-history batch if needed. + +## 7. Completed: Person Health Fields + +Completed health-related accessor renames in `src/main/java/simpaths/model/Person.java` and Java call sites under `src/main/java`. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getDhe()` | `getHealthSelfRated()` | `healthSelfRated` | +| `setDhe(...)` | `setHealthSelfRated(...)` | `healthSelfRated` | +| `getDheValue()` | `getHealthSelfRatedValue()` | computed from `healthSelfRated` | +| `setDhe_lag1(...)` | `setHealthSelfRatedL1(...)` | `healthSelfRatedL1` | +| `getDlltsd()` | `getHealthDsblLongtermFlag()` | `healthDsblLongtermFlag` | +| `setDlltsd(...)` | `setHealthDsblLongtermFlag(...)` | `healthDsblLongtermFlag` | +| `getDlltsd_lag1()` | `getHealthDsblLongtermFlagL1()` | `healthDsblLongtermFlagL1` | +| `setDlltsd_lag1(...)` | `setHealthDsblLongtermFlagL1(...)` | `healthDsblLongtermFlagL1` | +| `setDhesp_lag1(...)` | `setHealthPartnerSelfRatedL1(...)` | `healthPartnerSelfRatedL1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old `Person` method references in Java source/tests/XML/properties: none +- Reflective getter strings updated: `"getHealthSelfRatedValue"` and `"getHealthSelfRated"` +- Compatibility wrappers: none retained + +Intentional retained names: + +- `States.getDlltsd()` remains unchanged because it is a decision-state API, not a `Person` accessor. +- Tax donor/key `DLLTSD` APIs were handled later in section 18.3. +- Health-statistics setters such as `setDhe_mcs_mean(...)` remain unchanged because they do not expose `Person` fields. + +Social-care fields were not included in this batch. Handle them in a separate social-care batch if needed. + +## 8. Completed: Person Income Fields + +Completed income-related accessor renames in `src/main/java/simpaths/model/Person.java` and Java call sites under `src/main/java`. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getyNonBenPersGrossMonth()` | `getYNonBenPersGrossMonth()` | `yNonBenPersGrossMonth` | +| `setyNonBenPersGrossMonth(...)` | `setYNonBenPersGrossMonth(...)` | `yNonBenPersGrossMonth` | +| `getyNonBenPersGrossMonthL1()` | `getYNonBenPersGrossMonthL1()` | `yNonBenPersGrossMonthL1` | +| `getyMiscPersGrossMonth()` | `getYMiscPersGrossMonth()` | `yMiscPersGrossMonth` | +| `getyMiscPersGrossMonthL1()` | `getYMiscPersGrossMonthL1()` | `yMiscPersGrossMonthL1` | +| `getyCapitalPersMonth()` | `getYCapitalPersMonth()` | `yCapitalPersMonth` | +| `getyPensPersGrossMonth()` | `getYPensPersGrossMonth()` | `yPensPersGrossMonth` | +| `getyEmpPersGrossMonth()` | `getYEmpPersGrossMonth()` | `yEmpPersGrossMonth` | +| `setyEmpPersGrossMonth(...)` | `setYEmpPersGrossMonth(...)` | `yEmpPersGrossMonth` | +| `getyEmpPersGrossMonthL1()` | `getYEmpPersGrossMonthL1()` | `yEmpPersGrossMonthL1` | +| `getyEmpPersGrossMonthL2()` | `getYEmpPersGrossMonthL2()` | `yEmpPersGrossMonthL2` | +| `getyEmpPersGrossMonthL3()` | `getYEmpPersGrossMonthL3()` | `yEmpPersGrossMonthL3` | +| `setYptciihs_dv(...)` | `setYMiscPersGrossMonth(...)` | `yMiscPersGrossMonth` | +| `getYnbcpdf_dv_lag1()` | `getYPersAndPartnerGrossDiffMonthL1()` | `yPersAndPartnerGrossDiffMonthL1` | +| `setYnbcpdf_dv_lag1(...)` | `setYPersAndPartnerGrossDiffMonthL1(...)` | `yPersAndPartnerGrossDiffMonthL1` | +| `setYpnbihs_dv_lag1(...)` | `setYNonBenPersGrossMonthL1(...)` | `yNonBenPersGrossMonthL1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old income method references in Java source/tests/XML/properties: none +- Reflective getter strings updated: `getYNonBenPersGrossMonth`, `getYCapitalPersMonth`, `getYPensPersGrossMonth`, `getYMiscPersGrossMonth`, and `getYEmpPersGrossMonth` +- Compatibility wrappers: none retained + +The `Lag` annotation example was also updated from `getyEmpPersGrossMonth` to `getYEmpPersGrossMonth`. + +## 9. Completed: Person Demographic Fields + +Completed demographic-related accessor renames in `src/main/java/simpaths/model/Person.java` and Java call sites under `src/main/java`. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getDot01()` | `getDemEthnC6()` | `demEthnC6` | +| `setDot01(...)` | `setDemEthnC6(...)` | `demEthnC6` | +| `getDcpst()` | `getDemPartnerStatus()` | computed from partner state or `i_demPartnerStatus` | +| `setDcpstLocal(...)` | `setDemPartnerStatusLocal(...)` | `i_demPartnerStatus` | +| `getDcpagdf()` | `getDemAgePartnerDiff()` | computed from `demAge` and partner `demAge` | +| `setDcpst_lag1(...)` | `setDemPartnerStatusL1(...)` | `demPartnerStatusL1` | +| `setDcpagdf_lag1(...)` | `setDemAgePartnerDiffL1(...)` | `demAgePartnerDiffL1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old `Person` demographic method references in Java source/tests/XML/properties: none +- Reflective getter strings updated: `@Lag(getter="getDemPartnerStatus")` +- Compatibility wrappers: none retained + +Intentional retained names: + +- `States.getDcpst()` remains unchanged because it is a decision-state API, not a `Person` accessor. + +## 10. Completed: Remaining Person Education And Social-Care Flags + +Completed remaining `Person` accessor renames that still used survey-code-like names or did not yet match backing fields. Social-care methods used the strict field-name rule for consistency. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getDer()` | `getEduReturnFlag()` | `eduReturnFlag` | +| `setDer(...)` | `setEduReturnFlag(...)` | `eduReturnFlag` | +| `getSedex()` | `getEduExitSampleFlag()` | `eduExitSampleFlag` | +| `setSedex(...)` | `setEduExitSampleFlag(...)` | `eduExitSampleFlag` | +| `getNeedSocialCare()` | `getCareNeedFlag()` | `careNeedFlag` | +| `setNeedSocialCare(...)` | `setCareNeedFlag(...)` | `careNeedFlag` | +| `setSocialCareFromOther(...)` | `setCareFromInformalFlag(...)` | `careFromInformalFlag` | +| `setCareHoursFromOtherWeekly_lag1(...)` | `setCareHrsInformalWeekL1(...)` | `careHrsInformalWeekL1` | +| `setCareHoursFromFormalWeekly_lag1(...)` | `setCareHrsFormalWeekL1(...)` | `careHrsFormalWeekL1` | +| `setSocialCareProvision_lag1(...)` | `setCareProvidedFlagL1(...)` | `careProvidedFlagL1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old method references in Java source/tests/XML/properties: none +- Compatibility wrappers: none retained + +## 11. Completed: BenefitUnit Accessors + +Completed broad `BenefitUnit` accessor pass in small controlled batches rather than renaming every accessor at once. + +Inspection notes: + +- `BenefitUnit` has many computed/domain accessors that already read naturally and should not be renamed just because they do not map one-to-one to a field. Examples: `getWeight()`, `getChildren()`, `getOccupancy()`, `getCoupleBoolean()`, `getRefPersonForDecisions()`, and regression helper methods. +- Prioritise methods that expose a backing field but still use survey-code names, inconsistent lag suffixes, or temporary/proxy names. +- For proxy/regression-state setters backed by transient `i_...` fields, prefer the strict `I_...` field-name form. +- Update `@Lag(getter=...)` strings in the same batch as the getter rename. + +Completion checkpoint: + +- Completed batches: local proxy state; children and poverty lags; household income and quintile fields; wealth and costs. +- Compile validation: `mvn test -DskipTests` passed after each `BenefitUnit` batch. +- Focused checkpoint command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused checkpoint result: passed on 2026-04-28, 29 tests run, 0 failures, 0 errors, 0 skipped. +- Compatibility wrappers: none retained for the renamed `BenefitUnit` APIs. +- Deliberately retained APIs: computed/domain `BenefitUnit` methods such as `getRegion()`, `getOccupancy()`, `getDemCompHhC4()`, and non-`BenefitUnit` similarly named APIs documented below. + +### 11.1. Completed: BenefitUnit Local Proxy State + +These are used by `Expectations` to initialise proxy objects for decision/regression evaluation. The final names keep the `I_` prefix because the backing fields begin with `i_`. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `setDeh_c4Local(...)` | `setI_eduHighestC4(...)` | `i_eduHighestC4` | +| `setOccupancyLocal(...)` | `setI_demOccupancy(...)` | `i_demOccupancy` | +| `setLabourHoursWeekly1Local(...)` | `setI_labHrsWork1Week(...)` | `i_labHrsWork1Week` | +| `setLabourHoursWeekly2Local(...)` | `setI_labHrsWork2Week(...)` | `i_labHrsWork2Week` | +| `setYearLocal(...)` | `setI_demYear(...)` | `i_demYear` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old `BenefitUnit` local proxy method references in Java source/tests/XML/properties: none + +Intentional retained names: + +- `Person` proxy setters backed by `i_...` fields are handled separately in the planned `Person Local Proxy Setters` batch. + +### 11.2. Completed: BenefitUnit Children And Poverty Lags + +These methods exposed lag fields but used `_lag1` names or compact child-age names. They were renamed to backing-field style. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getNumberChildrenAll_lag1()` | `getNumberChildrenAllL1()` | `numberChildrenAll_lag1` | +| `getNumberChildren02_lag1()` | `getNumberChildren02L1()` | `numberChildren02_lag1` | +| `getIndicatorChildren03_lag1()` | `getDem0to3L1()` | `dem0to3L1` | +| `getIndicatorChildren412_lag1()` | `getDem4to12L1()` | `dem4to12L1` | +| `getAtRiskOfPoverty_lag1()` | `getYPvrtyFlagL1()` | `yPvrtyFlagL1` | +| `getAtRiskOfPoverty()` | `getYPvrtyFlag()` | `yPvrtyFlag`; updated `@Lag(getter = "getYPvrtyFlag")`. | +| `setAtRiskOfPoverty(...)` | `setYPvrtyFlag(...)` | `yPvrtyFlag` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed, 29 tests run +- Remaining old `BenefitUnit` children/poverty method references in Java source/tests/XML/properties: none +- Compatibility wrappers: none retained + +Intentional retained names: + +- `Person.getAtRiskOfPoverty()` remains unchanged because it is a person-level derived API that delegates to `benefitUnit.getYPvrtyFlag()`. +- `Person.class, "getAtRiskOfPoverty"` reflective strings in poverty plot setup remain unchanged because they target the retained `Person` method, not `BenefitUnit`. + +### 11.3. Completed: BenefitUnit Household Income And Quintile Fields + +These were mostly survey-code-like names or temporary names around household income/quintiles. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getYdses_c5()` | `getYHhQuintilesMonthC5()` | `yHhQuintilesMonthC5` | +| `getYdses_c5_lag1()` | `getYHhQuintilesMonthC5L1()` | `yHhQuintilesMonthC5L1` | +| `getTmpHHYpnbihs_dv_asinhNoNull()` | `getI_yNonBenHhGrossAsinhNoNull()` | `i_yNonBenHhGrossAsinh` | +| `getTmpHHYpnbihs_dv_asinh()` | `getI_yNonBenHhGrossAsinh()` | `i_yNonBenHhGrossAsinh` | +| `setTmpHHYpnbihs_dv_asinh(...)` | `setI_yNonBenHhGrossAsinh(...)` | `i_yNonBenHhGrossAsinh` | + +Related private helper renames: + +- `Person.getYdses_c5_lag1()` -> `Person.getYHhQuintilesMonthC5L1()` +- `Person.getYdses_c5_current()` -> `Person.getYHhQuintilesMonthC5Current()` + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused checkpoint command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused checkpoint result: passed on 2026-04-28, 29 tests run +- Remaining old household income/quintile method references in Java source/tests/XML/properties: none +- Compatibility wrappers: none retained + +Intentional retained names: + +- Statistics percentile methods such as `getYdses_p20()` remain unchanged because they are not `BenefitUnit` field accessors in this batch. + +### 11.4. Completed: BenefitUnit Wealth And Costs + +These names were domain-readable but did not match backing fields. They were renamed using the strict field-name rule for consistency with the rest of this branch. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getLiquidWealth(...)` | `getWealthTotValue(...)` | `wealthTotValue` | +| `getPensionWealth(...)` | `getWealthPensValue(...)` | `wealthPensValue` | +| `setPensionWealth(...)` | `setWealthPensValue(...)` | `wealthPensValue` | +| `getHousingWealth(...)` | `getWealthPrptyValue(...)` | `wealthPrptyValue` | +| `setHousingWealth(...)` | `setWealthPrptyValue(...)` | `wealthPrptyValue` | +| `getChildcareCostPerWeek(...)` | `getXChildCareWeek(...)` | `xChildCareWeek` | +| `getSocialCareCostPerWeek(...)` | `getXCareWeek(...)` | `xCareWeek` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Focused checkpoint command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused checkpoint result: passed on 2026-04-28, 29 tests run +- Compatibility wrappers: none retained + +Intentional retained names: + +- `Person.getLiquidWealth()` remains unchanged because it is a person-level wealth accessor. +- `Parameters.getLiquidWealthDiscount(...)`, `Parameters.getPensionWealthDiscount(...)`, and `Parameters.getHousingWealthDiscount(...)` remain unchanged because they are parameter APIs, not `BenefitUnit` getters. +- Decision-grid wealth APIs such as `States.getLiquidWealth()` and `WriteGridsBean.getLiquidWealth()` remain unchanged. +- Tax-key methods such as `DonorKeys.getChildcareCostPerWeek()` and `KeyFunction.getChildcareCostPerWeek()` remain unchanged because they are outside the `BenefitUnit` model batch. + +### 11.5. Do Not Rename In Initial BenefitUnit Pass + +- `getRegion()` / `setRegion(...)`: already direct and widely used across `Person`, filters, matching, and migration logic. +- `getOccupancy()`: computed domain value, not a direct getter for `i_demOccupancy`. +- `getDemCompHhC4()`: computed household composition matching the existing field and `@Lag` usage. +- Regression enum values such as `MaleLeisure_MaleDeh_c3_Low`: these are model variable IDs, not getter/setter APIs. +- Non-`BenefitUnit` similarly named methods, especially decision-state APIs. + +## 12. Completed: Household Accessors + +Inspection of `src/main/java/simpaths/model/Household.java` found one clear accessor mismatch. The class is small, and most accessors are either computed/domain APIs or framework identifiers. + +### 12.1. Completed: Household Original ID Accessor + +Completed rename: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getIdOriginalHH()` | `getIdHhOriginal()` | `idHhOriginal` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Remaining `Household.getIdOriginalHH()` references in Java source/tests/XML/properties: none +- Compatibility wrappers: none retained + +Do not rename in this pass: + +- `getId()` returns the simulation/panel key ID, not `idHhOriginal`. +- `getBenefitUnits()` matches the `benefitUnits` collection. +- `setProcessed(...)` sets `processed` and also updates `key.workingId`; the current name is appropriate for the backing relationship. +- `setHouseholdIdCounter(...)` is a static counter API, not an instance-field accessor. +- `getWeight()`, `setWeight(...)`, and `getEquivalisedDisposableIncomeYearly()` are computed/domain APIs. + +## 13. Completed: Original Household ID Accessors + +After completing `Household`, the same field-name mismatch remained in nearby model classes. This batch was coherent, low-risk, and limited to copy-constructor/internal call sites. + +Completed renames: + +| Old method | New method | Backing field | Class | +| --- | --- | --- | --- | +| `getIdOriginalHH()` | `getIdHhOriginal()` | `idHhOriginal` | `Person` | +| `getIdOriginalHH()` | `getIdHhOriginal()` | `idHhOriginal` | `BenefitUnit` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Local focused checkpoint command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Local focused checkpoint result: passed on 2026-04-28 at 14:58:36, 29 tests run, 0 failures, 0 errors, 0 skipped +- Remaining `getIdOriginalHH()` references in Java source/tests/XML/properties: none +- Compatibility wrappers: none retained + +## 14. Completed: Original Person And Benefit-Unit ID Accessors + +Completed remaining original-ID accessors in `Person` and `BenefitUnit`. They had direct backing-field mismatches and limited constructor call sites. + +Completed renames: + +| Old method | New method | Backing field | Class | +| --- | --- | --- | --- | +| `getIdOriginalPerson()` | `getIdPersOriginal()` | `idPersOriginal` | `Person` | +| `getIdOriginalBU()` | `getIdBuOriginal()` | `idBuOriginal` | `Person` | +| `getIdOriginalBU()` | `getIdBuOriginal()` | `idBuOriginal` | `BenefitUnit` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Local focused checkpoint command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Local focused checkpoint result: passed on 2026-04-28 at 14:58:36, 29 tests run, 0 failures, 0 errors, 0 skipped +- Remaining old original person/benefit-unit ID method references in Java source/tests/XML/properties: none +- Compatibility wrappers: none retained + +## 15. Completed: ID Accessor Checkpoint + +The ID accessor batches for `Household`, `Person`, and `BenefitUnit` have a shared focused validation checkpoint. + +- Scope: `Household.getIdHhOriginal()`, `Person.getIdHhOriginal()`, `BenefitUnit.getIdHhOriginal()`, `Person.getIdPersOriginal()`, `Person.getIdBuOriginal()`, and `BenefitUnit.getIdBuOriginal()`. +- Local focused checkpoint command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Local focused checkpoint result: passed on 2026-04-28 at 14:58:36, 29 tests run, 0 failures, 0 errors, 0 skipped +- Maven result: `BUILD SUCCESS` + +## 16. Completed: Final Runtime Checkpoint + +The current rename scope is frozen before colleague discussion. + +- Focused test command: `mvn "-Dtest=PersonTest,EmploymentHistoryFilterTest,EmploymentStatisticsTest" test` +- Focused test result: passed on 2026-04-29, 29 tests run, 0 failures, 0 errors, 0 skipped +- Maven result: `BUILD SUCCESS` +- Runtime validation: single simulation run completed without errors +- Runtime validation: multirun completed without errors +- Remaining computed/helper APIs are intentionally deferred for colleague discussion. + + +## 17. Planned: Remaining Person Underscore-Style Accessors + +Inspection of `src/main/java/simpaths/model/Person.java` found remaining public accessors with underscores. Split them into direct field-backed renames and computed helper APIs. Direct field-backed methods can continue through the normal branch workflow. Computed helpers are labelled "to be determined" because they do not have a clear one-to-one backing-field rename. + +### 17.1. Completed: Person Direct Field-Backed Residuals + +These had clear backing fields and were renamed under the strict field-name rule. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `getHousehold_status_lag()` | `getDemStatusHhL1()` | `demStatusHhL1` | +| `setNewWorkHours_lag1(...)` | `setLabHrsWorkNewL1(...)` | `labHrsWorkNewL1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Remaining old direct field-backed residual method references in Java source/tests/XML/properties: none + +### 17.2. Completed: Person Benefit Receipt Lag Flags + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `setReceivesBenefitsFlag_L1(...)` | `setYBenReceivedFlagL1(...)` | `yBenReceivedFlagL1` | +| `setReceivesBenefitsFlagUC_L1(...)` | `setYBenUCReceivedFlagL1(...)` | `yBenUCReceivedFlagL1` | +| `setReceivesBenefitsFlagNonUC_L1(...)` | `setYBenNonUCReceivedFlagL1(...)` | `yBenNonUCReceivedFlagL1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Remaining old benefit lag setter references in Java source/tests/XML/properties: none + +Intentional exclusions: + +- Boolean `is...` methods such as `isReceivesBenefitsFlag_L1()`, `isReceivesBenefitsFlagUC_L1()`, and `isReceivesBenefitsFlagNonUC_L1()` are excluded because the current branch scope is getter/setter method names, not boolean predicate APIs. + +### 17.3. Completed: Person Local Proxy Setters + +These are used by decision expectation proxy objects. Under the strict `i_` rule, methods for fields beginning with `i_` keep the `I_` prefix. + +Completed renames: + +| Old method | New method | Backing field | +| --- | --- | --- | +| `setRegionLocal(...)` | `setI_demRgn(...)` | `i_demRgn` | +| `setDemPartnerStatusLocal(...)` | `setI_demPartnerStatus(...)` | `i_demPartnerStatus` | +| `setYearLocal(...)` | `setI_demYear(...)` | `i_demYear` | +| `setNumberChildren017Local(...)` | `setI_demNchild0to17(...)` | `i_demNchild0to17` | +| `setIndicatorChildren02Local(...)` | `setI_demNChild0to2(...)` | `i_demNChild0to2` | +| `setNumberChildrenAllLocal(...)` | `setI_demNchild(...)` | `i_demNchild` | +| `setI_yHhQuintilesC5(...)` | no rename needed | `i_yHhQuintilesC5` | +| `setI_demCompHhC4L1(...)` | no rename needed | `i_demCompHhC4L1` | +| `setNumberChildrenAllLocal_lag1(...)` | `setI_demNchildL1(...)` | `i_demNchildL1` | +| `setNumberChildren02Local_lag1(...)` | `setI_demNchild0to2L1(...)` | `i_demNchild0to2L1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed +- Remaining old local proxy setter references in Java source/tests/XML/properties: none + +### 17.4. Partially Completed: Person Computed Helper APIs + +These methods do not directly expose a backing field or they add fallback/defaulting/domain logic. Rename only where the team agrees a clear computed-helper naming rule. + +Agreed exception: + +- Computed binary indicator helpers may use semantic `...FlagL1` names when they return `0/1`, derive from a lagged state field, and have no direct backing field. + +| Current method | Reason to defer | +| --- | --- | +| `getCovidModuleGrossLabourIncome_Baseline()` | returns `covidYLabGross` with defaulting; no `covidYLabGrossBaseline` backing field | +| `setCovidModuleGrossLabourIncome_Baseline(...)` | sets `covidYLabGross`, but the "Baseline" method name is domain-specific | +| `getHoursFormalSocialCare_L1()` | returns `careHrsFormalWeekL1` with zero floor/defaulting | +| `getHoursInformalSocialCare_L1()` | returns `careHrsInformalWeekL1` with zero floor/defaulting | +| `getTotalHoursSocialCare_L1()` | computed formal + informal lag hours | +| `getCareHoursFromParent_L1()` | computed helper, currently zero | +| `getCareHoursFromPartner_L1()` | computed from partner status and informal lag hours | +| `getCareHoursFromDaughter_L1()` | computed helper, currently zero | +| `getCareHoursFromSon_L1()` | computed helper, currently zero | +| `getCareHoursFromOther_L1()` | computed from partner status and informal lag hours | +| `getYnbcpdf_dv()` | computed current difference between own and partner non-benefit gross personal income; used as a `@Lag` source | + +Completed computed indicator helper renames: + +| Old method | New method | Reason | +| --- | --- | --- | +| `getEmployed_Lag1()` | `getEmployedFlagL1()` | computed `0/1` indicator from `labC4L1` | +| `getNonwork_Lag1()` | `getNonworkFlagL1()` | computed `0/1` indicator from `labC4L1` | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed on 2026-05-08 +- Remaining old computed indicator helper references in Java source/tests/XML/properties: none + + + +## 18. Inspected: Outside Person BenefitUnit Household + +Inspection outside the current `Person` / `BenefitUnit` / `Household` pass did not find another clear model-entity field-backed accessor batch comparable to the completed work. Remaining public `get...` / `set...` methods with underscores or survey-code names mostly fall into output/statistics, parameter, tax donor, or computed helper APIs. + +### 18.1. Completed: Statistics Output Beans + +These methods are direct setters/getters in statistics output classes. Java method names were aligned to backing fields while leaving persisted `@Column` names unchanged. + +| Class | Current method group | New method group | +| --- | --- | --- | +| `Statistics` | `getYdses_p20()` / `setYdses_p20(...)` | `getYHhQuintilesC5P20()` / `setYHhQuintilesC5P20(...)` | +| `Statistics` | `getYdses_p40()` / `setYdses_p40(...)` | `getYHhQuintilesC5P40()` / `setYHhQuintilesC5P40(...)` | +| `Statistics` | `getYdses_p60()` / `setYdses_p60(...)` | `getYHhQuintilesC5P60()` / `setYHhQuintilesC5P60(...)` | +| `Statistics` | `getYdses_p80()` / `setYdses_p80(...)` | `getYHhQuintilesC5P80()` / `setYHhQuintilesC5P80(...)` | +| `Statistics` | `getsIndex_p50()` / `setsIndex_p50(...)` | `getSIndex_p50()` / `setSIndex_p50(...)` | +| `Statistics` | `getGrossLabourIncome_p20()` / `setGrossLabourIncome_p20(...)` | `getYLabP20()` / `setYLabP20(...)` | +| `Statistics` | `getGrossLabourIncome_p40()` / `setGrossLabourIncome_p40(...)` | `getYLabP40()` / `setYLabP40(...)` | +| `Statistics` | `getGrossLabourIncome_p60()` / `setGrossLabourIncome_p60(...)` | `getYLabP60()` / `setYLabP60(...)` | +| `Statistics` | `getGrossLabourIncome_p80()` / `setGrossLabourIncome_p80(...)` | `getYLabP80()` / `setYLabP80(...)` | +| `HealthStatistics` | `setDhm_*()` setters | `setHealthWbScore0to36*()` setters | +| `HealthStatistics` | `setDhe_mcs_*()` setters | `setHealthMentalMcs*()` setters | +| `HealthStatistics` | `setDhe_pcs_*()` setters | `setHealthPhysicalPcs*()` setters | +| `HealthStatistics` | `setDls_*()` setters | `setDemLifeSatScore0to10*()` setters | + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed on 2026-04-29 +- Case-sensitive stale-name scan for old statistics output method names: none + +Intentional retained names: + +- `getEdi_p50()` and `setEdi_p50(...)` remain unchanged because they already match the backing field `edi_p50`. +- Persisted `@Column` names such as `Ydses_p20`, `dhm_mean`, and `dhe_mcs_mean` remain unchanged. + +### 18.2. To Be Determined: Parameter And Regression Accessors + +`simpaths.data.Parameters` contains regression accessors such as `getRegC19LS_SE()`, `getRegC19LS_E1()`, and related Covid-19 labour-transition names. These expose regression IDs/model names rather than normal domain fields. + +Recommendation: do not rename in this pass. Treat them as parameter/regression identifier APIs unless a separate configuration naming policy is agreed. + +### 18.3. Completed: Tax Donor And Key APIs + +Tax donor/key `DLLTSD` accessors were renamed where the code already has a stable full-name equivalent, `healthDsblLongtermFlag`. + +| Class | Old name | New name | Backing field | +| --- | --- | --- | --- | +| `DonorPerson` | `getDlltsd()` | `getHealthDsblLongtermFlag()` | `healthDsblLongtermFlag` | +| `KeyFunction` | `dlltsdMan` | `healthDsblLongtermFlagMan` | `healthDsblLongtermFlagMan` | +| `KeyFunction` | `getDlltsdMan()` | `getHealthDsblLongtermFlagMan()` | `healthDsblLongtermFlagMan` | +| `KeyFunction` | `setDlltsdMan(...)` | `setHealthDsblLongtermFlagMan(...)` | `healthDsblLongtermFlagMan` | +| `KeyFunction` | `dlltsdWoman` | `healthDsblLongtermFlagWoman` | `healthDsblLongtermFlagWoman` | +| `KeyFunction` | `getDlltsdWoman()` | `getHealthDsblLongtermFlagWoman()` | `healthDsblLongtermFlagWoman` | +| `KeyFunction` | `setDlltsdWoman(...)` | `setHealthDsblLongtermFlagWoman(...)` | `healthDsblLongtermFlagWoman` | + +Notes: + +- Persisted donor-data column names such as `DLLTSD` remain unchanged. +- Constructor parameters and local matching variables using `dlltsd` remain unchanged where they represent survey-code/tax-key inputs rather than stored Java fields. + +Validation: + +- Compile command: `mvn test -DskipTests` +- Result: passed on 2026-05-08 + +### 18.4. To Be Determined: Computed Model Helper APIs + +`SimPathsModel` has computed projection helpers such as `getPopulationProjectionByAge0_18()`, `getPopulationProjectionByAge2_10()`, and similar age-band methods. They call `getPopulationProjectionByAge(startAge, endAge)` and do not expose backing fields. + +Recommendation: keep them in the same "computed helper" category as `Person.getEmployed_Lag1()` and similar methods. Do not rename until the team agrees a rule for computed helper APIs. + + + +## 19. Suggested Batch Order + +1. `Person` education fields. +2. `Person` labour status fields. +3. `Person` health fields. +4. `Person` income fields. +5. `Person` demographic fields. +6. `BenefitUnit` accessors. +7. Other model classes. +8. Filters, statistics, and decision-model call sites that remain after model class batches. + +Keep each batch small enough that compile errors clearly point to missed call sites from that batch. + +## 20. Validation + +After each batch: + +```powershell +mvn test +``` + +If the full test suite is too slow, at minimum run the normal compile target used by the project: + +```powershell +mvn test -DskipTests +``` + +Then search for old method names, for example: + +```powershell +rg -n "getDeh_c4|setDeh_c4|setDeh_c4_lag1" src/main/java +``` + +If `rg` is unavailable, use PowerShell: + +```powershell +Get-ChildItem -Path src/main/java -Recurse -Filter *.java | + Select-String -Pattern "getDeh_c4|setDeh_c4|setDeh_c4_lag1" +``` + +## 21. Review Checklist + +- [ ] Method declaration renamed. +- [ ] Java call sites renamed. +- [ ] No unintended resource, SQL, input-column, or survey-code changes. +- [ ] Old method name no longer appears in Java source, unless deliberately retained as a temporary deprecated wrapper. +- [ ] Project compiles. +- [ ] Relevant tests pass or skipped tests are explicitly noted. + +## 22. Temporary Compatibility Wrappers + +Prefer complete renames without wrappers on this branch. + +Only add deprecated wrapper methods if another active branch or external integration needs temporary compatibility: + +```java +@Deprecated +public Education getDeh_c4() { + return getEduHighestC4(); +} +``` + +Remove wrappers before the final cleanup unless there is a documented reason to keep them. diff --git a/documentation/flowcharts/flowchart_review_prompt.md b/documentation/flowcharts/flowchart_review_prompt.md new file mode 100644 index 000000000..bdf485804 --- /dev/null +++ b/documentation/flowcharts/flowchart_review_prompt.md @@ -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. diff --git a/src/main/java/simpaths/data/TestRegressions.java b/src/main/java/simpaths/data/TestRegressions.java index 143f845a9..7c123a6ab 100644 --- a/src/main/java/simpaths/data/TestRegressions.java +++ b/src/main/java/simpaths/data/TestRegressions.java @@ -26,20 +26,20 @@ private static & 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"); diff --git a/src/main/java/simpaths/data/filters/CanBePartneredCSfilter.java b/src/main/java/simpaths/data/filters/CanBePartneredCSfilter.java index a6f393b06..b2cea86f9 100644 --- a/src/main/java/simpaths/data/filters/CanBePartneredCSfilter.java +++ b/src/main/java/simpaths/data/filters/CanBePartneredCSfilter.java @@ -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!"); diff --git a/src/main/java/simpaths/data/filters/EducationCSfilter.java b/src/main/java/simpaths/data/filters/EducationCSfilter.java index c89c25a9b..f8fd71c78 100644 --- a/src/main/java/simpaths/data/filters/EducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/EducationCSfilter.java @@ -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); } diff --git a/src/main/java/simpaths/data/filters/EducationEmployedCSfilter.java b/src/main/java/simpaths/data/filters/EducationEmployedCSfilter.java index 69f7ab1a8..313b57608 100644 --- a/src/main/java/simpaths/data/filters/EducationEmployedCSfilter.java +++ b/src/main/java/simpaths/data/filters/EducationEmployedCSfilter.java @@ -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)); } diff --git a/src/main/java/simpaths/data/filters/EmploymentHistoryFilter.java b/src/main/java/simpaths/data/filters/EmploymentHistoryFilter.java index 908d762e9..b709fa858 100644 --- a/src/main/java/simpaths/data/filters/EmploymentHistoryFilter.java +++ b/src/main/java/simpaths/data/filters/EmploymentHistoryFilter.java @@ -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"); } diff --git a/src/main/java/simpaths/data/filters/FemaleAgeGroupEducationCSfilter.java b/src/main/java/simpaths/data/filters/FemaleAgeGroupEducationCSfilter.java index bcab20bb3..93f682730 100644 --- a/src/main/java/simpaths/data/filters/FemaleAgeGroupEducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/FemaleAgeGroupEducationCSfilter.java @@ -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) ); } } diff --git a/src/main/java/simpaths/data/filters/FemalesAgeGroupEducationCSfilter.java b/src/main/java/simpaths/data/filters/FemalesAgeGroupEducationCSfilter.java index 728f6c86e..26cd65181 100644 --- a/src/main/java/simpaths/data/filters/FemalesAgeGroupEducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/FemalesAgeGroupEducationCSfilter.java @@ -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) ) ); } diff --git a/src/main/java/simpaths/data/filters/FemalesWithChildrenAgeGroupEducationCSfilter.java b/src/main/java/simpaths/data/filters/FemalesWithChildrenAgeGroupEducationCSfilter.java index 34d9f1eef..4cfa2edc6 100644 --- a/src/main/java/simpaths/data/filters/FemalesWithChildrenAgeGroupEducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/FemalesWithChildrenAgeGroupEducationCSfilter.java @@ -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)) ); } diff --git a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByAgeAndGenderFilter.java b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByAgeAndGenderFilter.java index 0ce0f34ad..18395b532 100644 --- a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByAgeAndGenderFilter.java +++ b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByAgeAndGenderFilter.java @@ -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); } } diff --git a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByEducationFilter.java b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByEducationFilter.java index d6c1327ab..fd26e481d 100644 --- a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByEducationFilter.java +++ b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyByEducationFilter.java @@ -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)); } } diff --git a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyFilter.java b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyFilter.java index 153737df5..112829755 100644 --- a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyFilter.java +++ b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyFilter.java @@ -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); } } diff --git a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyPersonFilter.java b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyPersonFilter.java index ffdb2325c..434cdc6c5 100644 --- a/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyPersonFilter.java +++ b/src/main/java/simpaths/data/filters/FlexibleInLabourSupplyPersonFilter.java @@ -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); } diff --git a/src/main/java/simpaths/data/filters/GenderEducationCSfilter.java b/src/main/java/simpaths/data/filters/GenderEducationCSfilter.java index c2ec1d24a..835b34984 100644 --- a/src/main/java/simpaths/data/filters/GenderEducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/GenderEducationCSfilter.java @@ -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!"); } diff --git a/src/main/java/simpaths/data/filters/GenderEducationWorkingCSfilter.java b/src/main/java/simpaths/data/filters/GenderEducationWorkingCSfilter.java index 067359d78..2bbfd43a9 100644 --- a/src/main/java/simpaths/data/filters/GenderEducationWorkingCSfilter.java +++ b/src/main/java/simpaths/data/filters/GenderEducationWorkingCSfilter.java @@ -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); } diff --git a/src/main/java/simpaths/data/filters/GenderWorkingCSfilter.java b/src/main/java/simpaths/data/filters/GenderWorkingCSfilter.java index 4121a1cd3..944c8367b 100644 --- a/src/main/java/simpaths/data/filters/GenderWorkingCSfilter.java +++ b/src/main/java/simpaths/data/filters/GenderWorkingCSfilter.java @@ -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!"); } diff --git a/src/main/java/simpaths/data/filters/MaleAgeGroupEducationCSfilter.java b/src/main/java/simpaths/data/filters/MaleAgeGroupEducationCSfilter.java index e5886e19d..0f279097a 100644 --- a/src/main/java/simpaths/data/filters/MaleAgeGroupEducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/MaleAgeGroupEducationCSfilter.java @@ -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) ); } } diff --git a/src/main/java/simpaths/data/filters/RegionEducationAtRiskOfWorkCSfilter.java b/src/main/java/simpaths/data/filters/RegionEducationAtRiskOfWorkCSfilter.java index 4addb48c4..f2f7f18d3 100644 --- a/src/main/java/simpaths/data/filters/RegionEducationAtRiskOfWorkCSfilter.java +++ b/src/main/java/simpaths/data/filters/RegionEducationAtRiskOfWorkCSfilter.java @@ -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!"); diff --git a/src/main/java/simpaths/data/filters/RegionEducationCSfilter.java b/src/main/java/simpaths/data/filters/RegionEducationCSfilter.java index aa26b387c..467ffbcde 100644 --- a/src/main/java/simpaths/data/filters/RegionEducationCSfilter.java +++ b/src/main/java/simpaths/data/filters/RegionEducationCSfilter.java @@ -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!"); diff --git a/src/main/java/simpaths/data/filters/RegionEducationWorkingCSfilter.java b/src/main/java/simpaths/data/filters/RegionEducationWorkingCSfilter.java index f5cafed61..4884b5c22 100644 --- a/src/main/java/simpaths/data/filters/RegionEducationWorkingCSfilter.java +++ b/src/main/java/simpaths/data/filters/RegionEducationWorkingCSfilter.java @@ -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!"); diff --git a/src/main/java/simpaths/data/filters/ValidEducationAgeGroupCSfilter.java b/src/main/java/simpaths/data/filters/ValidEducationAgeGroupCSfilter.java index 91bbc5324..a9afa1890 100644 --- a/src/main/java/simpaths/data/filters/ValidEducationAgeGroupCSfilter.java +++ b/src/main/java/simpaths/data/filters/ValidEducationAgeGroupCSfilter.java @@ -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)); } } diff --git a/src/main/java/simpaths/data/filters/ValidEducationRegionCSfilter.java b/src/main/java/simpaths/data/filters/ValidEducationRegionCSfilter.java index 2d56ba6f1..6da5c30cd 100644 --- a/src/main/java/simpaths/data/filters/ValidEducationRegionCSfilter.java +++ b/src/main/java/simpaths/data/filters/ValidEducationRegionCSfilter.java @@ -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) { diff --git a/src/main/java/simpaths/data/statistics/AlignmentAdjustmentFactors.java b/src/main/java/simpaths/data/statistics/AlignmentAdjustmentFactors.java index 439c4c06a..b403162d5 100644 --- a/src/main/java/simpaths/data/statistics/AlignmentAdjustmentFactors.java +++ b/src/main/java/simpaths/data/statistics/AlignmentAdjustmentFactors.java @@ -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); @@ -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)); diff --git a/src/main/java/simpaths/data/statistics/HealthStatistics.java b/src/main/java/simpaths/data/statistics/HealthStatistics.java index 6f10222b0..d418192f3 100644 --- a/src/main/java/simpaths/data/statistics/HealthStatistics.java +++ b/src/main/java/simpaths/data/statistics/HealthStatistics.java @@ -115,99 +115,99 @@ public void setGender(String demSex) { this.demSex = demSex; } - public void setDhm_mean(double healthWbScore0to36Avg) { + public void setHealthWbScore0to36Avg(double healthWbScore0to36Avg) { this.healthWbScore0to36Avg = healthWbScore0to36Avg; } - public void setDhm_median(double healthWbScore0to36P50) { + public void setHealthWbScore0to36P50(double healthWbScore0to36P50) { this.healthWbScore0to36P50 = healthWbScore0to36P50; } - public void setDhm_p_10(double healthWbScore0to36P10) { + public void setHealthWbScore0to36P10(double healthWbScore0to36P10) { this.healthWbScore0to36P10 = healthWbScore0to36P10; } - public void setDhm_p_90(double healthWbScore0to36P90) { + public void setHealthWbScore0to36P90(double healthWbScore0to36P90) { this.healthWbScore0to36P90 = healthWbScore0to36P90; } - public void setDhm_p_25(double healthWbScore0to36P25) { + public void setHealthWbScore0to36P25(double healthWbScore0to36P25) { this.healthWbScore0to36P25 = healthWbScore0to36P25; } - public void setDhm_p_75(double healthWbScore0to36P75) { + public void setHealthWbScore0to36P75(double healthWbScore0to36P75) { this.healthWbScore0to36P75 = healthWbScore0to36P75; } - public void setDhe_mcs_mean(double healthMentalMcsAvg) { + public void setHealthMentalMcsAvg(double healthMentalMcsAvg) { this.healthMentalMcsAvg = healthMentalMcsAvg; } - public void setDhe_mcs_median(double healthMentalMcsP50) { + public void setHealthMentalMcsP50(double healthMentalMcsP50) { this.healthMentalMcsP50 = healthMentalMcsP50; } - public void setDhe_mcs_p_10(double healthMentalMcsP10) { + public void setHealthMentalMcsP10(double healthMentalMcsP10) { this.healthMentalMcsP10 = healthMentalMcsP10; } - public void setDhe_mcs_p_90(double healthMentalMcsP90) { + public void setHealthMentalMcsP90(double healthMentalMcsP90) { this.healthMentalMcsP90 = healthMentalMcsP90; } - public void setDhe_mcs_p_25(double healthMentalMcsP25) { + public void setHealthMentalMcsP25(double healthMentalMcsP25) { this.healthMentalMcsP25 = healthMentalMcsP25; } - public void setDhe_mcs_p_75(double healthMentalMcsP75) { + public void setHealthMentalMcsP75(double healthMentalMcsP75) { this.healthMentalMcsP75 = healthMentalMcsP75; } - public void setDhe_pcs_mean(double healthPhysicalPcsAvg) { + public void setHealthPhysicalPcsAvg(double healthPhysicalPcsAvg) { this.healthPhysicalPcsAvg = healthPhysicalPcsAvg; } - public void setDhe_pcs_median(double healthPhysicalPcsP50) { + public void setHealthPhysicalPcsP50(double healthPhysicalPcsP50) { this.healthPhysicalPcsP50 = healthPhysicalPcsP50; } - public void setDhe_pcs_p_10(double healthPhysicalPcsP10) { + public void setHealthPhysicalPcsP10(double healthPhysicalPcsP10) { this.healthPhysicalPcsP10 = healthPhysicalPcsP10; } - public void setDhe_pcs_p_90(double healthPhysicalPcsP90) { + public void setHealthPhysicalPcsP90(double healthPhysicalPcsP90) { this.healthPhysicalPcsP90 = healthPhysicalPcsP90; } - public void setDhe_pcs_p_25(double healthPhysicalPcsP25) { + public void setHealthPhysicalPcsP25(double healthPhysicalPcsP25) { this.healthPhysicalPcsP25 = healthPhysicalPcsP25; } - public void setDhe_pcs_p_75(double healthPhysicalPcsP75) { + public void setHealthPhysicalPcsP75(double healthPhysicalPcsP75) { this.healthPhysicalPcsP75 = healthPhysicalPcsP75; } - public void setDls_mean(double demLifeSatScore0to10Avg) { + public void setDemLifeSatScore0to10Avg(double demLifeSatScore0to10Avg) { this.demLifeSatScore0to10Avg = demLifeSatScore0to10Avg; } - public void setDls_median(double demLifeSatScore0to10P50) { + public void setDemLifeSatScore0to10P50(double demLifeSatScore0to10P50) { this.demLifeSatScore0to10P50 = demLifeSatScore0to10P50; } - public void setDls_p_10(double demLifeSatScore0to10P10) { + public void setDemLifeSatScore0to10P10(double demLifeSatScore0to10P10) { this.demLifeSatScore0to10P10 = demLifeSatScore0to10P10; } - public void setDls_p_90(double demLifeSatScore0to10P90) { + public void setDemLifeSatScore0to10P90(double demLifeSatScore0to10P90) { this.demLifeSatScore0to10P90 = demLifeSatScore0to10P90; } - public void setDls_p_25(double demLifeSatScore0to10P25) { + public void setDemLifeSatScore0to10P25(double demLifeSatScore0to10P25) { this.demLifeSatScore0to10P25 = demLifeSatScore0to10P25; } - public void setDls_p_75(double demLifeSatScore0to10P75) { + public void setDemLifeSatScore0to10P75(double demLifeSatScore0to10P75) { this.demLifeSatScore0to10P75 = demLifeSatScore0to10P75; } @@ -244,16 +244,16 @@ public void update(SimPathsModel model, String gender_s) { MeanArrayFunction dhm_mean_f = new MeanArrayFunction(personsDhm); // Create MeanArrayFunction dhm_mean_f.applyFunction(); - setDhm_mean(dhm_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); + setHealthWbScore0to36Avg(dhm_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); PercentileArrayFunction percDhm_f = new PercentileArrayFunction(personsDhm); percDhm_f.applyFunction(); - setDhm_p_10(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); - setDhm_p_25(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); - setDhm_median(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); - setDhm_p_75(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); - setDhm_p_90(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); + setHealthWbScore0to36P10(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); + setHealthWbScore0to36P25(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); + setHealthWbScore0to36P50(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); + setHealthWbScore0to36P75(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); + setHealthWbScore0to36P90(percDhm_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); // mcs score CrossSection.Double personsMCS = new CrossSection.Double(model.getPersons(), Person.DoublesVariables.Dhe_mcs); @@ -262,16 +262,16 @@ public void update(SimPathsModel model, String gender_s) { MeanArrayFunction dhe_mcs_mean_f = new MeanArrayFunction(personsMCS); // Create MeanArrayFunction dhe_mcs_mean_f.applyFunction(); - setDhe_mcs_mean(dhe_mcs_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); + setHealthMentalMcsAvg(dhe_mcs_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); PercentileArrayFunction perc_dhe_mcs_f = new PercentileArrayFunction(personsMCS); perc_dhe_mcs_f.applyFunction(); - setDhe_mcs_p_10(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); - setDhe_mcs_p_25(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); - setDhe_mcs_median(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); - setDhe_mcs_p_75(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); - setDhe_mcs_p_90(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); + setHealthMentalMcsP10(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); + setHealthMentalMcsP25(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); + setHealthMentalMcsP50(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); + setHealthMentalMcsP75(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); + setHealthMentalMcsP90(perc_dhe_mcs_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); // pcs score CrossSection.Double personsPCS = new CrossSection.Double(model.getPersons(), Person.DoublesVariables.Dhe_pcs); @@ -280,16 +280,16 @@ public void update(SimPathsModel model, String gender_s) { MeanArrayFunction dhe_pcs_mean_f = new MeanArrayFunction(personsPCS); // Create MeanArrayFunction dhe_pcs_mean_f.applyFunction(); - setDhe_pcs_mean(dhe_pcs_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); + setHealthPhysicalPcsAvg(dhe_pcs_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); PercentileArrayFunction perc_dhe_pcs_f = new PercentileArrayFunction(personsPCS); perc_dhe_pcs_f.applyFunction(); - setDhe_pcs_p_10(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); - setDhe_pcs_p_25(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); - setDhe_pcs_median(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); - setDhe_pcs_p_75(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); - setDhe_pcs_p_90(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); + setHealthPhysicalPcsP10(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); + setHealthPhysicalPcsP25(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); + setHealthPhysicalPcsP50(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); + setHealthPhysicalPcsP75(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); + setHealthPhysicalPcsP90(perc_dhe_pcs_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); // Life Satisfaction score CrossSection.Double personsDls = new CrossSection.Double(model.getPersons(), Person.DoublesVariables.Dls); @@ -298,16 +298,16 @@ public void update(SimPathsModel model, String gender_s) { MeanArrayFunction dls_mean_f = new MeanArrayFunction(personsDls); // Create MeanArrayFunction dls_mean_f.applyFunction(); - setDls_mean(dls_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); + setDemLifeSatScore0to10Avg(dls_mean_f.getDoubleValue(IDoubleSource.Variables.Default)); PercentileArrayFunction perc_dls_f = new PercentileArrayFunction(personsDls); perc_dls_f.applyFunction(); - setDls_p_10(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); - setDls_p_25(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); - setDls_median(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); - setDls_p_75(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); - setDls_p_90(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); + setDemLifeSatScore0to10P10(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P10)); + setDemLifeSatScore0to10P25(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P25)); + setDemLifeSatScore0to10P50(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P50)); + setDemLifeSatScore0to10P75(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P75)); + setDemLifeSatScore0to10P90(perc_dls_f.getDoubleValue(PercentileArrayFunction.Variables.P90)); // QALYS as sum of EQ5D CrossSection.Double personEQ5D = new CrossSection.Double(model.getPersons(), Person.DoublesVariables.He_eq5d); diff --git a/src/main/java/simpaths/data/statistics/Statistics.java b/src/main/java/simpaths/data/statistics/Statistics.java index 25539f510..98d198fd4 100644 --- a/src/main/java/simpaths/data/statistics/Statistics.java +++ b/src/main/java/simpaths/data/statistics/Statistics.java @@ -75,75 +75,75 @@ public void setMedianEquivalisedHouseholdDisposableIncome(double yHhDispEquivP50 this.yHhDispEquivP50 = yHhDispEquivP50; } - public double getYdses_p20() { + public double getYHhQuintilesC5P20() { return yHhQuintilesC5P20; } - public void setYdses_p20(double yHhQuintilesC5P20) { + public void setYHhQuintilesC5P20(double yHhQuintilesC5P20) { this.yHhQuintilesC5P20 = yHhQuintilesC5P20; } - public double getYdses_p40() { + public double getYHhQuintilesC5P40() { return yHhQuintilesC5P40; } - public void setYdses_p40(double yHhQuintilesC5P40) { + public void setYHhQuintilesC5P40(double yHhQuintilesC5P40) { this.yHhQuintilesC5P40 = yHhQuintilesC5P40; } - public double getYdses_p60() { + public double getYHhQuintilesC5P60() { return yHhQuintilesC5P60; } - public void setYdses_p60(double yHhQuintilesC5P60) { + public void setYHhQuintilesC5P60(double yHhQuintilesC5P60) { this.yHhQuintilesC5P60 = yHhQuintilesC5P60; } - public double getYdses_p80() { + public double getYHhQuintilesC5P80() { return yHhQuintilesC5P80; } - public void setYdses_p80(double yHhQuintilesC5P80) { + public void setYHhQuintilesC5P80(double yHhQuintilesC5P80) { this.yHhQuintilesC5P80 = yHhQuintilesC5P80; } - public double getsIndex_p50() { + public double getSIndex_p50() { return sIndex_p50; } - public void setsIndex_p50(double sIndex_p50) { + public void setSIndex_p50(double sIndex_p50) { this.sIndex_p50 = sIndex_p50; } - public double getGrossLabourIncome_p20() { + public double getYLabP20() { return yLabP20; } - public void setGrossLabourIncome_p20(double yLabP20) { + public void setYLabP20(double yLabP20) { this.yLabP20 = yLabP20; } - public double getGrossLabourIncome_p40() { + public double getYLabP40() { return yLabP40; } - public void setGrossLabourIncome_p40(double yLabP40) { + public void setYLabP40(double yLabP40) { this.yLabP40 = yLabP40; } - public double getGrossLabourIncome_p60() { + public double getYLabP60() { return yLabP60; } - public void setGrossLabourIncome_p60(double yLabP60) { + public void setYLabP60(double yLabP60) { this.yLabP60 = yLabP60; } - public double getGrossLabourIncome_p80() { + public double getYLabP80() { return yLabP80; } - public void setGrossLabourIncome_p80(double yLabP80) { + public void setYLabP80(double yLabP80) { this.yLabP80 = yLabP80; } diff --git a/src/main/java/simpaths/data/statistics/Statistics2.java b/src/main/java/simpaths/data/statistics/Statistics2.java index bd7312bba..df3ae7023 100644 --- a/src/main/java/simpaths/data/statistics/Statistics2.java +++ b/src/main/java/simpaths/data/statistics/Statistics2.java @@ -630,8 +630,8 @@ public void update(SimPathsModel model) { prMarr[ii] += person.getCohabiting(); avkids[ii] += person.getBenefitUnit().getNumberChildrenAll(); - health[ii] += person.getDheValue(); - prDisa[ii] += (Indicator.True.equals(person.getDlltsd()))? 1.0: 0.0; + health[ii] += person.getHealthSelfRatedValue(); + prDisa[ii] += (Indicator.True.equals(person.getHealthDsblLongtermFlag()))? 1.0: 0.0; labInc[ii] += person.getEarningsWeekly(); if ((double)person.getLabourSupplyHoursWeekly() > Parameters.MIN_HOURS_FULL_TIME_EMPLOYED) workFT[ii] += 1.0; @@ -653,8 +653,8 @@ else if ((double)person.getLabourSupplyHoursWeekly() > 1.0) grossDisInc[ii] += person.getBenefitUnit().getDisposableIncomeMonthlyNoNull() / es; } double expenditurePerMonth = person.getBenefitUnit().getDiscretionaryConsumptionPerYear(false) / 12.0 + - person.getBenefitUnit().getChildcareCostPerWeek(false) * Parameters.WEEKS_PER_MONTH + - person.getBenefitUnit().getSocialCareCostPerWeek(false) * Parameters.WEEKS_PER_MONTH; + person.getBenefitUnit().getXChildCareWeek(false) * Parameters.WEEKS_PER_MONTH + + person.getBenefitUnit().getXCareWeek(false) * Parameters.WEEKS_PER_MONTH; if (expenditurePerMonth > 0.0) { expenditurePerMonth /= es; expen[ii] += Math.log(expenditurePerMonth); @@ -664,7 +664,7 @@ else if ((double)person.getLabourSupplyHoursWeekly() > 1.0) } if (person.getDemAge()>=55 && person.getDemAge()<=60) { - if (Education.High.equals(person.getDeh_c4())) { + if (Education.High.equals(person.getEduHighestC4())) { numberG += 1.0; ctlG += expenditurePerMonth / Parameters.WEEKS_PER_MONTH / person.getLeisureHoursPerWeek(); } else { @@ -672,7 +672,7 @@ else if ((double)person.getLabourSupplyHoursWeekly() > 1.0) ctlNG += expenditurePerMonth / Parameters.WEEKS_PER_MONTH / person.getLeisureHoursPerWeek(); } } - wealth[ii] += person.getBenefitUnit().getLiquidWealth(false) / es; + wealth[ii] += person.getBenefitUnit().getWealthTotValue(false) / es; popula[ii] += 1.0; } } diff --git a/src/main/java/simpaths/experiment/SimPathsCollector.java b/src/main/java/simpaths/experiment/SimPathsCollector.java index e26299224..001204fe7 100644 --- a/src/main/java/simpaths/experiment/SimPathsCollector.java +++ b/src/main/java/simpaths/experiment/SimPathsCollector.java @@ -381,20 +381,20 @@ public void update() { percentileFunctionGrossLabourIncomes = new PercentileArrayFunction(personsGrossLabourIncomesCS); percentileFunctionGrossLabourIncomes.updateSource(); - stats.setGrossLabourIncome_p20(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P20)); - stats.setGrossLabourIncome_p40(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P40)); - stats.setGrossLabourIncome_p60(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P60)); - stats.setGrossLabourIncome_p80(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P80)); + stats.setYLabP20(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P20)); + stats.setYLabP40(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P40)); + stats.setYLabP60(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P60)); + stats.setYLabP80(percentileFunctionGrossLabourIncomes.getDoubleValue(PercentileArrayFunction.Variables.P80)); for (Person person : model.getPersons()) { double covidModuleGrossLabourIncomeBaseline = person.getCovidModuleGrossLabourIncome_Baseline(); - if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p20()) { + if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP20()) { person.setCovidYLabGrossXt5(Quintiles.Q1); - } else if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p40()) { + } else if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP40()) { person.setCovidYLabGrossXt5(Quintiles.Q2); - } else if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p60()) { + } else if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP60()) { person.setCovidYLabGrossXt5(Quintiles.Q3); - } else if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p80()) { + } else if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP80()) { person.setCovidYLabGrossXt5(Quintiles.Q4); } else { person.setCovidYLabGrossXt5(Quintiles.Q5); @@ -430,7 +430,7 @@ private class Ydses_c5 implements IDoubleSource { public void update() { //Ydses_c5 - householdsGrossIncomesCS = new CrossSection.Double(model.getBenefitUnits(), BenefitUnit.class, "getTmpHHYpnbihs_dv_asinhNoNull", true); //Populate CS + householdsGrossIncomesCS = new CrossSection.Double(model.getBenefitUnits(), BenefitUnit.class, "getI_yNonBenHhGrossAsinhNoNull", true); //Populate CS percentileFunctionHouseholdsGrossIncomes = new PercentileArrayFunction(householdsGrossIncomesCS); //Get p50 percentileFunctionHouseholdsGrossIncomes.updateSource(); @@ -442,10 +442,10 @@ public void update() { // System.out.println("P50 value from the percentile function: " + p50HouseholdsGrossIncome + " P20: " + p20HouseholdsGrossIncome + " P40: " + p40HouseholdsGrossIncome + // " P60: " + p60HouseholdsGrossIncome + " P80: " + p80HouseholdsGrossIncome); - stats.setYdses_p20(p20HouseholdsGrossIncome); - stats.setYdses_p40(p40HouseholdsGrossIncome); - stats.setYdses_p60(p60HouseholdsGrossIncome); - stats.setYdses_p80(p80HouseholdsGrossIncome); + stats.setYHhQuintilesC5P20(p20HouseholdsGrossIncome); + stats.setYHhQuintilesC5P40(p40HouseholdsGrossIncome); + stats.setYHhQuintilesC5P60(p60HouseholdsGrossIncome); + stats.setYHhQuintilesC5P80(p80HouseholdsGrossIncome); } @@ -702,7 +702,7 @@ private void calculateEquivalisedHouseholdDisposableIncome() { totalWeight += house.getWeight(); } else { //Cannot include house in statistics as unable to calculate eq disp income - house.setAtRiskOfPoverty(1); //If benefit unit has equivalised disposable income < 0, it should be classified as at risk of poverty + house.setYPvrtyFlag(1); //If benefit unit has equivalised disposable income < 0, it should be classified as at risk of poverty } } @@ -745,10 +745,10 @@ public int compare(Pair pair1, Pair pa for(Pair pairHouse_Income: arrHouse_eqHouseholdDispIncome) { BenefitUnit house = pairHouse_Income.getFirst(); if(house.getEquivalisedDisposableIncomeYearly() < atRiskOfPovertyThreshold) { - house.setAtRiskOfPoverty(1); + house.setYPvrtyFlag(1); } else { - house.setAtRiskOfPoverty(0); + house.setYPvrtyFlag(0); } } diff --git a/src/main/java/simpaths/experiment/SimPathsObserver.java b/src/main/java/simpaths/experiment/SimPathsObserver.java index 276ab8dbe..6db95b9c5 100644 --- a/src/main/java/simpaths/experiment/SimPathsObserver.java +++ b/src/main/java/simpaths/experiment/SimPathsObserver.java @@ -868,9 +868,9 @@ else if(edu.equals(Education.High)) { MaleAgeGroupCSfilter maleAgeFilter = new MaleAgeGroupCSfilter(ageFrom, ageTo); FemaleAgeGroupCSfilter femaleAgeFilter = new FemaleAgeGroupCSfilter(ageFrom, ageTo); - Weighted_CrossSection.Double maleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDheValue", true); + Weighted_CrossSection.Double maleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getHealthSelfRatedValue", true); maleCS.setFilter(maleAgeFilter); - Weighted_CrossSection.Double femaleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDheValue", true); + Weighted_CrossSection.Double femaleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getHealthSelfRatedValue", true); femaleCS.setFilter(femaleAgeFilter); TimeSeriesSimulationPlotter healthAgePlotter = new TimeSeriesSimulationPlotter("Health score by age: " + ageFilter.getAgeFrom() + " - " + ageFilter.getAgeTo(), ""); @@ -1091,9 +1091,9 @@ else if(edu.equals(Education.High)) { MaleAgeGroupCSfilter maleAgeFilter = new MaleAgeGroupCSfilter(ageFrom, ageTo); FemaleAgeGroupCSfilter femaleAgeFilter = new FemaleAgeGroupCSfilter(ageFrom, ageTo); - Weighted_CrossSection.Double maleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDhe", true); + Weighted_CrossSection.Double maleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getHealthSelfRated", true); maleCS.setFilter(maleAgeFilter); - Weighted_CrossSection.Double femaleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getDhe", true); + Weighted_CrossSection.Double femaleCS = new Weighted_CrossSection.Double(model.getPersons(), Person.class, "getHealthSelfRated", true); femaleCS.setFilter(femaleAgeFilter); healthAgePlotter.addSeries("males (" + ageFrom + " - " + ageTo + ")", new Weighted_MeanArrayFunction(maleCS)); @@ -1424,7 +1424,7 @@ else if(edu.equals(Education.High)) { for(Region region: Parameters.getCountryRegions()) { //Households ValidHouseholdIncomeRegionalCSfilter validHouseholdIncomeRegionalFilter = new ValidHouseholdIncomeRegionalCSfilter(region); - Weighted_CrossSection.Integer validHousesAtRiskOfPovertyRegionCS = new Weighted_CrossSection.Integer(model.getBenefitUnits(), BenefitUnit.class, "getAtRiskOfPoverty", true); + Weighted_CrossSection.Integer validHousesAtRiskOfPovertyRegionCS = new Weighted_CrossSection.Integer(model.getBenefitUnits(), BenefitUnit.class, "getYPvrtyFlag", true); validHousesAtRiskOfPovertyRegionCS.setFilter(validHouseholdIncomeRegionalFilter); housePovertyPlotter.addSeries(region.getName(), new Weighted_MeanArrayFunction(validHousesAtRiskOfPovertyRegionCS)); @@ -1436,7 +1436,7 @@ else if(edu.equals(Education.High)) { } //Households ValidHouseholdIncomeCSfilter validHouseholdIncomeFilter = new ValidHouseholdIncomeCSfilter(); - Weighted_CrossSection.Integer validHousesAtRiskOfPovertyCS = new Weighted_CrossSection.Integer(model.getBenefitUnits(), BenefitUnit.class, "getAtRiskOfPoverty", true); + Weighted_CrossSection.Integer validHousesAtRiskOfPovertyCS = new Weighted_CrossSection.Integer(model.getBenefitUnits(), BenefitUnit.class, "getYPvrtyFlag", true); validHousesAtRiskOfPovertyCS.setFilter(validHouseholdIncomeFilter); housePovertyPlotter.addSeries("national", new Weighted_MeanArrayFunction(validHousesAtRiskOfPovertyCS)); updateChartSet.add(housePovertyPlotter); //Add to set to be updated in buildSchedule method diff --git a/src/main/java/simpaths/model/BenefitUnit.java b/src/main/java/simpaths/model/BenefitUnit.java index 057e82ec5..153a3873e 100644 --- a/src/main/java/simpaths/model/BenefitUnit.java +++ b/src/main/java/simpaths/model/BenefitUnit.java @@ -79,7 +79,7 @@ public class BenefitUnit implements EventListener, IDoubleSource, Weight, Compar @Lag(getter = "getEquivalisedDisposableIncomeYearly") @Transient private Double yDispEquivYearL1; @NullInitialised @Transient private Double yDiffDispEquivPrevYear; private Integer yPvrtyFlag; //1 if at risk of poverty, defined by an equivalisedDisposableIncomeYearly < 60% of median household's - @Lag(getter = "getAtRiskOfPoverty") @Transient private Integer yPvrtyFlagL1; + @Lag(getter = "getYPvrtyFlag") @Transient private Integer yPvrtyFlagL1; @Lag(getter = "getIndicatorChildren0to3") @Transient private Indicator dem0to3L1; @Lag(getter = "getIndicatorChildren4to12") @Transient private Indicator dem4to12L1; //Lag(1) of d_children_4_12; @Lag(getter = "getNumberChildren0to2") @Transient private Integer numberChildren02_lag1; //Lag(1) of the number of children aged 0-2 in the household @@ -91,7 +91,7 @@ public class BenefitUnit implements EventListener, IDoubleSource, Weight, Compar @NullInitialised @Transient private Match demDbMatchTax; @Enumerated(EnumType.STRING) private Region region; //Region of household. Also used in findDonorHouseholdsByLabour method @Enumerated(EnumType.STRING) private Ydses_c5 yHhQuintilesMonthC5; - @Lag(getter = "getYdses_c5") @Transient private Ydses_c5 yHhQuintilesMonthC5L1; + @Lag(getter = "getYHhQuintilesMonthC5") @Transient private Ydses_c5 yHhQuintilesMonthC5L1; @NullInitialised @Transient private Double i_yNonBenHhGrossAsinh; @NullInitialised private Dhhtp_c4 demCompHhC4; @Lag(getter = "getDemCompHhC4") @Transient private Dhhtp_c4 demCompHhC4L1; @@ -268,8 +268,8 @@ public BenefitUnit(BenefitUnit originalBenefitUnit, long benefitUnitInnov, Sampl switch (sampleEntry) { case ProcessedInputData -> { key.setId(originalBenefitUnit.getId()); - idBuOriginal = originalBenefitUnit.getIdOriginalBU(); - idHhOriginal = originalBenefitUnit.getIdOriginalHH(); + idBuOriginal = originalBenefitUnit.getIdBuOriginal(); + idHhOriginal = originalBenefitUnit.getIdHhOriginal(); } default -> { idBuOriginal = originalBenefitUnit.getId(); @@ -292,8 +292,8 @@ public BenefitUnit(BenefitUnit originalBenefitUnit, long benefitUnitInnov, Sampl initialiseLiquidWealth( originalBenefitUnit.getRefPersonForDecisions().getDemAge(), originalBenefitUnit.getWealthTotValue(), - originalBenefitUnit.getPensionWealth(false), - originalBenefitUnit.getHousingWealth(false) + originalBenefitUnit.getWealthPensValue(false), + originalBenefitUnit.getWealthPrptyValue(false) ); this.numberChildrenAll_lag1 = originalBenefitUnit.numberChildrenAll_lag1; this.numberChildren02_lag1 = originalBenefitUnit.numberChildren02_lag1; @@ -303,7 +303,7 @@ public BenefitUnit(BenefitUnit originalBenefitUnit, long benefitUnitInnov, Sampl this.xCareWeek = originalBenefitUnit.xCareWeek; this.careProvidedFlag = originalBenefitUnit.careProvidedFlag; this.region = originalBenefitUnit.region; - this.yHhQuintilesMonthC5 = originalBenefitUnit.getYdses_c5(); + this.yHhQuintilesMonthC5 = originalBenefitUnit.getYHhQuintilesMonthC5(); this.yHhQuintilesMonthC5L1 = originalBenefitUnit.yHhQuintilesMonthC5L1; this.demCompHhC4L1 = originalBenefitUnit.demCompHhC4L1; this.wealthPrptyFlag = originalBenefitUnit.wealthPrptyFlag; @@ -377,7 +377,7 @@ protected void initializeFields() { demCompHhC4L1 = getDemCompHhC4(); // clean-up odd ends - if (getYdses_c5() == null) { + if (getYHhQuintilesMonthC5() == null) { yHhQuintilesMonthC5 = Ydses_c5.Q3; } if (region == null) @@ -543,8 +543,8 @@ protected void updateDisposableIncomeIfNotAtRiskOfWork() { male.setLabourSupplyWeekly(Labour.convertHoursToLabour(hoursWorkedPerWeekM)); getFemale().setLabourSupplyWeekly(Labour.convertHoursToLabour(hoursWorkedPerWeekF)); - double maleIncome = Math.sinh(male.getyMiscPersGrossMonth()); - double femaleIncome = Math.sinh(getFemale().getyMiscPersGrossMonth()); + double maleIncome = Math.sinh(male.getYMiscPersGrossMonth()); + double femaleIncome = Math.sinh(getFemale().getYMiscPersGrossMonth()); if (maleIncome>0.01 && femaleIncome>0.01) secondIncomePerMonth = Math.min(maleIncome, femaleIncome); originalIncomePerMonth = maleIncome + femaleIncome; @@ -553,12 +553,12 @@ protected void updateDisposableIncomeIfNotAtRiskOfWork() { } else if (male!=null) { male.setLabourSupplyWeekly(Labour.convertHoursToLabour(hoursWorkedPerWeekM)); - originalIncomePerMonth = Math.sinh(male.getyMiscPersGrossMonth()); + originalIncomePerMonth = Math.sinh(male.getYMiscPersGrossMonth()); dlltsdM = male.getDisability(); } else if (female!=null){ getFemale().setLabourSupplyWeekly(Labour.convertHoursToLabour(hoursWorkedPerWeekF)); - originalIncomePerMonth = Math.sinh(getFemale().getyMiscPersGrossMonth()); + originalIncomePerMonth = Math.sinh(getFemale().getYMiscPersGrossMonth()); dlltsdF = getFemale().getDisability(); } else throw new RuntimeException("Benefit Unit with the following ID has no recognised occupancy: " + getKey().getId()); @@ -606,7 +606,7 @@ private TaxEvaluation taxWrapper(double hoursWorkedPerWeekM, double hoursWorkedP evaluatedTransfers = new TaxEvaluation(model.getYear(), getRefPersonForDecisions().getDemAge(), getIntValue(Regressors.NumberMembersOver17), getIntValue(Regressors.NumberChildren04), getIntValue(Regressors.NumberChildren59), getIntValue(Regressors.NumberChildren1017), hoursWorkedPerWeekM, hoursWorkedPerWeekF, dlltsdM, dlltsdF, careProvidedFlag, originalIncomePerMonth, secondIncomePerMonth, - childcareCostPerMonth, socialCareCostPerMonth, getLiquidWealth(Parameters.enableIntertemporalOptimisations), taxInnov); + childcareCostPerMonth, socialCareCostPerMonth, getWealthTotValue(Parameters.enableIntertemporalOptimisations), taxInnov); return evaluatedTransfers; } @@ -659,10 +659,10 @@ protected void chooseRandomMonthlyOutcomeCovid19() { Triple selectedValueMale = covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleMale.get(randomIndex); Triple selectedValueFemale = covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleFemale.get(randomIndex); - male.setLes_c7_covid(selectedValueMale.getLeft()); // Set labour force status for male - male.setLes_c4(Les_c4.convertLes_c7_To_Les_c4(selectedValueMale.getLeft())); - female.setLes_c7_covid(selectedValueFemale.getLeft()); // Set labour force status for female - female.setLes_c4(Les_c4.convertLes_c7_To_Les_c4(selectedValueFemale.getLeft())); + male.setLabC7Covid(selectedValueMale.getLeft()); // Set labour force status for male + male.setLabC4(Les_c4.convertLes_c7_To_Les_c4(selectedValueMale.getLeft())); + female.setLabC7Covid(selectedValueFemale.getLeft()); // Set labour force status for female + female.setLabC4(Les_c4.convertLes_c7_To_Les_c4(selectedValueFemale.getLeft())); // Predicted hours need to be converted back into labour so a donor benefit unit can be found. Then, gross income can be converted to disposable. male.setLabourSupplyWeekly(Labour.convertHoursToLabour(selectedValueMale.getRight())); // Convert predicted work hours to labour enum and update male's value @@ -688,8 +688,8 @@ protected void chooseRandomMonthlyOutcomeCovid19() { int randomIndex = intFromUniform(0, covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleMale.size(), labourInnov); Triple selectedValueMale = covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleMale.get(randomIndex); - male.setLes_c7_covid(selectedValueMale.getLeft()); // Set labour force status for male - male.setLes_c4(Les_c4.convertLes_c7_To_Les_c4(selectedValueMale.getLeft())); + male.setLabC7Covid(selectedValueMale.getLeft()); // Set labour force status for male + male.setLabC4(Les_c4.convertLes_c7_To_Les_c4(selectedValueMale.getLeft())); // Predicted hours need to be converted back into labour so a donor benefit unit can be found. Then, gross income can be converted to disposable. male.setLabourSupplyWeekly(Labour.convertHoursToLabour(selectedValueMale.getRight())); // Convert predicted work hours to labour enum and update male's value @@ -713,8 +713,8 @@ protected void chooseRandomMonthlyOutcomeCovid19() { int randomIndex = intFromUniform(0, covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleFemale.size(), labourInnov); Triple selectedValueFemale = covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleFemale.get(randomIndex); - female.setLes_c7_covid(selectedValueFemale.getLeft()); // Set labour force status for female - female.setLes_c4(Les_c4.convertLes_c7_To_Les_c4(selectedValueFemale.getLeft())); + female.setLabC7Covid(selectedValueFemale.getLeft()); // Set labour force status for female + female.setLabC4(Les_c4.convertLes_c7_To_Les_c4(selectedValueFemale.getLeft())); // Predicted hours need to be converted back into labour so a donor benefit unit can be found. Then, gross income can be converted to disposable. female.setLabourSupplyWeekly(Labour.convertHoursToLabour(selectedValueFemale.getRight())); // Convert predicted work hours to labour enum and update female's value @@ -739,7 +739,7 @@ protected void chooseRandomMonthlyOutcomeCovid19() { if (covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleMale.size() > 0) { int randomIndex = intFromUniform(0, covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleMale.size(), labourInnov); Triple selectedValueMale = covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleMale.get(randomIndex); - male.setLes_c7_covid(selectedValueMale.getLeft()); // Set labour force status for male + male.setLabC7Covid(selectedValueMale.getLeft()); // Set labour force status for male male.setLabourSupplyWeekly(Labour.convertHoursToLabour(selectedValueMale.getRight())); double simulatedIncomeToConvertPerMonth = selectedValueMale.getMiddle(); @@ -759,7 +759,7 @@ protected void chooseRandomMonthlyOutcomeCovid19() { if (covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleFemale.size() > 0) { int randomIndex = intFromUniform(0, covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleFemale.size(), labourInnov); Triple selectedValueFemale = covid19MonthlyStateAndGrossIncomeAndWorkHoursTripleFemale.get(randomIndex); - female.setLes_c7_covid(selectedValueFemale.getLeft()); // Set labour force status for female + female.setLabC7Covid(selectedValueFemale.getLeft()); // Set labour force status for female female.setLabourSupplyWeekly(Labour.convertHoursToLabour(selectedValueFemale.getRight())); double simulatedIncomeToConvertPerMonth = selectedValueFemale.getMiddle(); @@ -787,21 +787,21 @@ It returns gross income at individual level, which is then totaled in the update private Triple predictCovidTransition(Person person) { - if (person.getLes_c7_covid_lag1() == null) { + if (person.getLabC7CovidL1() == null) { person.initialise_les_c6_from_c4(); person.setCovidYLabGrossL1(person.getCovidModuleGrossLabourIncome_Baseline()); } // Define variables: - Les_c7_covid stateFrom = person.getLes_c7_covid_lag1(); + Les_c7_covid stateFrom = person.getLabC7CovidL1(); Les_c7_covid stateTo = stateFrom; // Labour market state to which individual transitions. Initialise to stateFrom value if the outcome is "no changes" int newWorkHours; // Predicted work hours. Initialise to previous value if available, or hours from labour enum. if (person.getLabHrsWorkNewL1() != null) { newWorkHours = person.getLabHrsWorkNewL1(); } else { newWorkHours = person.getLabourSupplyHoursWeekly(); // Note: prediction for hours is in logs, needs to be transformed to levels - person.setNewWorkHours_lag1(newWorkHours); + person.setLabHrsWorkNewL1(newWorkHours); } double grossMonthlyIncomeToReturn = 0; // Gross income to return to updateLabourSupplyCovid19() method @@ -812,23 +812,23 @@ private Triple predictCovidTransition(Person pers MultiValEvent event = new MultiValEvent(probs, labourInnov2); Les_transitions_E1 transitionTo = (Les_transitions_E1) event.eval(); stateTo = transitionTo.convertToLes_c7_covid(); - person.setLes_c7_covid(stateTo); // Use convert to les c6 covid method from the enum to convert the outcome to the les c6 scale and update the variable + person.setLabC7Covid(stateTo); // Use convert to les c6 covid method from the enum to convert the outcome to the les c6 scale and update the variable if (Les_transitions_E1.SelfEmployed.equals(transitionTo) || Les_transitions_E1.SomeChanges.equals(transitionTo)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_E2a().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_E1.NotEmployed)) { newWorkHours = 0; grossMonthlyIncomeToReturn = 0; } else if (transitionTo.equals(Les_transitions_E1.FurloughedFull)) { // If furloughed, don't change hours of work initialised at the beginning - grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_E1.FurloughedFlex)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_E2b().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else { // Else "no changes" = employee. Use initialisation value for stateTo and newWorkHours and fill gross monthly income - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } // Transitions from furlough full @@ -838,22 +838,22 @@ private Triple predictCovidTransition(Person pers Les_transitions_FF1 transitionTo = (Les_transitions_FF1) event.eval(); stateTo = transitionTo.convertToLes_c7_covid(); - person.setLes_c7_covid(stateTo); // Use convert to les c7 covid method from the enum to convert the outcome to the les c7 scale and update the variable + person.setLabC7Covid(stateTo); // Use convert to les c7 covid method from the enum to convert the outcome to the les c7 scale and update the variable if (transitionTo.equals(Les_transitions_FF1.Employee)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_F2b().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_FF1.SelfEmployed)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_F2a().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_FF1.FurloughedFlex)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_F2c().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_FF1.NotEmployed)) { newWorkHours = 0; grossMonthlyIncomeToReturn = 0; } else { // Else remains furloughed. Use 80% of initialisation value for stateTo and newWorkHours and fill gross monthly income - grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } // Transitions from furlough flex @@ -862,22 +862,22 @@ private Triple predictCovidTransition(Person pers MultiValEvent event = new MultiValEvent(probs, labourInnov2); Les_transitions_FX1 transitionTo = (Les_transitions_FX1) event.eval(); stateTo = transitionTo.convertToLes_c7_covid(); - person.setLes_c7_covid(stateTo); // Use convert to les c7 covid method from the enum to convert the outcome to the les c7 scale and update the variable + person.setLabC7Covid(stateTo); // Use convert to les c7 covid method from the enum to convert the outcome to the les c7 scale and update the variable if (transitionTo.equals(Les_transitions_FX1.Employee)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_F2b().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_FX1.SelfEmployed)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_F2a().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_FX1.FurloughedFull)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_F2a().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); // 80% of earnings they would have had working normal hours, hence hours predicted as for employed in the line above + grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); // 80% of earnings they would have had working normal hours, hence hours predicted as for employed in the line above } else if (transitionTo.equals(Les_transitions_FX1.NotEmployed)) { newWorkHours = 0; grossMonthlyIncomeToReturn = 0; } else { // Else remains furloughed. Use 80% of initialisation value for stateTo and newWorkHours and fill gross monthly income - grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = 0.8 * Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } // Transitions from self-employment @@ -886,11 +886,11 @@ private Triple predictCovidTransition(Person pers MultiValEvent event = new MultiValEvent(probs, labourInnov2); Les_transitions_S1 transitionTo = (Les_transitions_S1) event.eval(); stateTo = transitionTo.convertToLes_c7_covid(); - person.setLes_c7_covid(stateTo); // Use convert to les c6 covid method from the enum to convert the outcome to the les c6 scale and update the variable + person.setLabC7Covid(stateTo); // Use convert to les c6 covid method from the enum to convert the outcome to the les c6 scale and update the variable if (transitionTo.equals(Les_transitions_S1.Employee) || transitionTo.equals(Les_transitions_S1.SelfEmployed)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_S2a().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); // If transition to is self-employed (i.e. continues in self-employment), and earnings have decreased (gross monthly income lower than lag1 of gross monthly income, obtained from person.getCovidModuleGrossLabourIncome_lag1), predict probabiltiy of SEISS if (transitionTo.equals(Les_transitions_S1.SelfEmployed) && grossMonthlyIncomeToReturn < person.getCovidYLabGrossL1()) { @@ -914,11 +914,11 @@ private Triple predictCovidTransition(Person pers MultiValEvent event = new MultiValEvent(probs, labourInnov2); Les_transitions_U1 transitionTo = (Les_transitions_U1) event.eval(); stateTo = transitionTo.convertToLes_c7_covid(); - person.setLes_c7_covid(stateTo); // Use convert to les c6 covid method from the enum to convert the outcome to the les c6 scale and update the variable + person.setLabC7Covid(stateTo); // Use convert to les c6 covid method from the enum to convert the outcome to the les c6 scale and update the variable if (transitionTo.equals(Les_transitions_U1.Employee) || transitionTo.equals(Les_transitions_U1.SelfEmployed)) { newWorkHours = (Labour.convertHoursToLabour(exponentiateAndConstrainWorkHoursPrediction(Parameters.getRegC19LS_U2a().getScore(person, Person.DoublesVariables.class)))).getHours(person); - grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getyMiscPersGrossMonth()); + grossMonthlyIncomeToReturn = Parameters.WEEKS_PER_MONTH * person.getEarningsWeekly(newWorkHours) + Math.sinh(person.getYMiscPersGrossMonth()); } else if (transitionTo.equals(Les_transitions_U1.NotEmployed)) { newWorkHours = 0; grossMonthlyIncomeToReturn = 0; @@ -930,8 +930,8 @@ private Triple predictCovidTransition(Person pers Triple stateGrossIncomeWorkHoursTriple = Triple.of(stateTo, grossMonthlyIncomeToReturn, newWorkHours); // Triple contains outcome labour market state after transition, gross income, and work hours person.setCovidYLabGrossL1(grossMonthlyIncomeToReturn); // used as a regressor in the Covid-19 regressions - person.setNewWorkHours_lag1(newWorkHours); // newWorkHours is not a state variable of a person and is only used from month to month in the covid module, so set lag here - person.setLes_c7_covid_lag1(stateTo); // Update lagged value of monthly labour market state + person.setLabHrsWorkNewL1(newWorkHours); // newWorkHours is not a state variable of a person and is only used from month to month in the covid module, so set lag here + person.setLabC7CovidL1(stateTo); // Update lagged value of monthly labour market state return stateGrossIncomeWorkHoursTriple; } @@ -1026,8 +1026,8 @@ public void updateLabourChoices() { male.setLabourSupplyWeekly(labourKey.getKey(0)); female.setLabourSupplyWeekly(labourKey.getKey(1)); - double maleIncome = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getyMiscPersGrossMonth()); - double femaleIncome = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getyMiscPersGrossMonth()); + double maleIncome = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getYMiscPersGrossMonth()); + double femaleIncome = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getYMiscPersGrossMonth()); double originalIncomePerMonth = maleIncome + femaleIncome; double secondIncomePerMonth = Math.min(maleIncome, femaleIncome); @@ -1041,7 +1041,7 @@ public void updateLabourChoices() { for (MultiKey labourKey : cachedPossibleLabourCombinations) { male.setLabourSupplyWeekly(labourKey.getKey(0)); - double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getyMiscPersGrossMonth()); + double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getYMiscPersGrossMonth()); TaxEvaluation ev = taxWrapper(labourKey.getKey(0).getHours(male), 0.0, male.getDisability(), -1, originalIncomePerMonth, 0.0); cachedEvalByLabourPairs.put(labourKey, new LabourEval(ev)); @@ -1052,7 +1052,7 @@ public void updateLabourChoices() { for (MultiKey labourKey : cachedPossibleLabourCombinations) { female.setLabourSupplyWeekly(labourKey.getKey(1)); - double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getyMiscPersGrossMonth()); + double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getYMiscPersGrossMonth()); TaxEvaluation ev = taxWrapper(0.0, labourKey.getKey(1).getHours(female), -1, female.getDisability(), originalIncomePerMonth, 0.0); cachedEvalByLabourPairs.put(labourKey, new LabourEval(ev)); @@ -1607,8 +1607,8 @@ protected void updateLabourSupplyAndIncome() { female.setLabourSupplyWeekly(labourKey.getKey(1)); // Earnings are composed of the labour income and non-benefit non-employment income Yptciihs_dv() (this is monthly, so no need to multiply by WEEKS_PER_MONTH_RATIO) - double maleIncome = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getyMiscPersGrossMonth()); - double femaleIncome = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getyMiscPersGrossMonth()); + double maleIncome = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getYMiscPersGrossMonth()); + double femaleIncome = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getYMiscPersGrossMonth()); double originalIncomePerMonth = maleIncome + femaleIncome; double secondIncomePerMonth = Math.min(maleIncome, femaleIncome); @@ -1665,7 +1665,7 @@ protected void updateLabourSupplyAndIncome() { for (MultiKey labourKey : possibleLabourCombinations) { male.setLabourSupplyWeekly(labourKey.getKey(0)); - double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getyMiscPersGrossMonth()); + double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * male.getEarningsWeekly() + Math.sinh(male.getYMiscPersGrossMonth()); TaxEvaluation evaluatedTransfers = taxWrapper(labourKey.getKey(0).getHours(male), 0.0, male.getDisability(), -1, originalIncomePerMonth, 0.0); yDispMonth = evaluatedTransfers.getDisposableIncomePerMonth(); @@ -1695,7 +1695,7 @@ protected void updateLabourSupplyAndIncome() { for (MultiKey labourKey : possibleLabourCombinations) { female.setLabourSupplyWeekly(labourKey.getKey(1)); - double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getyMiscPersGrossMonth()); + double originalIncomePerMonth = Parameters.WEEKS_PER_MONTH * female.getEarningsWeekly() + Math.sinh(female.getYMiscPersGrossMonth()); TaxEvaluation evaluatedTransfers = taxWrapper(0.0, labourKey.getKey(1).getHours(female), -1, female.getDisability(), originalIncomePerMonth, 0.0); yDispMonth = evaluatedTransfers.getDisposableIncomePerMonth(); @@ -1744,13 +1744,13 @@ protected void updateLabourSupplyAndIncome() { // -> then persist employment innovation with probability Parameters.labour_innovation_employment_persistence_probability // Otherwise // -> persist employment innovation with probability Parameters.labour_innovation_notinemployment_persistence_probability - if (occupancy.Single_Male.equals(occupancy) && male.atRiskOfWork() && male.getEmployed_Lag1() == 1) { + if (occupancy.Single_Male.equals(occupancy) && male.atRiskOfWork() && male.getEmployedFlagL1() == 1) { labourInnov = getLabourInnovation(Parameters.labour_innovation_employment_persistence_probability); - } else if (occupancy.Single_Female.equals(occupancy) && female.atRiskOfWork() && female.getEmployed_Lag1() == 1) { + } else if (occupancy.Single_Female.equals(occupancy) && female.atRiskOfWork() && female.getEmployedFlagL1() == 1) { labourInnov = getLabourInnovation(Parameters.labour_innovation_employment_persistence_probability); } else if (occupancy.equals(Occupancy.Couple) && - ((male.atRiskOfWork() && male.getEmployed_Lag1() == 1) || - (!male.atRiskOfWork() && female.atRiskOfWork() && female.getEmployed_Lag1() == 1))) { + ((male.atRiskOfWork() && male.getEmployedFlagL1() == 1) || + (!male.atRiskOfWork() && female.atRiskOfWork() && female.getEmployedFlagL1() == 1))) { labourInnov = getLabourInnovation(Parameters.labour_innovation_employment_persistence_probability); } else { labourInnov = getLabourInnovation(Parameters.labour_innovation_notinemployment_persistence_probability); @@ -1872,31 +1872,31 @@ protected void calculateBUIncome() { // male double labourEarningsMaleMonthly = male.getEarningsWeekly(male.getLabourSupplyHoursWeekly()) * Parameters.WEEKS_PER_MONTH; //Level of monthly labour earnings - male.setyEmpPersGrossMonth(asinh(labourEarningsMaleMonthly)); - double ypnbihsMaleMonthly = labourEarningsMaleMonthly + Math.sinh(male.getyMiscPersGrossMonth()); //personal non-benefit income per month - male.setyNonBenPersGrossMonth(asinh(ypnbihsMaleMonthly)); + male.setYEmpPersGrossMonth(asinh(labourEarningsMaleMonthly)); + double ypnbihsMaleMonthly = labourEarningsMaleMonthly + Math.sinh(male.getYMiscPersGrossMonth()); //personal non-benefit income per month + male.setYNonBenPersGrossMonth(asinh(ypnbihsMaleMonthly)); male.setCovidModuleGrossLabourIncome_Baseline(ypnbihsMaleMonthly); // Used in the Covid-19 labour supply module // female double labourEarningsFemaleMonthly = female.getEarningsWeekly(female.getLabourSupplyHoursWeekly()) * Parameters.WEEKS_PER_MONTH; //Level of monthly labour earnings - female.setyEmpPersGrossMonth(asinh(labourEarningsFemaleMonthly)); //This follows asinh transform of labourEarnings - double ypnbihsFemaleMonthly = labourEarningsFemaleMonthly + Math.sinh(female.getyMiscPersGrossMonth()); //In levels - female.setyNonBenPersGrossMonth(asinh(ypnbihsFemaleMonthly)); //Set asinh transformed + female.setYEmpPersGrossMonth(asinh(labourEarningsFemaleMonthly)); //This follows asinh transform of labourEarnings + double ypnbihsFemaleMonthly = labourEarningsFemaleMonthly + Math.sinh(female.getYMiscPersGrossMonth()); //In levels + female.setYNonBenPersGrossMonth(asinh(ypnbihsFemaleMonthly)); //Set asinh transformed female.setCovidModuleGrossLabourIncome_Baseline(ypnbihsFemaleMonthly); // Used in the Covid-19 labour supply module // benefit unit income is the sum of male and female non-benefit income double tmpHHYpnbihs_dv = (ypnbihsMaleMonthly + ypnbihsFemaleMonthly) / equivalisedWeight; //Equivalised - setTmpHHYpnbihs_dv_asinh(asinh(tmpHHYpnbihs_dv)); //Asinh transformation of HH non-benefit income + setI_yNonBenHhGrossAsinh(asinh(tmpHHYpnbihs_dv)); //Asinh transformation of HH non-benefit income //Based on the percentiles calculated by the collector, assign household to one of the quintiles of (equivalised) income distribution if(collector.getStats() != null) { //Collector only gets initialised when simulation starts running - if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p20()) { + if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P20()) { yHhQuintilesMonthC5 = Ydses_c5.Q1; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p40()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P40()) { yHhQuintilesMonthC5 = Ydses_c5.Q2; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p60()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P60()) { yHhQuintilesMonthC5 = Ydses_c5.Q3; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p80()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P80()) { yHhQuintilesMonthC5 = Ydses_c5.Q4; } else { yHhQuintilesMonthC5 = Ydses_c5.Q5; @@ -1907,23 +1907,23 @@ protected void calculateBUIncome() { if (male != null) { double labourEarningsMaleMonthly = male.getEarningsWeekly(male.getLabourSupplyHoursWeekly()) * Parameters.WEEKS_PER_MONTH; //Level of monthly labour earnings - male.setyEmpPersGrossMonth(asinh(labourEarningsMaleMonthly)); //This follows asinh transform of labourEarnings - double ypnbihsMaleMonthly = labourEarningsMaleMonthly + Math.sinh(male.getyMiscPersGrossMonth()); //In levels - male.setyNonBenPersGrossMonth(asinh(ypnbihsMaleMonthly)); //Set asinh transformed + male.setYEmpPersGrossMonth(asinh(labourEarningsMaleMonthly)); //This follows asinh transform of labourEarnings + double ypnbihsMaleMonthly = labourEarningsMaleMonthly + Math.sinh(male.getYMiscPersGrossMonth()); //In levels + male.setYNonBenPersGrossMonth(asinh(ypnbihsMaleMonthly)); //Set asinh transformed male.setCovidModuleGrossLabourIncome_Baseline(ypnbihsMaleMonthly); // Used in the Covid-19 labour supply module //BenefitUnit income is the male non-benefit income double tmpHHYpnbihs_dv = ypnbihsMaleMonthly / equivalisedWeight; //Equivalised - setTmpHHYpnbihs_dv_asinh(asinh(tmpHHYpnbihs_dv)); //Asinh transformation of HH non-benefit income + setI_yNonBenHhGrossAsinh(asinh(tmpHHYpnbihs_dv)); //Asinh transformation of HH non-benefit income if(collector.getStats() != null) { //Collector only gets initialised when simulation starts running - if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p20()) { + if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P20()) { yHhQuintilesMonthC5 = Ydses_c5.Q1; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p40()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P40()) { yHhQuintilesMonthC5 = Ydses_c5.Q2; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p60()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P60()) { yHhQuintilesMonthC5 = Ydses_c5.Q3; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p80()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P80()) { yHhQuintilesMonthC5 = Ydses_c5.Q4; } else { yHhQuintilesMonthC5 = Ydses_c5.Q5; @@ -1937,24 +1937,24 @@ protected void calculateBUIncome() { //If not a couple nor a single male, occupancy must be single female double labourEarningsFemaleMonthly = female.getEarningsWeekly(female.getLabourSupplyHoursWeekly()) * Parameters.WEEKS_PER_MONTH; //Level of monthly labour earnings - female.setyEmpPersGrossMonth(asinh(labourEarningsFemaleMonthly)); //This follows asinh transform of labourEarnings - double ypnbihsFemaleMonthly = labourEarningsFemaleMonthly + Math.sinh(female.getyMiscPersGrossMonth()); //In levels - female.setyNonBenPersGrossMonth(asinh(ypnbihsFemaleMonthly)); //Set asinh transformed + female.setYEmpPersGrossMonth(asinh(labourEarningsFemaleMonthly)); //This follows asinh transform of labourEarnings + double ypnbihsFemaleMonthly = labourEarningsFemaleMonthly + Math.sinh(female.getYMiscPersGrossMonth()); //In levels + female.setYNonBenPersGrossMonth(asinh(ypnbihsFemaleMonthly)); //Set asinh transformed female.setCovidModuleGrossLabourIncome_Baseline(ypnbihsFemaleMonthly); // Used in the Covid-19 labour supply module //BenefitUnit income is the female non-benefit income double tmpHHYpnbihs_dv = ypnbihsFemaleMonthly / equivalisedWeight; //Equivalised - setTmpHHYpnbihs_dv_asinh(asinh(tmpHHYpnbihs_dv)); //Asinh transformation of HH non-benefit income + setI_yNonBenHhGrossAsinh(asinh(tmpHHYpnbihs_dv)); //Asinh transformation of HH non-benefit income if(collector.getStats() != null) { //Collector only gets initialised when simulation starts running - if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p20()) { + if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P20()) { yHhQuintilesMonthC5 = Ydses_c5.Q1; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p40()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P40()) { yHhQuintilesMonthC5 = Ydses_c5.Q2; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p60()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P60()) { yHhQuintilesMonthC5 = Ydses_c5.Q3; - } else if(getTmpHHYpnbihs_dv_asinh() <= collector.getStats().getYdses_p80()) { + } else if(getI_yNonBenHhGrossAsinh() <= collector.getStats().getYHhQuintilesC5P80()) { yHhQuintilesMonthC5 = Ydses_c5.Q4; } else { yHhQuintilesMonthC5 = Ydses_c5.Q5; @@ -1976,11 +1976,11 @@ public void updateActivityOfPersonsWithinBenefitUnit() { private void updateActivity(Person person) { - if (person!=null && !Les_c4.Student.equals(person.getLes_c4()) && !Les_c4.Retired.equals(person.getLes_c4())) { + if (person!=null && !Les_c4.Student.equals(person.getLabC4()) && !Les_c4.Retired.equals(person.getLabC4())) { if (person.getLabourSupplyHoursWeekly() > 0) { - person.setLes_c4(Les_c4.EmployedOrSelfEmployed); + person.setLabC4(Les_c4.EmployedOrSelfEmployed); } else { - person.setLes_c4(Les_c4.NotEmployed); + person.setLabC4(Les_c4.NotEmployed); } } } @@ -2543,12 +2543,12 @@ public double getDoubleValue(Enum variableID) { return (getMaleLeisureHoursWeekly()) * getIndicatorChildren(0,2).ordinal(); } case MaleLeisure_MaleDeh_c3_Low -> { - if(getMale().getDeh_c4().equals(Education.Low)) { + if(getMale().getEduHighestC4().equals(Education.Low)) { return (getMaleLeisureHoursWeekly()); } else return 0.; } case MaleLeisure_MaleDeh_c3_Medium -> { - if(getMale().getDeh_c4().equals(Education.Medium)) { + if(getMale().getEduHighestC4().equals(Education.Medium)) { return (getMaleLeisureHoursWeekly()); } else return 0.; } @@ -2680,12 +2680,12 @@ public double getDoubleValue(Enum variableID) { return (getFemaleLeisureHoursWeekly()) * getIndicatorChildren(0,2).ordinal(); } case FemaleLeisure_FemaleDeh_c3_Low -> { - if(getFemale().getDeh_c4().equals(Education.Low)) { + if(getFemale().getEduHighestC4().equals(Education.Low)) { return (getFemaleLeisureHoursWeekly()); } else return 0.; } case FemaleLeisure_FemaleDeh_c3_Medium -> { - if(getFemale().getDeh_c4().equals(Education.Medium)) { + if(getFemale().getEduHighestC4().equals(Education.Medium)) { return (getFemaleLeisureHoursWeekly()); } else return 0.; } @@ -2784,9 +2784,9 @@ public double getDoubleValue(Enum variableID) { } case FixedCost_Disabled -> { if (getMale() != null && getFemale() == null) { - return (getMale().getLabourSupplyHoursWeekly() > 0) ? getMale().getDlltsd().ordinal() : 0.; + return (getMale().getLabourSupplyHoursWeekly() > 0) ? getMale().getHealthDsblLongtermFlag().ordinal() : 0.; } else if (getFemale() != null && getMale() == null) { - return (getFemale().getLabourSupplyHoursWeekly() > 0) ? getFemale().getDlltsd().ordinal() : 0.; + return (getFemale().getLabourSupplyHoursWeekly() > 0) ? getFemale().getHealthDsblLongtermFlag().ordinal() : 0.; } else return 0.; } case FixedCost_RetirementAge -> { @@ -2798,12 +2798,12 @@ public double getDoubleValue(Enum variableID) { } case FixedCost_Disabled_Male -> { if (getMale() != null && getMale().getLabourSupplyHoursWeekly() > 0) { - return getMale().getDlltsd().ordinal(); + return getMale().getHealthDsblLongtermFlag().ordinal(); } else return 0.; } case FixedCost_Disabled_Female -> { if (getFemale() != null && getFemale().getLabourSupplyHoursWeekly() > 0) { - return getFemale().getDlltsd().ordinal(); + return getFemale().getHealthDsblLongtermFlag().ordinal(); } else return 0.; } case FixedCost_RetirementAge_Male -> { @@ -2883,13 +2883,13 @@ public double getDoubleValue(Enum variableID) { case FixedCostMale_Dlltsdsp -> { //Fixed cost interacted with dummy for partner being long-term sick or disabled if(getMale().getLabourSupplyHoursWeekly() > 0) { if(getFemale() != null) { - return getFemale().getDlltsd().ordinal(); //==1 if partner is long-term sick or disabled + return getFemale().getHealthDsblLongtermFlag().ordinal(); //==1 if partner is long-term sick or disabled } else return 0.; } else return 0.; } case FixedCostMale_Lesspc3_Student -> { //Fixed cost interacted with dummy for partner being a student if(getMale().getLabourSupplyHoursWeekly() > 0) { - if(getFemale() != null && getFemale().getLes_c4().equals(Les_c4.Student)) { + if(getFemale() != null && getFemale().getLabC4().equals(Les_c4.Student)) { return 1.; //Partner must be female - if a student, return 1 } else return 0.; } else return 0.; @@ -2912,13 +2912,13 @@ public double getDoubleValue(Enum variableID) { case FixedCostFemale_Dlltsdsp -> { //Fixed cost interacted with dummy for partner being long-term sick or disabled if(getFemale().getLabourSupplyHoursWeekly() > 0) { if(getMale() != null) { - return getMale().getDlltsd().ordinal(); //==1 if partner is long-term sick or disabled + return getMale().getHealthDsblLongtermFlag().ordinal(); //==1 if partner is long-term sick or disabled } else return 0.; } else return 0.; } case FixedCostFemale_Lesspc3_Student -> { if(getFemale().getLabourSupplyHoursWeekly() > 0) { - if(getMale() != null && getMale().getLes_c4().equals(Les_c4.Student)) { + if(getMale() != null && getMale().getLabC4().equals(Les_c4.Student)) { return 1.; //Partner must be male - if a student, return 1 } else return 0.; } else return 0.; @@ -2951,9 +2951,9 @@ public double getDoubleValue(Enum variableID) { } case Hrs_below36_Disabled -> { if (getMale() != null && getFemale() == null) { - return (getMale().getLabourSupplyHoursWeekly() > 0 && getMale().getLabourSupplyHoursWeekly() < 36) ? getMale().getDlltsd().ordinal() : 0.; + return (getMale().getLabourSupplyHoursWeekly() > 0 && getMale().getLabourSupplyHoursWeekly() < 36) ? getMale().getHealthDsblLongtermFlag().ordinal() : 0.; } else if (getFemale() != null && getMale() == null) { - return (getFemale().getLabourSupplyHoursWeekly() > 0 && getFemale().getLabourSupplyHoursWeekly() < 36) ? getFemale().getDlltsd().ordinal() : 0.; + return (getFemale().getLabourSupplyHoursWeekly() > 0 && getFemale().getLabourSupplyHoursWeekly() < 36) ? getFemale().getHealthDsblLongtermFlag().ordinal() : 0.; } else return 0.; } case Hrs_below36_RetirementAge -> { @@ -2965,12 +2965,12 @@ public double getDoubleValue(Enum variableID) { } case Hrs_below36_Disabled_Male -> { if (getMale() != null && getMale().getLabourSupplyHoursWeekly() > 0 && getMale().getLabourSupplyHoursWeekly() < 36) { - return getMale().getDlltsd().ordinal(); + return getMale().getHealthDsblLongtermFlag().ordinal(); } else return 0.; } case Hrs_below36_Disabled_Female -> { if (getFemale() != null && getFemale().getLabourSupplyHoursWeekly() > 0 && getFemale().getLabourSupplyHoursWeekly() < 36) { - return getFemale().getDlltsd().ordinal(); + return getFemale().getHealthDsblLongtermFlag().ordinal(); } else return 0.; } case Hrs_below36_RetirementAge_Male -> { @@ -3101,11 +3101,11 @@ public double getDoubleValue(Enum variableID) { case FixedCostByHighEducation -> { if(getFemale() == null) { //For single males if(getMale().getLabourSupplyHoursWeekly() > 0) { - return getMale().getDeh_c4().equals(Education.High) ? -1. : 0.; + return getMale().getEduHighestC4().equals(Education.High) ? -1. : 0.; } else return 0.; } else if (getMale() == null) { //For single females if(getFemale().getLabourSupplyHoursWeekly() > 0) { - return getFemale().getDeh_c4().equals(Education.High) ? -1. : 0.; + return getFemale().getEduHighestC4().equals(Education.High) ? -1. : 0.; } else return 0.; } else throw new IllegalArgumentException("Error - FixedCostByHighEducation regressor should only be called for Households containing single people (with or without children), however household " + key.getId() + " has a couple, with male " + getMale().getKey().getId() + " and female " + getFemale().getKey().getId()); @@ -3568,100 +3568,100 @@ public double getDoubleValue(Enum variableID) { } } case MaleEduM_10 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_10 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_20 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_20 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_30 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_30 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_40 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_40 -> { - return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_1 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_1 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_2 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_2 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_3 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_3 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleEduM_4 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case MaleEduH_4 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getMale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_10 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_10 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_20 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_20 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_30 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_30 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_40 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_40 -> { - return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getMale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_1 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_1 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TEN) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_2 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_2 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.TWENTY) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_3 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_3 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case FemaleEduM_4 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getDeh_c4().equals(Education.Medium)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getEduHighestC4().equals(Education.Medium)) ? 1. : 0.; } case FemaleEduH_4 -> { - return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getDeh_c4().equals(Education.High)) ? 1. : 0.; + return (getMale() != null && getFemale() != null && getFemale().getLabourSupplyWeekly().equals(Labour.THIRTY_EIGHT) && getFemale().getEduHighestC4().equals(Education.High)) ? 1. : 0.; } case MaleLeisure_dnc02 -> { return (getMaleLeisureHoursWeekly()) * getIndicatorChildren(0,1).ordinal(); @@ -3911,11 +3911,11 @@ public double fracEmployed() { Person female = getFemale(); if(female != null) { femaleQuantity = 1; - if (Les_c4.EmployedOrSelfEmployed.equals(female.getLes_c4())) {femaleEmployed = 1;}; + if (Les_c4.EmployedOrSelfEmployed.equals(female.getLabC4())) {femaleEmployed = 1;}; } if( male != null) { maleQuantity = 1; - if (Les_c4.EmployedOrSelfEmployed.equals(male.getLes_c4())) {maleEmployed = 1;} + if (Les_c4.EmployedOrSelfEmployed.equals(male.getLabC4())) {maleEmployed = 1;} } fracEmployed = (femaleEmployed + maleEmployed) / (double) (femaleQuantity + maleQuantity); @@ -3927,10 +3927,10 @@ public boolean isEmployed() { Person male = getMale(); Person female = getFemale(); if(female != null) { - isEmployed = Les_c4.EmployedOrSelfEmployed.equals(female.getLes_c4()); + isEmployed = Les_c4.EmployedOrSelfEmployed.equals(female.getLabC4()); } if(!isEmployed && male != null) { //Can skip checking if atRiskOfWork is true already - isEmployed = Les_c4.EmployedOrSelfEmployed.equals(male.getLes_c4()); + isEmployed = Les_c4.EmployedOrSelfEmployed.equals(male.getLabC4()); } return isEmployed; } @@ -4001,10 +4001,10 @@ public void initialiseLiquidWealth(int age, double donorLiquidWealth, double don } public double getWealthTotValue() { - return getLiquidWealth(true); + return getWealthTotValue(true); } - public double getLiquidWealth(boolean throwError) { + public double getWealthTotValue(boolean throwError) { if (!Parameters.checkFinite(wealthTotValue)) { if (throwError) throw new RuntimeException("Call to get benefit unit liquid wealth before it is initialised."); @@ -4014,15 +4014,15 @@ public double getLiquidWealth(boolean throwError) { return wealthTotValue; } - public void setWealthTotValue(Double liquidWealth) { - this.wealthTotValue = liquidWealth; + public void setWealthTotValue(Double wealthTotValue) { + this.wealthTotValue = wealthTotValue; } - public double getPensionWealth() { - return getPensionWealth(true); + public double getWealthPensValue() { + return getWealthPensValue(true); } - public double getPensionWealth(boolean throwError) { + public double getWealthPensValue(boolean throwError) { if (!Parameters.checkFinite(wealthPensValue)) { if (throwError) throw new RuntimeException("Call to get benefit unit pension wealth before it is initialised."); @@ -4032,15 +4032,15 @@ public double getPensionWealth(boolean throwError) { return wealthPensValue; } - public void setPensionWealth(Double wealthPensValue) { + public void setWealthPensValue(Double wealthPensValue) { this.wealthPensValue = wealthPensValue; } - public double getHousingWealth() { - return getHousingWealth(true); + public double getWealthPrptyValue() { + return getWealthPrptyValue(true); } - public double getHousingWealth(boolean throwError) { + public double getWealthPrptyValue(boolean throwError) { if (!Parameters.checkFinite(wealthPrptyValue)) { if (throwError) throw new RuntimeException("Call to get benefit unit housing wealth before it is initialised."); @@ -4050,14 +4050,14 @@ public double getHousingWealth(boolean throwError) { return wealthPrptyValue; } - public void setHousingWealth(Double wealth) { - wealthPrptyValue = wealth; + public void setWealthPrptyValue(Double wealthPrptyValue) { + this.wealthPrptyValue = wealthPrptyValue; } - public double getChildcareCostPerWeek() { - return getChildcareCostPerWeek(true); + public double getXChildCareWeek() { + return getXChildCareWeek(true); } - public double getChildcareCostPerWeek(boolean throwError) { + public double getXChildCareWeek(boolean throwError) { if (!Parameters.checkFinite(xChildCareWeek)) { if (throwError) { throw new RuntimeException("Call to get benefit unit childcare cost before it is initialised."); @@ -4068,10 +4068,10 @@ public double getChildcareCostPerWeek(boolean throwError) { return xChildCareWeek; } - public double getSocialCareCostPerWeek() { - return getSocialCareCostPerWeek(true); + public double getXCareWeek() { + return getXCareWeek(true); } - public double getSocialCareCostPerWeek(boolean throwError) { + public double getXCareWeek(boolean throwError) { if (!Parameters.checkFinite(xCareWeek)) { if (throwError) { throw new RuntimeException("Call to get benefit unit social care cost before it is initialised."); @@ -4172,12 +4172,12 @@ public Indicator getIndicatorChildren0to3() { public Indicator getIndicatorChildren4to12() { return getIndicatorChildren(4,12); } - public Integer getNumberChildrenAll_lag1() { + public Integer getNumberChildrenAllL1() { return numberChildrenAll_lag1; } - public Integer getNumberChildren02_lag1() { return numberChildren02_lag1; } - public Indicator getIndicatorChildren03_lag1() { return dem0to3L1; } - public Indicator getIndicatorChildren412_lag1() { + public Integer getNumberChildren02L1() { return numberChildren02_lag1; } + public Indicator getDem0to3L1() { return dem0to3L1; } + public Indicator getDem4to12L1() { return dem4to12L1; } @@ -4185,15 +4185,15 @@ public double getEquivalisedDisposableIncomeYearly() { return Objects.requireNonNullElse(yDispEquivYear, -9999.99); } - public int getAtRiskOfPoverty() { + public int getYPvrtyFlag() { return Objects.requireNonNullElse(yPvrtyFlag, 0); } - public Integer getAtRiskOfPoverty_lag1() { + public Integer getYPvrtyFlagL1() { return yPvrtyFlagL1; } - public void setAtRiskOfPoverty(Integer yPvrtyFlag) { + public void setYPvrtyFlag(Integer yPvrtyFlag) { this.yPvrtyFlag = yPvrtyFlag; } @@ -4229,7 +4229,7 @@ public void setReceivedLegacyBenefits(Integer yBenLegacyReceivedFlag) { } - public void setOccupancyLocal(Occupancy occupancy) { + public void setI_demOccupancy(Occupancy occupancy) { i_demOccupancy = occupancy; } @@ -4263,25 +4263,25 @@ public long getId() { return key.getId(); } - public Ydses_c5 getYdses_c5() { + public Ydses_c5 getYHhQuintilesMonthC5() { return yHhQuintilesMonthC5; } - public Ydses_c5 getYdses_c5_lag1() { + public Ydses_c5 getYHhQuintilesMonthC5L1() { return yHhQuintilesMonthC5L1; } - public double getTmpHHYpnbihs_dv_asinhNoNull() { + public double getI_yNonBenHhGrossAsinhNoNull() { return Objects.requireNonNullElse(i_yNonBenHhGrossAsinh, 0.0); } - public double getTmpHHYpnbihs_dv_asinh() { + public double getI_yNonBenHhGrossAsinh() { if (i_yNonBenHhGrossAsinh ==null) throw new RuntimeException("tmpHHYpnbihs_dv_asinh accessed before initialised"); return i_yNonBenHhGrossAsinh; } - public void setTmpHHYpnbihs_dv_asinh(double val) { + public void setI_yNonBenHhGrossAsinh(double val) { i_yNonBenHhGrossAsinh = val; } @@ -4385,27 +4385,27 @@ public Person getRefPersonForDecisions() { throw new IllegalStateException("ERROR - benefit unit identified as couple, but missing male adult"); } else if (female==null) { throw new IllegalStateException("ERROR - benefit unit identified as couple, but missing female adult"); - } else if (male.getDlltsd() == Indicator.True) { + } else if (male.getHealthDsblLongtermFlag() == Indicator.True) { ref = male; - } else if (female.getDlltsd() == Indicator.True) { + } else if (female.getHealthDsblLongtermFlag() == Indicator.True) { ref = female; - } else if (Indicator.True.equals(male.getNeedSocialCare())) { + } else if (Indicator.True.equals(male.getCareNeedFlag())) { ref = male; - } else if (Indicator.True.equals(female.getNeedSocialCare())) { + } else if (Indicator.True.equals(female.getCareNeedFlag())) { ref = female; - } else if (male.getLes_c4()==Les_c4.Retired && female.getLes_c4()==Les_c4.Retired) { + } else if (male.getLabC4()==Les_c4.Retired && female.getLabC4()==Les_c4.Retired) { if (male.getDemAge() >= female.getDemAge()) { ref = male; } else { ref = female; } - } else if (male.getLes_c4()==Les_c4.Retired) { + } else if (male.getLabC4()==Les_c4.Retired) { ref = male; - } else if (female.getLes_c4()==Les_c4.Retired) { + } else if (female.getLabC4()==Les_c4.Retired) { ref = female; - } else if (male.getLes_c4()==Les_c4.Student && male.getDemAge()<=Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION && female.getLes_c4()!=Les_c4.Student) { + } else if (male.getLabC4()==Les_c4.Student && male.getDemAge()<=Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION && female.getLabC4()!=Les_c4.Student) { ref = male; - } else if (female.getLes_c4()==Les_c4.Student && female.getDemAge()<=Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION && male.getLes_c4()!=Les_c4.Student) { + } else if (female.getLabC4()==Les_c4.Student && female.getDemAge()<=Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION && male.getLabC4()!=Les_c4.Student) { ref = female; } else { if (male.getLabWageFullTimeHrly() >= female.getLabWageFullTimeHrly()) { @@ -4435,13 +4435,13 @@ public double getHealthValForBehaviour() { Person male = getMale(); Person female = getFemale(); if (male != null) { - if (male.getDhe() != null) { - health = male.getDhe().getValue(); + if (male.getHealthSelfRated() != null) { + health = male.getHealthSelfRated().getValue(); } } if (female != null) { - if ( female.getDhe() != null ) { - if (female.getDhe().getValue() < health) health = female.getDhe().getValue(); + if ( female.getHealthSelfRated() != null ) { + if (female.getHealthSelfRated().getValue() < health) health = female.getHealthSelfRated().getValue(); } } return (double)health; @@ -4553,18 +4553,18 @@ public void setInvestmentIncomeAnnual() { male.setyCapitalPersMonth(val); female.setyCapitalPersMonth(val); val = asinh((yInvestYear + yPensYear)/12.0/2.0); - male.setYptciihs_dv(val); - female.setYptciihs_dv(val); + male.setYMiscPersGrossMonth(val); + female.setYMiscPersGrossMonth(val); } else if (Occupancy.Single_Male.equals(occupancy)) { val = asinh(yInvestYear /12.0); male.setyCapitalPersMonth(val); val = asinh((yInvestYear + yPensYear)/12.0); - male.setYptciihs_dv(val); + male.setYMiscPersGrossMonth(val); } else { val = asinh(yInvestYear /12.0); female.setyCapitalPersMonth(val); val = asinh((yInvestYear + yPensYear)/12.0); - female.setYptciihs_dv(val); + female.setYMiscPersGrossMonth(val); } } else { throw new RuntimeException("Unrecognised call to update investment income"); @@ -4606,10 +4606,10 @@ void updateDiscretionaryConsumption() { private double getNonDiscretionaryConsumptionPerYear() { double nonDiscretionaryConsumptionPerYear = 0.0; if (Parameters.flagFormalChildcare) { - nonDiscretionaryConsumptionPerYear += getChildcareCostPerWeek() * Parameters.WEEKS_PER_YEAR; + nonDiscretionaryConsumptionPerYear += getXChildCareWeek() * Parameters.WEEKS_PER_YEAR; } if (Parameters.flagSocialCare) { - nonDiscretionaryConsumptionPerYear += getSocialCareCostPerWeek() * Parameters.WEEKS_PER_YEAR; + nonDiscretionaryConsumptionPerYear += getXCareWeek() * Parameters.WEEKS_PER_YEAR; } return nonDiscretionaryConsumptionPerYear; } @@ -4665,7 +4665,7 @@ private void updateChildcareCostPerWeek(int year, int age) { double score = Parameters.getRegChildcareC1b().getScore(this, Regressors.class); xChildCareWeek = Math.exp(score); double costCap = childCareCostCapWeekly(); - if (costCap > 0.0 && costCap < getChildcareCostPerWeek()) { + if (costCap > 0.0 && costCap < getXChildCareWeek()) { xChildCareWeek = costCap; } } @@ -4689,7 +4689,7 @@ private void updateSocialCareProvision() { } } - public void setDeh_c4Local(Education edu) { + public void setI_eduHighestC4(Education edu) { i_eduHighestC4 = edu; } @@ -4707,11 +4707,11 @@ private Education getHighestDehC4() { Person female = getFemale(); if(male != null || female != null) { - if (male != null && male.getDeh_c4() != null) { - max = male.getDeh_c4(); + if (male != null && male.getEduHighestC4() != null) { + max = male.getEduHighestC4(); } - if (female != null && female.getDeh_c4() != null) { - Education femaleEdu = female.getDeh_c4(); + if (female != null && female.getEduHighestC4() != null) { + Education femaleEdu = female.getEduHighestC4(); if (max == null || femaleEdu.getRank() > max.getRank()) { max = femaleEdu; } @@ -4722,11 +4722,11 @@ private Education getHighestDehC4() { return max; } - public void setLabourHoursWeekly1Local(Integer hours) { + public void setI_labHrsWork1Week(Integer hours) { i_labHrsWork1Week = hours; } - public void setLabourHoursWeekly2Local(Integer hours) { + public void setI_labHrsWork2Week(Integer hours) { i_labHrsWork2Week = hours; } @@ -4825,7 +4825,7 @@ private double childCareCostCapWeekly() { return cap; } - public void setYearLocal(Integer year) { + public void setI_demYear(Integer year) { i_demYear = year; } @@ -4852,9 +4852,9 @@ public void setProcessedId(long id) { public long getSeed(){return (statSeed !=null) ? statSeed : 0L;} - public long getIdOriginalBU() {return idBuOriginal;} + public long getIdBuOriginal() {return idBuOriginal;} - public long getIdOriginalHH() {return idHhOriginal;} + public long getIdHhOriginal() {return idHhOriginal;} public Person getFemale() { for (Person member : members) { diff --git a/src/main/java/simpaths/model/Household.java b/src/main/java/simpaths/model/Household.java index 6fd8aa8e6..aa4e147c1 100644 --- a/src/main/java/simpaths/model/Household.java +++ b/src/main/java/simpaths/model/Household.java @@ -63,7 +63,7 @@ public Household(Household originalHousehold, SampleEntry sampleEntry) { model = (SimPathsModel) SimulationEngine.getInstance().getManager(SimPathsModel.class.getCanonicalName()); collector = (SimPathsCollector) SimulationEngine.getInstance().getManager(SimPathsCollector.class.getCanonicalName()); key = new PanelEntityKey(originalHousehold.getId()); - this.idHhOriginal = originalHousehold.getIdOriginalHH(); + this.idHhOriginal = originalHousehold.getIdHhOriginal(); } default -> { model = (SimPathsModel) SimulationEngine.getInstance().getManager(SimPathsModel.class.getCanonicalName()); @@ -83,7 +83,7 @@ public Household(long householdId) { /* METHODS */ - public Long getIdOriginalHH() {return idHhOriginal;} + public Long getIdHhOriginal() {return idHhOriginal;} public void resetWeights(double newWeight) { diff --git a/src/main/java/simpaths/model/InSchoolAlignment.java b/src/main/java/simpaths/model/InSchoolAlignment.java index ae3733f49..af5fa63e0 100644 --- a/src/main/java/simpaths/model/InSchoolAlignment.java +++ b/src/main/java/simpaths/model/InSchoolAlignment.java @@ -50,8 +50,8 @@ public double evaluate(double[] args) { // Ensure each trial point is evaluated from lagged status (pure function for root search). persons.parallelStream().forEach(person -> { - if (person.getLes_c4_lag1() != null) { - person.setLes_c4(person.getLes_c4_lag1()); + if (person.getLabC4L1() != null) { + person.setLabC4(person.getLabC4L1()); } person.inSchool(args[0]); }); @@ -77,13 +77,13 @@ private double evalStudentShare() { .filter(person -> person.getDemAge() >= Parameters.MIN_AGE_TO_LEAVE_EDUCATION && person.getDemAge() <= Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION && !person.isToLeaveSchool() - && Les_c4.Student.equals(person.getLes_c4())) // count aligned student group only + && Les_c4.Student.equals(person.getLabC4())) // count aligned student group only .count(); // Counts individuals within education age range: 16-29 (range is defined in Model) long numPeople = model.getPersons().stream() .filter(person -> person.getDemAge() >= Parameters.MIN_AGE_TO_LEAVE_EDUCATION && person.getDemAge() <= Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION - && person.getLes_c4() != null) + && person.getLabC4() != null) .count(); return (numStudents > 0) ? (double) numStudents / numPeople : 0.0; diff --git a/src/main/java/simpaths/model/InitialPopulationFilter.java b/src/main/java/simpaths/model/InitialPopulationFilter.java index a6688acdd..d4b03e64f 100644 --- a/src/main/java/simpaths/model/InitialPopulationFilter.java +++ b/src/main/java/simpaths/model/InitialPopulationFilter.java @@ -123,9 +123,9 @@ public boolean evaluate(Household household, Region region) { for (Person person : benefitUnit.getMembers()) { - if (person.getDemAge() < Parameters.MIN_AGE_COHABITATION && Dcpst.Partnered.equals(person.getDcpst())) + if (person.getDemAge() < Parameters.MIN_AGE_COHABITATION && Dcpst.Partnered.equals(person.getDemPartnerStatus())) return false; - else if (Dcpst.Partnered.equals(person.getDcpst()) && cohabiting <= 0) + else if (Dcpst.Partnered.equals(person.getDemPartnerStatus()) && cohabiting <= 0) return false; else { if (IGNORE_REGION) { @@ -146,7 +146,7 @@ else if (Dcpst.Partnered.equals(person.getDcpst()) && cohabiting <= 0) benefitUnit.setRegion(region); for (Person person : benefitUnit.getMembers()) { - if (Dcpst.Partnered.equals(person.getDcpst())) + if (Dcpst.Partnered.equals(person.getDemPartnerStatus())) cohabiting -= 1; int age = Math.min(censorAge, person.getDemAge()); diff --git a/src/main/java/simpaths/model/LabourMarket.java b/src/main/java/simpaths/model/LabourMarket.java index 490430ec6..656eaed49 100644 --- a/src/main/java/simpaths/model/LabourMarket.java +++ b/src/main/java/simpaths/model/LabourMarket.java @@ -120,27 +120,27 @@ Need to model wages and hours of work (as the other labour supply module would d boolean setMaleSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(male, Person.DoublesVariables.class)); boolean setFemaleSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(female, Person.DoublesVariables.class)); - if (setMaleSelfEmployed && male.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - male.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setMaleSelfEmployed && male.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + male.setLabC7Covid(Les_c7_covid.SelfEmployed); } - if (setFemaleSelfEmployed && female.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - female.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setFemaleSelfEmployed && female.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + female.setLabC7Covid(Les_c7_covid.SelfEmployed); } } else if (occupancy.equals(Occupancy.Single_Male)) { Person male = benefitUnit.getMale(); male.initialise_les_c6_from_c4(); personsInBenefitUnit.add(male); boolean setSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(male, Person.DoublesVariables.class)); - if (setSelfEmployed && male.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - male.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setSelfEmployed && male.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + male.setLabC7Covid(Les_c7_covid.SelfEmployed); } } else if (occupancy.equals(Occupancy.Single_Female)) { Person female = benefitUnit.getFemale(); female.initialise_les_c6_from_c4(); personsInBenefitUnit.add(female); boolean setSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(female, Person.DoublesVariables.class)); - if (setSelfEmployed && female.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - female.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setSelfEmployed && female.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + female.setLabC7Covid(Les_c7_covid.SelfEmployed); } } else { throw new RuntimeException("Warning: Occupancy unknown in benefit unit " + benefitUnit.getKey().getId()); @@ -156,38 +156,38 @@ Need to model wages and hours of work (as the other labour supply module would d Person female = benefitUnit.getFemale(); personsInBenefitUnit.add(male); personsInBenefitUnit.add(female); - if (male != null && male.getLes_c7_covid() == null) { + if (male != null && male.getLabC7Covid() == null) { male.initialise_les_c6_from_c4(); boolean setMaleSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(male, Person.DoublesVariables.class)); - if (setMaleSelfEmployed && male.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - male.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setMaleSelfEmployed && male.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + male.setLabC7Covid(Les_c7_covid.SelfEmployed); } } - if (female != null && female.getLes_c7_covid() == null) { + if (female != null && female.getLabC7Covid() == null) { female.initialise_les_c6_from_c4(); boolean setFemaleSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(female, Person.DoublesVariables.class)); - if (setFemaleSelfEmployed && female.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - female.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setFemaleSelfEmployed && female.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + female.setLabC7Covid(Les_c7_covid.SelfEmployed); } } } else if (occupancy.equals(Occupancy.Single_Male)) { Person male = benefitUnit.getMale(); personsInBenefitUnit.add(male); - if (male != null && male.getLes_c7_covid() == null) { + if (male != null && male.getLabC7Covid() == null) { male.initialise_les_c6_from_c4(); boolean setSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(male, Person.DoublesVariables.class)); - if (setSelfEmployed && male.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - male.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setSelfEmployed && male.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + male.setLabC7Covid(Les_c7_covid.SelfEmployed); } } } else if (occupancy.equals(Occupancy.Single_Female)) { Person female = benefitUnit.getFemale(); personsInBenefitUnit.add(female); - if (female != null && female.getLes_c7_covid() == null) { + if (female != null && female.getLabC7Covid() == null) { female.initialise_les_c6_from_c4(); boolean setSelfEmployed = (labourInnov.nextDouble() < Parameters.getRegC19LS_SE().getProbability(female, Person.DoublesVariables.class)); - if (setSelfEmployed && female.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed)) { - female.setLes_c7_covid(Les_c7_covid.SelfEmployed); + if (setSelfEmployed && female.getLabC4().equals(Les_c4.EmployedOrSelfEmployed)) { + female.setLabC7Covid(Les_c7_covid.SelfEmployed); } } } @@ -280,7 +280,7 @@ Need to model wages and hours of work (as the other labour supply module would d Person person = benefitUnit.getMale(); if (person.atRiskOfWork()) { - Education ed = person.getDeh_c4(); + Education ed = person.getEduHighestC4(); double newVal = person.getLabWageFullTimeHrly(); potentialHourlyEarningsByEdu.put(ed, potentialHourlyEarningsByEdu.get(ed) + newVal); int oldCount = countByEdu.get(ed); @@ -292,7 +292,7 @@ Need to model wages and hours of work (as the other labour supply module would d Person person = benefitUnit.getFemale(); if (person.atRiskOfWork()) { - Education ed = person.getDeh_c4(); + Education ed = person.getEduHighestC4(); double newVal = person.getLabWageFullTimeHrly(); potentialHourlyEarningsByEdu.put(ed, potentialHourlyEarningsByEdu.get(ed) + newVal); int oldCount = countByEdu.get(ed); @@ -319,13 +319,13 @@ public void updateGrossLabourIncomeBaseline_Xt5(LinkedHashSet personsInB if (person != null && person.getCovidYLabGrossXt5() == null) { double covidModuleGrossLabourIncomeBaseline = person.getCovidModuleGrossLabourIncome_Baseline(); Statistics stats = ((SimPathsCollector) SimulationEngine.getInstance().getManager(SimPathsCollector.class.getCanonicalName())).getStats(); - if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p20()) { + if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP20()) { person.setCovidYLabGrossXt5(Quintiles.Q1); - } else if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p40()) { + } else if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP40()) { person.setCovidYLabGrossXt5(Quintiles.Q2); - } else if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p60()) { + } else if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP60()) { person.setCovidYLabGrossXt5(Quintiles.Q3); - } else if (covidModuleGrossLabourIncomeBaseline <= stats.getGrossLabourIncome_p80()) { + } else if (covidModuleGrossLabourIncomeBaseline <= stats.getYLabP80()) { person.setCovidYLabGrossXt5(Quintiles.Q4); } else { person.setCovidYLabGrossXt5(Quintiles.Q5); diff --git a/src/main/java/simpaths/model/Person.java b/src/main/java/simpaths/model/Person.java index c839a951f..452fc7354 100644 --- a/src/main/java/simpaths/model/Person.java +++ b/src/main/java/simpaths/model/Person.java @@ -108,10 +108,10 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight, // partner lags @Lag(field="demPartnerStatusL1") @Transient private Dcpst demPartnerStatusL2; // lag (2) partnership status - @Lag(getter="getDcpst") @Transient private Dcpst demPartnerStatusL1; // lag partnership status + @Lag(getter="getDemPartnerStatus") @Transient private Dcpst demPartnerStatusL1; // lag partnership status @Lag(getter="getEduHighestPartner") @Transient private Education eduHighestPartnerC4L1; //Lag(1) of partner's education @Lag(getter="getHealthPartner") @Transient private Dhe healthPartnerSelfRatedL1; - @Lag(getter="getLesdf_c4") @Transient private Lesdf_c4 labStatusPartnerAndOwnC4L1; //Lag(1) of own and partner's activity status + @Lag(getter="getLabStatusPartnerAndOwnC4") @Transient private Lesdf_c4 labStatusPartnerAndOwnC4L1; //Lag(1) of own and partner's activity status @Lag(getter="getIdPartner") @Transient private Long idPartnerL1; @Lag(getter="getHouseholdStatus") @Transient private HouseholdStatus demStatusHhL1; //Lag(1) of household_status @Lag(getter="getAgeDifferencePartner") @Transient private Integer demAgePartnerDiffL1; //Lag(1) of difference between ages of partners in union @@ -166,21 +166,21 @@ public class Person implements EventListener, IDoubleSource, IIntSource, Weight, private Integer demPartnerNYear; //Number of years in partnership @Transient private Integer demPartnerNYearL1; //Lag(1) of number of years in partnership private Double yNonBenPersGrossMonth; // asinh of personal non-benefit income per month - @Lag(getter="getyNonBenPersGrossMonth") @Transient private Double yNonBenPersGrossMonthL1; //Lag(1) of gross personal non-benefit income + @Lag(getter="getYNonBenPersGrossMonth") @Transient private Double yNonBenPersGrossMonthL1; //Lag(1) of gross personal non-benefit income private Double yMiscPersGrossMonth; // asinh of non-employment non-benefit income per month (capital and pension) private Double yCapitalPersMonth; // asinh of capital income per month private Double yPensPersGrossMonth; // asinh of pension income per month @Lag(field="yCapitalPersMonthL1") @Transient private Double yCapitalPersMonthL2; //Lag(2) of capital income - @Lag(getter="getyCapitalPersMonth") @Transient private Double yCapitalPersMonthL1; //Lag(1) of ypncp + @Lag(getter="getYCapitalPersMonth") @Transient private Double yCapitalPersMonthL1; //Lag(1) of ypncp @Lag(field="yPensPersGrossMonthL1") @Transient private Double yPensPersGrossMonthL2; //Lag(2) of pension income - @Lag(getter="getyPensPersGrossMonth") @Transient private Double yPensPersGrossMonthL1; //Lag(1) of pension income + @Lag(getter="getYPensPersGrossMonth") @Transient private Double yPensPersGrossMonthL1; //Lag(1) of pension income @Lag(field="yMiscPersGrossMonthL2") @Transient private Double yMiscPersGrossMonthL3; //Lag(3) of gross personal non-benefit non-employment income @Lag(field="yMiscPersGrossMonthL1") @Transient private Double yMiscPersGrossMonthL2; //Lag(2) of gross personal non-benefit non-employment income - @Lag(getter="getyMiscPersGrossMonth") @Transient private Double yMiscPersGrossMonthL1; //Lag(1) of gross personal non-benefit non-employment income + @Lag(getter="getYMiscPersGrossMonth") @Transient private Double yMiscPersGrossMonthL1; //Lag(1) of gross personal non-benefit non-employment income private Double yEmpPersGrossMonth; // asinh transform of personal labour income per month @Lag(field="yEmpPersGrossMonthL2") @Transient private Double yEmpPersGrossMonthL3; //Lag(3) of gross personal employment income @Lag(field="yEmpPersGrossMonthL1") @Transient private Double yEmpPersGrossMonthL2; //Lag(2) of gross personal employment income - @Lag(getter="getyEmpPersGrossMonth") @Transient private Double yEmpPersGrossMonthL1; //Lag(1) of gross personal employment income + @Lag(getter="getYEmpPersGrossMonth") @Transient private Double yEmpPersGrossMonthL1; //Lag(1) of gross personal employment income //For matching process @Transient private Double demAgeDiffDesired; @@ -259,13 +259,13 @@ public Person(Gender gender, Person mother) { demEnterSample = SampleEntry.Birth; demMaleFlag = gender; idMother = mother.getId(); - eduHighestMotherC4 = mother.getDeh_c4(); + eduHighestMotherC4 = mother.getEduHighestC4(); if (mother.getPartner()==null) { idFather = null; - eduHighestFatherC4 = mother.getDeh_c4(); + eduHighestFatherC4 = mother.getEduHighestC4(); } else { idFather = mother.getPartner().getId(); - eduHighestFatherC4 = mother.getPartner().getDeh_c4(); + eduHighestFatherC4 = mother.getPartner().getEduHighestC4(); } labEmpNyear = 0; @@ -290,7 +290,7 @@ public Person(Gender gender, Person mother) { healthPhysicalPcs = 56.; demLifeSatScore0to10 = 6.; eduHighestC4 = Education.InEducation; - demEthnC6 = mother.getDot01(); + demEthnC6 = mother.getDemEthnC6(); labC4 = Les_c4.Student; //Set lag activity status as Student, i.e. in education from birth eduLeftEduFlag = false; labC7Covid = Les_c7_covid.Student; @@ -318,9 +318,9 @@ public Person (Person originalPerson, long statSeed, SampleEntry demEnterSample) switch (demEnterSample) { case ProcessedInputData -> { key.setId(originalPerson.getId()); - idPersOriginal = originalPerson.getIdOriginalPerson(); - idBuOriginal = originalPerson.getIdOriginalBU(); - idHhOriginal = originalPerson.getIdOriginalHH(); + idPersOriginal = originalPerson.getIdPersOriginal(); + idBuOriginal = originalPerson.getIdBuOriginal(); + idHhOriginal = originalPerson.getIdHhOriginal(); } default -> { idPersOriginal = originalPerson.key.getId(); @@ -404,10 +404,10 @@ else if (demAge > Parameters.MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION) labStatusPartnerAndOwnC4L1 = originalPerson.labStatusPartnerAndOwnC4L1; demPartnerStatusL1 = originalPerson.demPartnerStatusL1; demPartnerStatusL2 = originalPerson.demPartnerStatusL2; - yNonBenPersGrossMonth = originalPerson.getyNonBenPersGrossMonth(); + yNonBenPersGrossMonth = originalPerson.getYNonBenPersGrossMonth(); yNonBenPersGrossMonthL1 = originalPerson.yNonBenPersGrossMonthL1; yMiscPersGrossMonth = Objects.requireNonNullElse(originalPerson.yMiscPersGrossMonth, 0.0); - yEmpPersGrossMonth = originalPerson.getyEmpPersGrossMonth(); + yEmpPersGrossMonth = originalPerson.getYEmpPersGrossMonth(); yEmpPersGrossMonthL1 = originalPerson.yEmpPersGrossMonthL1; yEmpPersGrossMonthL2 = originalPerson.yEmpPersGrossMonthL2; yEmpPersGrossMonthL3 = originalPerson.yEmpPersGrossMonthL3; @@ -632,7 +632,7 @@ public void setAdditionalFieldsInInitialPopulation() { demBePartnerFlag = false; demLeavePartnerFlag = false; eduLeaveSchoolFlag = false; - setSedex(Indicator.False); //This variable is False by default + setEduExitSampleFlag(Indicator.False); //This variable is False by default // is set to true only when person leaves school in this specific year // eduSpellFlag = (Les_c4.Student.equals(labC4)) ? Indicator.True : Indicator.False; // no need to update eduSpellFlag as its value is persisted from the previous year @@ -687,26 +687,26 @@ public void setAdditionalFieldsInInitialPopulation() { labWageOfferLowFlagL1 = getLowWageOffer(); eduHighestC4L1 = eduHighestC4; //Update lag(1) of education level eduSpellFlagL1 = eduSpellFlag ; //Update lag(1) of education level - yNonBenPersGrossMonthL1 = getyNonBenPersGrossMonth(); //Update lag(1) of gross personal non-benefit income + yNonBenPersGrossMonthL1 = getYNonBenPersGrossMonth(); //Update lag(1) of gross personal non-benefit income labHrsWorkEnumWeekL1 = getLabourSupplyWeekly(); // Lag(1) of labour supply yBenReceivedFlagL1 = yBenReceivedFlag; // Lag(1) of flag indicating if individual receives benefits yBenNonUCReceivedFlagL1 = yBenNonUCReceivedFlag; // Lag(1) of flag indicating if individual receives non-UC benefits yBenUCReceivedFlagL1 = yBenUCReceivedFlag; // Lag(1) of flag indicating if individual receives UC labWageFullTimeHrlyL1 = labWageFullTimeHrly; // Lag(1) of potential hourly earnings - yEmpPersGrossMonthL1 = getyEmpPersGrossMonth(); //Lag(1) of gross personal employment income - yEmpPersGrossMonthL2 = getyEmpPersGrossMonth(); - yEmpPersGrossMonthL3 = getyEmpPersGrossMonth(); + yEmpPersGrossMonthL1 = getYEmpPersGrossMonth(); //Lag(1) of gross personal employment income + yEmpPersGrossMonthL2 = getYEmpPersGrossMonth(); + yEmpPersGrossMonthL3 = getYEmpPersGrossMonth(); - yMiscPersGrossMonthL1 = getyMiscPersGrossMonth(); - yMiscPersGrossMonthL2 = getyMiscPersGrossMonth(); - yMiscPersGrossMonthL3 = getyMiscPersGrossMonth(); + yMiscPersGrossMonthL1 = getYMiscPersGrossMonth(); + yMiscPersGrossMonthL2 = getYMiscPersGrossMonth(); + yMiscPersGrossMonthL3 = getYMiscPersGrossMonth(); - yCapitalPersMonthL1 = getyCapitalPersMonth(); - yCapitalPersMonthL2 = getyCapitalPersMonth(); + yCapitalPersMonthL1 = getYCapitalPersMonth(); + yCapitalPersMonthL2 = getYCapitalPersMonth(); - yPensPersGrossMonthL1 = getyPensPersGrossMonth(); - yPensPersGrossMonthL2 = getyPensPersGrossMonth(); + yPensPersGrossMonthL1 = getYPensPersGrossMonth(); + yPensPersGrossMonthL2 = getYPensPersGrossMonth(); demPartnerStatusL2 = demPartnerStatusL1; // Updating of this lag must occur before parnters variables are updated @@ -723,9 +723,9 @@ public void setAdditionalFieldsInInitialPopulation() { demAgePartnerDiffL1 = null; idPartnerL1 = null; } - demPartnerStatusL1 = getDcpst(); + demPartnerStatusL1 = getDemPartnerStatus(); yPersAndPartnerGrossDiffMonthL1 = getYnbcpdf_dv(); //Lag(1) of difference between own and partner's gross personal non-benefit income - labStatusPartnerAndOwnC4L1 = getLesdf_c4(); //Lag(1) of own and partner's activity status + labStatusPartnerAndOwnC4L1 = getLabStatusPartnerAndOwnC4(); //Lag(1) of own and partner's activity status } //This method assign people to age groups used to define types in the SBAM matching procedure @@ -1073,7 +1073,7 @@ public boolean considerRetirement() { toRetire = (statInnovations.getDoubleDraw(23) < prob); } if (toRetire) { - setLes_c4(Les_c4.Retired); + setLabC4(Les_c4.Retired); } } return toRetire; @@ -1434,7 +1434,7 @@ protected void health() { if (event.isProblemWithProbs()) model.addCounterErrorH1a(); - if (Indicator.False.equals(getDed())) { + if (Indicator.False.equals(getEduSpellFlag())) { boolean becomeLTSickDisabled = false; if (!Parameters.enableIntertemporalOptimisations || DecisionParams.flagDisability) { double prob = Parameters.getRegHealthH2().getProbability(this, Person.DoublesVariables.class); @@ -1720,9 +1720,9 @@ public boolean inSchool(double probitAdjustment) { if (labourInnov < prob) { // Remain a student *OUTCOME B* - setLes_c4(Les_c4.Student); //not needed, more of a precaution - //setDed(Indicator.True); //(!) a bug; E1a is applied to everyone with Ded true and false - //setDer(Indicator.False); //(!) a bug; Der is set to true only when individual re-enters education (i.e. process E1b) + setLabC4(Les_c4.Student); //not needed, more of a precaution + //setEduSpellFlag(Indicator.True); //(!) a bug; E1a is applied to everyone with Ded true and false + //setEduReturnFlag(Indicator.False); //(!) a bug; Der is set to true only when individual re-enters education (i.e. process E1b) return true; // Must return true as they remain in school } else { // Leave education --> Process E2 @@ -1759,9 +1759,9 @@ public boolean inSchool(double probitAdjustment) { if (labourInnov < prob) { // Become a student *OUTCOME E* - setLes_c4(Les_c4.Student); - setDer(Indicator.True); - setDed(Indicator.False); //not needed, more of a precaution as ded should already be false + setLabC4(Les_c4.Student); + setEduReturnFlag(Indicator.True); + setEduSpellFlag(Indicator.False); //not needed, more of a precaution as ded should already be false return true; // Must return true as they become a student } else { return false; @@ -1796,21 +1796,21 @@ public boolean inSchool(double probitAdjustment) { // if (labourInnov < prob) { // //If event is true, re-enter education. If event is false, leave school // -// setLes_c4(Les_c4.Student); -// setDer(Indicator.True); -// setDed(Indicator.True); +// setLabC4(Les_c4.Student); +// setEduReturnFlag(Indicator.True); +// setEduSpellFlag(Indicator.True); // } else if (Les_c4.Student.equals(labC4)){ // //If activity status is student but regression to be in education was evaluated to false, remove student status // -// setLes_c4(Les_c4.NotEmployed); -// setDed(Indicator.False); +// setLabC4(Les_c4.NotEmployed); +// setEduSpellFlag(Indicator.False); // eduLeaveSchoolFlag = true; //Test what happens if people who returned to education leave again // } // } else if (demAge > 45 && labC4.equals(Les_c4.Student)) { // //People above 45 shouldn't be in education, so if someone re-entered at 45 in previous step, force out // -// setLes_c4(Les_c4.NotEmployed); -// setDed(Indicator.False); +// setLabC4(Les_c4.NotEmployed); +// setEduSpellFlag(Indicator.False); // } // } @@ -1819,11 +1819,11 @@ public void leavingSchool() { if (eduLeaveSchoolFlag) { setEducationLevel(); //If individual leaves school follow process E2a to assign level of education - setSedex(Indicator.True); //Set variable left education (sedex) if leaving school - setDed(Indicator.False); //Set variable in education (ded) to false if leaving school - setDer(Indicator.False); + setEduExitSampleFlag(Indicator.True); //Set variable left education (sedex) if leaving school + setEduSpellFlag(Indicator.False); //Set variable in education (ded) to false if leaving school + setEduReturnFlag(Indicator.False); setEduLeftEduFlag(true); //This is not reset and indicates if individual has ever left school - used with health process - setLes_c4(Les_c4.NotEmployed); //Set activity status to NotEmployed when leaving school to remove Student status + setLabC4(Les_c4.NotEmployed); //Set activity status to NotEmployed when leaving school to remove Student status this.eduLeaveSchoolFlag = false; // Reset the flag once the leaving process is complete } @@ -2161,7 +2161,7 @@ protected void projectEquivConsumption() { xEquivYear = benefitUnit.getDiscretionaryConsumptionPerYear() / benefitUnit.getEquivalisedWeight(); } else { - if (getLes_c4().equals(Les_c4.Retired)) { + if (getLabC4().equals(Les_c4.Retired)) { xEquivYear = benefitUnit.getEquivalisedDisposableIncomeYearly(); } else { xEquivYear = Math.max(0., (1-model.getSavingRate())*benefitUnit.getEquivalisedDisposableIncomeYearly()); @@ -2176,7 +2176,7 @@ protected void updateAttributes() { //Reset flags to default values - setSedex(Indicator.False); //This variable is False by default + setEduExitSampleFlag(Indicator.False); //This variable is False by default // is set to true only when person leaves school in this specific year // eduSpellFlag = (Les_c4.Student.equals(labC4)) ? Indicator.True : Indicator.False; // no need to update eduSpellFlag as its value is persisted from the previous year @@ -2213,7 +2213,7 @@ protected void updateAttributes() { private void updateOutputVariables() { idPartner = getPartnerID(); - demPartnerStatus = getDcpst(); + demPartnerStatus = getDemPartnerStatus(); } // used when children leave home @@ -3240,7 +3240,7 @@ public double getDoubleValue(Enum variableID) { } case NeedCarePartner -> { Person partner = getPartner(); - return (partner != null && Indicator.True.equals(partner.getNeedSocialCare())) ? 1. : 0.; + return (partner != null && Indicator.True.equals(partner.getCareNeedFlag())) ? 1. : 0.; } case ProvideCare_L1 -> { return (Indicator.True.equals(careProvidedFlagL1)) ? 1. : 0.; @@ -3352,13 +3352,13 @@ public double getDoubleValue(Enum variableID) { return (demAgePartnerDiffL1 != null) ? (double) demAgePartnerDiffL1 : 0.0; } case Dcpst_Single -> { - return (Dcpst.Single.equals(getDcpst())) ? 1.0 : 0.0; + return (Dcpst.Single.equals(getDemPartnerStatus())) ? 1.0 : 0.0; } case Dcpst_Partnered, Partnered, Partnered_Mixed, Partnered_Formal -> { - return (Dcpst.Partnered.equals(getDcpst())) ? 1.0 : 0.0; + return (Dcpst.Partnered.equals(getDemPartnerStatus())) ? 1.0 : 0.0; } case Dcpst_PreviouslyPartnered -> { - return (Dcpst.Single.equals(getDcpst())) ? 1.0 : 0.0; + return (Dcpst.Single.equals(getDemPartnerStatus())) ? 1.0 : 0.0; } case Dcpst_Partnered_L1 -> { if (demPartnerStatusL1 != null) { @@ -3397,10 +3397,10 @@ public double getDoubleValue(Enum variableID) { return (getNumberChildrenAll() > 0) ? 1. : 0.; } case Dnc_L1 -> { - return (double) getNumberChildrenAll_lag1(); + return (double) getNumberChildrenAllL1(); } case Dnc02_L1 -> { - return (double) getNumberChildren02_lag1(); + return (double) getNumberChildren02L1(); } case Dnc017 -> { return (double) getNumberChildren017(); @@ -3449,28 +3449,28 @@ public double getDoubleValue(Enum variableID) { } case Dhesp_Excellent -> { Person partner = getPartner(); - return (partner != null && Dhe.Excellent.equals(partner.getDhe())) ? 1. : 0.; + return (partner != null && Dhe.Excellent.equals(partner.getHealthSelfRated())) ? 1. : 0.; } case Dhesp_VeryGood_L1 -> { return (Dhe.VeryGood.equals(healthPartnerSelfRatedL1)) ? 1. : 0.; } case Dhesp_VeryGood -> { Person partner = getPartner(); - return (partner != null && Dhe.VeryGood.equals(partner.getDhe())) ? 1. : 0.; + return (partner != null && Dhe.VeryGood.equals(partner.getHealthSelfRated())) ? 1. : 0.; } case Dhesp_Good_L1 -> { return (Dhe.Good.equals(healthPartnerSelfRatedL1)) ? 1. : 0.; } case Dhesp_Good -> { Person partner = getPartner(); - return (partner != null && Dhe.Good.equals(partner.getDhe())) ? 1. : 0.; + return (partner != null && Dhe.Good.equals(partner.getHealthSelfRated())) ? 1. : 0.; } case Dhesp_Fair_L1 -> { return (Dhe.Fair.equals(healthPartnerSelfRatedL1)) ? 1. : 0.; } case Dhesp_Fair -> { Person partner = getPartner(); - return (partner != null && Dhe.Fair.equals(partner.getDhe())) ? 1. : 0.; + return (partner != null && Dhe.Fair.equals(partner.getHealthSelfRated())) ? 1. : 0.; } case Dhesp_Poor_L1 -> { return (Dhe.Poor.equals(healthPartnerSelfRatedL1)) ? 1. : 0.; @@ -3839,13 +3839,13 @@ else throw new IllegalArgumentException( return getInverseMillsRatio(); } case Ld_children_2under -> { - return (getNumberChildren02_lag1() > 0) ? 1.0 : 0.0; + return (getNumberChildren02L1() > 0) ? 1.0 : 0.0; } case Ld_children_3under -> { - return benefitUnit.getIndicatorChildren03_lag1().ordinal(); + return benefitUnit.getDem0to3L1().ordinal(); } case Ld_children_4_12 -> { - return benefitUnit.getIndicatorChildren412_lag1().ordinal(); + return benefitUnit.getDem4to12L1().ordinal(); } case Lemployed -> { if (labC4L1 != null) //Problem will null pointer exceptions for those who are inactive and then become active as their lagged employment status is null! @@ -3995,7 +3995,7 @@ else throw new IllegalArgumentException( } else return 0.; } case UnemploymentRate -> { - return getUnemploymentRateByGenderEducationAgeYear(getDemMaleFlag(), getDeh_c4(), getDemAge(), getYear()); + return getUnemploymentRateByGenderEducationAgeYear(getDemMaleFlag(), getEduHighestC4(), getDemAge(), getYear()); } case Union -> { return HouseholdStatus.Couple.equals(getHouseholdStatus()) ? 1. : 0.; @@ -4384,28 +4384,28 @@ else throw new IllegalArgumentException( return (double) model.getTimeTrendStopsInMonetaryProcesses() - 2000; } //Note: this returns base price year - 2000 (e.g. 17 for 2017 as base price year) and monetary variables are then uprated from 2017 level to the simulated year case Ydses_c5_Q2_L1, L_Ydses_c5_Q2, Ydses_c5_L1 -> { - return (Ydses_c5.Q2.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; + return (Ydses_c5.Q2.equals(getYHhQuintilesMonthC5L1())) ? 1.0 : 0.0; } case Ydses_c5_Q3_L1, L_Ydses_c5_Q3 -> { - return (Ydses_c5.Q3.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; + return (Ydses_c5.Q3.equals(getYHhQuintilesMonthC5L1())) ? 1.0 : 0.0; } case Ydses_c5_Q4_L1, L_Ydses_c5_Q4 -> { - return (Ydses_c5.Q4.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; + return (Ydses_c5.Q4.equals(getYHhQuintilesMonthC5L1())) ? 1.0 : 0.0; } case Ydses_c5_Q5_L1, L_Ydses_c5_Q5 -> { - return (Ydses_c5.Q5.equals(getYdses_c5_lag1())) ? 1.0 : 0.0; + return (Ydses_c5.Q5.equals(getYHhQuintilesMonthC5L1())) ? 1.0 : 0.0; } case HHincomeQ2, HHincomeQ2_Mixed, HHincomeQ2_Formal -> { - return (Ydses_c5.Q2.equals(getYdses_c5_current())) ? 1.0 : 0.0; + return (Ydses_c5.Q2.equals(getYHhQuintilesMonthC5Current())) ? 1.0 : 0.0; } case HHincomeQ3, HHincomeQ3_Mixed, HHincomeQ3_Formal -> { - return (Ydses_c5.Q3.equals(getYdses_c5_current())) ? 1.0 : 0.0; + return (Ydses_c5.Q3.equals(getYHhQuintilesMonthC5Current())) ? 1.0 : 0.0; } case HHincomeQ4, HHincomeQ4_Mixed, HHincomeQ4_Formal -> { - return (Ydses_c5.Q4.equals(getYdses_c5_current())) ? 1.0 : 0.0; + return (Ydses_c5.Q4.equals(getYHhQuintilesMonthC5Current())) ? 1.0 : 0.0; } case HHincomeQ5, HHincomeQ5_Mixed, HHincomeQ5_Formal -> { - return (Ydses_c5.Q5.equals(getYdses_c5_current())) ? 1.0 : 0.0; + return (Ydses_c5.Q5.equals(getYHhQuintilesMonthC5Current())) ? 1.0 : 0.0; } case Ypnbihs_dv_L1 -> { if (yNonBenPersGrossMonthL1 != null) { @@ -4505,18 +4505,18 @@ else throw new IllegalArgumentException( return (labC4.equals(Les_c4.NotEmployed) && labC4L1.equals(Les_c4.NotEmployed) && healthDsblLongtermFlag.equals(Indicator.False) && healthDsblLongtermFlagL1.equals(Indicator.False)) ? 1. : 0.; } case NonPovertyToPoverty -> { - if (benefitUnit.getAtRiskOfPoverty_lag1() != null) { - return (benefitUnit.getAtRiskOfPoverty_lag1() == 0 && benefitUnit.getAtRiskOfPoverty() == 1) ? 1. : 0.; + if (benefitUnit.getYPvrtyFlagL1() != null) { + return (benefitUnit.getYPvrtyFlagL1() == 0 && benefitUnit.getYPvrtyFlag() == 1) ? 1. : 0.; } else return 0.; } case PovertyToNonPoverty -> { - if (benefitUnit.getAtRiskOfPoverty_lag1() != null) { - return (benefitUnit.getAtRiskOfPoverty_lag1() == 1 && benefitUnit.getAtRiskOfPoverty() == 0) ? 1. : 0.; + if (benefitUnit.getYPvrtyFlagL1() != null) { + return (benefitUnit.getYPvrtyFlagL1() == 1 && benefitUnit.getYPvrtyFlag() == 0) ? 1. : 0.; } else return 0.; } case PersistentPoverty -> { - if (benefitUnit.getAtRiskOfPoverty_lag1() != null) { - return (benefitUnit.getAtRiskOfPoverty_lag1() == 1 && benefitUnit.getAtRiskOfPoverty() == 1) ? 1. : 0.; + if (benefitUnit.getYPvrtyFlagL1() != null) { + return (benefitUnit.getYPvrtyFlagL1() == 1 && benefitUnit.getYPvrtyFlag() == 1) ? 1. : 0.; } else return 0.; } case RealIncomeChange -> { @@ -4679,7 +4679,7 @@ else throw new IllegalArgumentException( return (getCovidSEISSReceivedFlag().equals(Indicator.True)) ? 1. : 0.; } case Les_c7_Covid_Furlough_L1 -> { - return (getLes_c7_covid_lag1().equals(Les_c7_covid.FurloughedFlex) || getLes_c7_covid_lag1().equals(Les_c7_covid.FurloughedFull)) ? 1. : 0.; + return (getLabC7CovidL1().equals(Les_c7_covid.FurloughedFlex) || getLabC7CovidL1().equals(Les_c7_covid.FurloughedFull)) ? 1. : 0.; } case Blpay_Q2 -> { return (getCovidYLabGrossXt5().equals(Quintiles.Q2)) ? 1. : 0.; @@ -4828,7 +4828,7 @@ public void setDemMaleFlag(Gender demMaleFlag) { this.demMaleFlag = demMaleFlag; } - public Les_c4 getLes_c4() { + public Les_c4 getLabC4() { return labC4; } @@ -4843,21 +4843,21 @@ public int getEducation() { else return 0; } - public void setLes_c4(Les_c4 labC4) { + public void setLabC4(Les_c4 labC4) { this.labC4 = labC4; } - public void setLes_c7_covid(Les_c7_covid labC7Covid) { this.labC7Covid = labC7Covid; } + public void setLabC7Covid(Les_c7_covid labC7Covid) { this.labC7Covid = labC7Covid; } - public Les_c7_covid getLes_c7_covid() { return labC7Covid; } + public Les_c7_covid getLabC7Covid() { return labC7Covid; } - public Les_c4 getLes_c4_lag1() { + public Les_c4 getLabC4L1() { return labC4L1; } - public Les_c7_covid getLes_c7_covid_lag1() { return labC7CovidL1; } + public Les_c7_covid getLabC7CovidL1() { return labC7CovidL1; } - public void setLes_c7_covid_lag1(Les_c7_covid labC7CovidL1) { + public void setLabC7CovidL1(Les_c7_covid labC7CovidL1) { this.labC7CovidL1 = labC7CovidL1; } @@ -4885,47 +4885,47 @@ public int getCohabiting() { return benefitUnit.getCoupleDummy(); } - public Education getDeh_c4() { + public Education getEduHighestC4() { return eduHighestC4; } - public void setDeh_c4(Education eduHighestC4) { + public void setEduHighestC4(Education eduHighestC4) { this.eduHighestC4 = eduHighestC4; } - public void setDeh_c4_lag1(Education eduHighestC4L1) { + public void setEduHighestC4L1(Education eduHighestC4L1) { this.eduHighestC4L1 = eduHighestC4L1; } - public Education getDehm_c4() { + public Education getEduHighestMotherC4() { return eduHighestMotherC4; } - public void setDehm_c4(Education eduHighestMotherC4) { + public void setEduHighestMotherC4(Education eduHighestMotherC4) { this.eduHighestMotherC4 = eduHighestMotherC4; } - public Education getDehf_c4() { + public Education getEduHighestFatherC4() { return eduHighestFatherC4; } - public void setDehf_c4(Education eduHighestFatherC4) { + public void setEduHighestFatherC4(Education eduHighestFatherC4) { this.eduHighestFatherC4 = eduHighestFatherC4; } - public Indicator getDed() { + public Indicator getEduSpellFlag() { return eduSpellFlag; } - public Indicator getDed_lag1() { + public Indicator getEduSpellFlagL1() { return eduSpellFlagL1; } - public void setDed(Indicator eduSpellFlag) { + public void setEduSpellFlag(Indicator eduSpellFlag) { this.eduSpellFlag = eduSpellFlag; } - public void setDed_lag1(Indicator eduSpellFlagL1) { + public void setEduSpellFlagL1(Indicator eduSpellFlagL1) { this.eduSpellFlagL1 = eduSpellFlagL1; } @@ -4997,15 +4997,15 @@ public int getNonwork() { return (Les_c4.NotEmployed.equals(labC4)) ? 1 : 0; } - public int getEmployed_Lag1() { + public int getEmployedFlagL1() { return (Les_c4.EmployedOrSelfEmployed.equals(labC4L1)) ? 1 : 0; } - public int getNonwork_Lag1() { + public int getNonworkFlagL1() { return (Les_c4.NotEmployed.equals(labC4L1)) ? 1 : 0; } - public void setRegionLocal(Region region) { + public void setI_demRgn(Region region) { i_demRgn = region; } @@ -5023,7 +5023,7 @@ public void setRegion(Region region) { this.benefitUnit.setRegion(region); } - public HouseholdStatus getHousehold_status_lag() { + public HouseholdStatus getDemStatusHhL1() { return demStatusHhL1; } @@ -5170,7 +5170,7 @@ public double getGrossEarningsYearly() { } public int getAtRiskOfPoverty() { - return benefitUnit.getAtRiskOfPoverty(); + return benefitUnit.getYPvrtyFlag(); } public double getLabWageFullTimeHrly() { @@ -5185,15 +5185,15 @@ public double getYWageDesired() { return yWageDesired; } - public Dhe getDhe() { + public Dhe getHealthSelfRated() { return healthSelfRated; } - public void setDhe(Dhe health) { + public void setHealthSelfRated(Dhe health) { this.healthSelfRated = health; } - public double getDheValue() { + public double getHealthSelfRatedValue() { return (double) healthSelfRated.getValue(); } public double getHealthWbScore0to36() { @@ -5279,18 +5279,18 @@ public void populateSocialCareReceipt_lag1(SocialCareReceiptState state) { } } - public void setSocialCareFromOther(boolean val) { + public void setCareFromInformalFlag(boolean val) { careFromInformalFlag = val; } - public void setCareHoursFromOtherWeekly_lag1(double val) { + public void setCareHrsInformalWeekL1(double val) { careHrsInformalWeekL1 = val; } - public void setCareHoursFromFormalWeekly_lag1(double val) { + public void setCareHrsFormalWeekL1(double val) { careHrsFormalWeekL1 = val; } - public void setSocialCareProvision_lag1(Indicator careProvision) { + public void setCareProvidedFlagL1(Indicator careProvision) { careProvidedFlagL1 = careProvision; } @@ -5298,7 +5298,7 @@ public void setHealthWbScore0to36(Double healthWbScore0to36) { this.healthWbScore0to36 = healthWbScore0to36; } - public void setDhe_lag1(Dhe health) { + public void setHealthSelfRatedL1(Dhe health) { this.healthSelfRatedL1 = health; } @@ -5314,11 +5314,11 @@ public void setHealthPsyDstrss0to12(Double dhm_ghq) { this.healthPsyDstrss0to12 = dhm_ghq; } - public Ethnicity getDot01() { + public Ethnicity getDemEthnC6() { return demEthnC6; } - public void setDot01(Ethnicity demEthnC6) { + public void setDemEthnC6(Ethnicity demEthnC6) { this.demEthnC6 = demEthnC6; } @@ -5326,31 +5326,31 @@ public boolean getYFinDstrssFlag() { return yFinDstrssFlag; } - public Indicator getNeedSocialCare() { + public Indicator getCareNeedFlag() { return careNeedFlag; } - public void setNeedSocialCare(Indicator careNeedFlag) { + public void setCareNeedFlag(Indicator careNeedFlag) { this.careNeedFlag = careNeedFlag; } - public void setDer(Indicator eduReturnFlag) { + public void setEduReturnFlag(Indicator eduReturnFlag) { this.eduReturnFlag = eduReturnFlag; } - public Indicator getDer() {return eduReturnFlag;} + public Indicator getEduReturnFlag() {return eduReturnFlag;} - public Indicator getSedex() {return eduExitSampleFlag;} + public Indicator getEduExitSampleFlag() {return eduExitSampleFlag;} - public Long getIdOriginalPerson() { + public Long getIdPersOriginal() { return idPersOriginal; } - public Long getIdOriginalBU() { + public Long getIdBuOriginal() { return idBuOriginal; } - public Long getIdOriginalHH() { + public Long getIdHhOriginal() { return idHhOriginal; } @@ -5366,7 +5366,7 @@ public void setClonedFlag(boolean demClonedFlag) { this.demClonedFlag = demClonedFlag; } - public Dcpst getDcpst() { + public Dcpst getDemPartnerStatus() { if (benefitUnit==null) { if (i_demPartnerStatus ==null) throw new RuntimeException("attempt to access unassigned value for dcpstLocal"); @@ -5377,14 +5377,14 @@ public Dcpst getDcpst() { return Dcpst.Single; } - public void setDcpstLocal(Dcpst demPartnerStatus) { + public void setI_demPartnerStatus(Dcpst demPartnerStatus) { this.i_demPartnerStatus = demPartnerStatus; } - public Indicator getDlltsd() { + public Indicator getHealthDsblLongtermFlag() { return healthDsblLongtermFlag; } - public void setDlltsd(Indicator healthDsblLongtermFlag) { + public void setHealthDsblLongtermFlag(Indicator healthDsblLongtermFlag) { this.healthDsblLongtermFlag = healthDsblLongtermFlag; } @@ -5396,15 +5396,15 @@ public void setSocialCareProvision(Indicator provide) { careProvidedFlag = provide; } - public Indicator getDlltsd_lag1() { + public Indicator getHealthDsblLongtermFlagL1() { return healthDsblLongtermFlagL1; } - public void setDlltsd_lag1(Indicator healthDsblLongtermFlagL1) { + public void setHealthDsblLongtermFlagL1(Indicator healthDsblLongtermFlagL1) { this.healthDsblLongtermFlagL1 = healthDsblLongtermFlagL1; } - public void setSedex(Indicator eduExitSampleFlag) { + public void setEduExitSampleFlag(Indicator eduExitSampleFlag) { this.eduExitSampleFlag = eduExitSampleFlag; } @@ -5432,7 +5432,7 @@ public void setDemPartnerNYear(Integer demPartnerNYear) { this.demPartnerNYear = demPartnerNYear; } - public Integer getDcpagdf() { + public Integer getDemAgePartnerDiff() { Person partner = getPartner(); if (partner!=null) return (demAge - partner.demAge); @@ -5440,65 +5440,65 @@ public Integer getDcpagdf() { return null; } - public Double getyNonBenPersGrossMonth() { + public Double getYNonBenPersGrossMonth() { return yNonBenPersGrossMonth; } - public void setyNonBenPersGrossMonth(Double val) { + public void setYNonBenPersGrossMonth(Double val) { yNonBenPersGrossMonth = val; } - public Double getyNonBenPersGrossMonthL1() { + public Double getYNonBenPersGrossMonthL1() { return yNonBenPersGrossMonthL1; } - public Double getyMiscPersGrossMonth() { + public Double getYMiscPersGrossMonth() { return yMiscPersGrossMonth; } - public Double getyCapitalPersMonth() { + public Double getYCapitalPersMonth() { return yCapitalPersMonth; } - public Double getyPensPersGrossMonth() { + public Double getYPensPersGrossMonth() { return yPensPersGrossMonth; } - public void setYptciihs_dv(double yMiscPersGrossMonth) { + public void setYMiscPersGrossMonth(double yMiscPersGrossMonth) { this.yMiscPersGrossMonth = yMiscPersGrossMonth; if (!Parameters.checkFinite(this.yMiscPersGrossMonth)) - throw new IllegalArgumentException("yptciihs_dv is not finite"); + throw new IllegalArgumentException("yMiscPersGrossMonth is not finite"); } - public Double getyMiscPersGrossMonthL1() { + public Double getYMiscPersGrossMonthL1() { return yMiscPersGrossMonthL1; } - public double getyEmpPersGrossMonth() { + public double getYEmpPersGrossMonth() { return (yEmpPersGrossMonth !=null) ? yEmpPersGrossMonth : 0.0; } - public void setyEmpPersGrossMonth(double val) { + public void setYEmpPersGrossMonth(double val) { yEmpPersGrossMonth = val; } - public double getyEmpPersGrossMonthL1() { + public double getYEmpPersGrossMonthL1() { return yEmpPersGrossMonthL1; } - public double getyEmpPersGrossMonthL2() { + public double getYEmpPersGrossMonthL2() { return yEmpPersGrossMonthL2; } - public double getyEmpPersGrossMonthL3() { + public double getYEmpPersGrossMonthL3() { return yEmpPersGrossMonthL3; } - public Double getYnbcpdf_dv_lag1() { + public Double getYPersAndPartnerGrossDiffMonthL1() { return yPersAndPartnerGrossDiffMonthL1; } - public Lesdf_c4 getLesdf_c4() { + public Lesdf_c4 getLabStatusPartnerAndOwnC4() { if (benefitUnit.getCoupleBoolean() && demAge >=Parameters.AGE_TO_BECOME_RESPONSIBLE) { if (getPartner()==null) throw new RuntimeException("inconsistency between couple and partner identifiers"); @@ -5514,31 +5514,31 @@ else if (Les_c4.EmployedOrSelfEmployed.equals(getPartner().labC4)) return null; } - public Lesdf_c4 getLesdf_c4_lag1() { + public Lesdf_c4 getLabStatusPartnerAndOwnC4L1() { return labStatusPartnerAndOwnC4L1; } - public void setLes_c4_lag1(Les_c4 labC4L1) { + public void setLabC4L1(Les_c4 labC4L1) { this.labC4L1 = labC4L1; } - public void setLesdf_c4_lag1(Lesdf_c4 labStatusPartnerAndOwnC4L1) { + public void setLabStatusPartnerAndOwnC4L1(Lesdf_c4 labStatusPartnerAndOwnC4L1) { this.labStatusPartnerAndOwnC4L1 = labStatusPartnerAndOwnC4L1; } - public void setYpnbihs_dv_lag1(Double val) { + public void setYNonBenPersGrossMonthL1(Double val) { yNonBenPersGrossMonthL1 = val; } - public void setDehsp_c4_lag1(Education eduHighestPartnerC4L1) { + public void setEduHighestPartnerC4L1(Education eduHighestPartnerC4L1) { this.eduHighestPartnerC4L1 = eduHighestPartnerC4L1; } - public void setDhesp_lag1(Dhe healthPartnerSelfRatedL1) { + public void setHealthPartnerSelfRatedL1(Dhe healthPartnerSelfRatedL1) { this.healthPartnerSelfRatedL1 = healthPartnerSelfRatedL1; } - public void setYnbcpdf_dv_lag1(Double val) { + public void setYPersAndPartnerGrossDiffMonthL1(Double val) { yPersAndPartnerGrossDiffMonthL1 = val; } @@ -5546,11 +5546,11 @@ public void setDemPartnerNYearL1(Integer demPartnerNYearL1) { this.demPartnerNYearL1 = demPartnerNYearL1; } - public void setDcpagdf_lag1(Integer demAgePartnerDiffL1) { + public void setDemAgePartnerDiffL1(Integer demAgePartnerDiffL1) { this.demAgePartnerDiffL1 = demAgePartnerDiffL1; } - public void setDcpst_lag1(Dcpst demPartnerStatusL1) { + public void setDemPartnerStatusL1(Dcpst demPartnerStatusL1) { this.demPartnerStatusL1 = demPartnerStatusL1; } @@ -5630,7 +5630,7 @@ public Integer getLabHrsWorkNewL1() { return labHrsWorkNewL1; } - public void setNewWorkHours_lag1(Integer labHrsWorkNewL1) { + public void setLabHrsWorkNewL1(Integer labHrsWorkNewL1) { this.labHrsWorkNewL1 = labHrsWorkNewL1; } @@ -5678,7 +5678,7 @@ public boolean isReceivesBenefitsFlag_L1() { return (yBenReceivedFlagL1 !=null) ? yBenReceivedFlagL1 : false; } - public void setReceivesBenefitsFlag_L1(boolean yBenReceivedFlagL1) { + public void setYBenReceivedFlagL1(boolean yBenReceivedFlagL1) { this.yBenReceivedFlagL1 = yBenReceivedFlagL1; } @@ -5694,7 +5694,7 @@ public boolean isReceivesBenefitsFlagUC_L1() { return (null != yBenUCReceivedFlagL1) ? yBenUCReceivedFlagL1 : false; } - public void setReceivesBenefitsFlagUC_L1(boolean yBenUCReceivedFlagL1) { + public void setYBenUCReceivedFlagL1(boolean yBenUCReceivedFlagL1) { this.yBenUCReceivedFlagL1 = yBenUCReceivedFlagL1; } @@ -5710,7 +5710,7 @@ public boolean isReceivesBenefitsFlagNonUC_L1() { return (null != yBenNonUCReceivedFlagL1) ? yBenNonUCReceivedFlagL1 : false; } - public void setReceivesBenefitsFlagNonUC_L1(boolean yBenNonUCReceivedFlagL1) { + public void setYBenNonUCReceivedFlagL1(boolean yBenNonUCReceivedFlagL1) { this.yBenNonUCReceivedFlagL1 = yBenNonUCReceivedFlagL1; } @@ -5731,7 +5731,7 @@ public double getWageOffer() { } public int getDisability() { - return (Indicator.True.equals(getDlltsd())) ? 1 : 0; + return (Indicator.True.equals(getHealthDsblLongtermFlag())) ? 1 : 0; } public SocialCareReceipt getSocialCareReceipt() { @@ -5774,10 +5774,10 @@ public Indicator getSocialCareProvision() { } public double getRetired() { - return (Les_c4.Retired.equals(getLes_c4())) ? 1.0 : 0.0; + return (Les_c4.Retired.equals(getLabC4())) ? 1.0 : 0.0; } - public void setYearLocal(Integer i_demYear) { + public void setI_demYear(Integer i_demYear) { this.i_demYear = i_demYear; } @@ -5799,18 +5799,18 @@ private int getStartYear() { } } - public void setNumberChildren017Local(Integer nbr) { + public void setI_demNchild0to17(Integer nbr) { i_demNchild0to17 = nbr; } - public void setIndicatorChildren02Local(Indicator idctr) { + public void setI_demNChild0to2(Indicator idctr) { i_demNChild0to2 = idctr; } - private Ydses_c5 getYdses_c5_lag1() { + private Ydses_c5 getYHhQuintilesMonthC5L1() { if (model!=null) { if (benefitUnit==null) throw new RuntimeException("attempt to access unassigned benefit unit"); - return benefitUnit.getYdses_c5_lag1(); + return benefitUnit.getYHhQuintilesMonthC5L1(); } else { if (i_yHhQuintilesC5 ==null) throw new RuntimeException("attempt to access unassigned ydses_c5_lag1Local"); @@ -5818,11 +5818,11 @@ private Ydses_c5 getYdses_c5_lag1() { } } - private Ydses_c5 getYdses_c5_current() { + private Ydses_c5 getYHhQuintilesMonthC5Current() { if (model != null) { if (benefitUnit == null) throw new RuntimeException("attempt to access unassigned benefit unit"); - return benefitUnit.getYdses_c5(); + return benefitUnit.getYHhQuintilesMonthC5(); } else { if (i_yHhQuintilesC5 == null) throw new RuntimeException("attempt to access unassigned ydses_c5Local"); @@ -5850,15 +5850,15 @@ public void setI_demCompHhC4L1(Dhhtp_c4 demCompHhC4L1) { i_demCompHhC4L1 = demCompHhC4L1; } - private Integer getNumberChildrenAll_lag1() { + private Integer getNumberChildrenAllL1() { if (benefitUnit != null) { - return (benefitUnit.getNumberChildrenAll_lag1() != null) ? benefitUnit.getNumberChildrenAll_lag1() : 0; + return (benefitUnit.getNumberChildrenAllL1() != null) ? benefitUnit.getNumberChildrenAllL1() : 0; } else { return (i_demNchildL1 ==null) ? 0 : i_demNchildL1; } } - public void setNumberChildrenAllLocal(Integer nbr) { + public void setI_demNchild(Integer nbr) { i_demNchild = nbr; } @@ -5874,19 +5874,19 @@ private Integer getNumberChildrenAll() { } } - public void setNumberChildrenAllLocal_lag1(Integer nbr) { + public void setI_demNchildL1(Integer nbr) { i_demNchildL1 = nbr; } - public void setNumberChildren02Local_lag1(Integer nbr) { + public void setI_demNchild0to2L1(Integer nbr) { i_demNchild0to2L1 = nbr; } - private Integer getNumberChildren02_lag1() { + private Integer getNumberChildren02L1() { if (model != null) { if (benefitUnit==null) throw new RuntimeException("attempt to access unassigned benefit unit"); - return (benefitUnit.getNumberChildren02_lag1() != null) ? benefitUnit.getNumberChildren02_lag1() : 0; + return (benefitUnit.getNumberChildren02L1() != null) ? benefitUnit.getNumberChildren02L1() : 0; } else { if (i_demNchild0to2L1 ==null) throw new RuntimeException("attempt to access unassigned numberChildren02Local_lag1"); @@ -6181,7 +6181,7 @@ else if (getStudent()==0) return RegressionName.PartnershipU1; } case SocialCareProvision -> { - if (Dcpst.Partnered.equals(getDcpst())) + if (Dcpst.Partnered.equals(getDemPartnerStatus())) return RegressionName.SocialCareS3b; else return RegressionName.SocialCareS3a; @@ -6228,8 +6228,8 @@ private Double gethealthPsyDstrss_lag1() { public Double getYnbcpdf_dv() { Person partner = getPartner(); if (partner != null) { - if (partner.getyNonBenPersGrossMonth() != null && getyNonBenPersGrossMonth() != null) - return getyNonBenPersGrossMonth() - partner.getyNonBenPersGrossMonth(); + if (partner.getYNonBenPersGrossMonth() != null && getYNonBenPersGrossMonth() != null) + return getYNonBenPersGrossMonth() - partner.getYNonBenPersGrossMonth(); } return null; } diff --git a/src/main/java/simpaths/model/SimPathsModel.java b/src/main/java/simpaths/model/SimPathsModel.java index 30faf4924..173cbdd89 100644 --- a/src/main/java/simpaths/model/SimPathsModel.java +++ b/src/main/java/simpaths/model/SimPathsModel.java @@ -1485,16 +1485,16 @@ private void healthAlignment() { @Override public boolean getOutcome(Person agent) { - return agent.getDhe() == 1.; //TODO: Check the new continuous health status + return agent.getHealthSelfRated() == 1.; //TODO: Check the new continuous health status } @Override public void resample(Person agent) { //Swap health status - if (agent.getDhe() > 1.) { - agent.setDhe(1.); + if (agent.getHealthSelfRated() > 1.) { + agent.setHealthSelfRated(1.); } else { - agent.setDhe(3.); //TODO: What numerical value should correspond to "good" health? + agent.setHealthSelfRated(3.); //TODO: What numerical value should correspond to "good" health? } } @@ -1559,7 +1559,7 @@ private void unionMatchingSBAM() { String tmpKeyString = gender + " " + region + " " + education + " " + ageGroup; //MultiKey defined above, but for most methods we use a composite String key instead as MultiKeyMap has a limit of keys for (Person person : tmpPersonsSet) { - if (person.getDeh_c4().equals(education) && person.getDemAgeGroup() == ageGroup) tmpPersonsSet2.add(person); //If education level matches add person to the set + if (person.getEduHighestC4().equals(education) && person.getDemAgeGroup() == ageGroup) tmpPersonsSet2.add(person); //If education level matches add person to the set } personsToMatch2.put(tmpKeyString, tmpPersonsSet2); //Add a key and set of people to set of persons to match. Each key corresponds to a set of people of certain Gender, Region, and Education who want to match @@ -2197,12 +2197,12 @@ private void employmentAlignment() { new AlignmentOutcomeClosure() { @Override public boolean getOutcome(Person person) { - return person.getLes_c4().equals(Les_c4.EmployedOrSelfEmployed); + return person.getLabC4().equals(Les_c4.EmployedOrSelfEmployed); } @Override public void resample(Person person) { - person.setLes_c4(Les_c4.NotEmployed); + person.setLabC4(Les_c4.NotEmployed); person.setLabourSupplyWeekly(Labour.ZERO); } }, @@ -2354,10 +2354,10 @@ private void educationLevelAlignment() { for(Person person : persons) { if( person.getDemMaleFlag().equals(gender) && person.getDemAge() >= 16 && person.getDemAge() <= 45) { //Alignment projections are based only on persons younger than 66 years old if (person.isToLeaveSchool()) { //Align only people leaving school? - if(person.getDeh_c4() != null) { - if (person.getDeh_c4().equals(Education.Low)) { + if(person.getEduHighestC4() != null) { + if (person.getEduHighestC4().equals(Education.Low)) { numPersonsOfThisGenderWithLowEduPreAlignment++; - } else if (person.getDeh_c4().equals(Education.High)) { + } else if (person.getEduHighestC4().equals(Education.High)) { numPersonsOfThisGenderWithHighEduPreAlignment++; } numPersonsOfThisGender++; @@ -2388,7 +2388,7 @@ private void educationLevelAlignment() { int countHigh = 0, countLow = 0; for(Person schoolLeaver : personsLeavingEducation.get(gender)) { //This tries to maintain the naturally generated number of school-leavers with medium education, so that an increase in the number of school-leavers with high education is achieved through a reduction in the number of school-leavers with low education. However, in the event that the number of school-leavers with either high or medium education are more than the total number of school leavers (in this year), we end up having no school leavers with low education and we have to reduce the number of school leavers with medium education - if (schoolLeaver.getDeh_c4().equals(Education.Medium)) { + if (schoolLeaver.getEduHighestC4().equals(Education.Medium)) { if(numPersonsOfThisGenderWithHighEduPreAlignment + countHigh < numPersonsWithHighEduAlignmentTarget) { //Only align if number of people in population with high education is too low. schoolLeaver.setEducation(Education.High); //As the personsLeavingEducation list is sorted by descending age, the oldest people leaving education are assigned to have high education levels countHigh++; @@ -2396,12 +2396,12 @@ private void educationLevelAlignment() { schoolLeaver.setEducation(Education.Low); //When the number of high education level people have been assigned, the next oldest people are assigned to have medium education levels countLow++; } - } else if (schoolLeaver.getDeh_c4().equals(Education.High)) { + } else if (schoolLeaver.getEduHighestC4().equals(Education.High)) { if (numPersonsOfThisGenderWithHighEduPreAlignment + countHigh > numPersonsWithHighEduAlignmentTarget) { //If too many people with high education schoolLeaver.setEducation(Education.Medium); countHigh--; } - } else if (schoolLeaver.getDeh_c4().equals(Education.Low)) { + } else if (schoolLeaver.getEduHighestC4().equals(Education.Low)) { if (numPersonsOfThisGenderWithLowEduPreAlignment + countLow > numPersonsWithLowEduAlignmentTarget) { schoolLeaver.setEducation(Education.Medium); countLow--; @@ -2418,10 +2418,10 @@ private void educationLevelAlignment() { for(Person person : persons) { if( person.getDemMaleFlag().equals(gender) && (person.getDemAge() <= 65) ) { //Alignment projections are based only on persons younger than 66 years old if (person.isToLeaveSchool()) { - if(person.getDeh_c4() != null) { - if(person.getDeh_c4().equals(Education.High)) { + if(person.getEduHighestC4() != null) { + if(person.getEduHighestC4().equals(Education.High)) { countHighEdPeople++; - } else if(person.getDeh_c4().equals(Education.Medium)) { + } else if(person.getEduHighestC4().equals(Education.Medium)) { countMediumEdPeople++; } } diff --git a/src/main/java/simpaths/model/annotations/Lag.java b/src/main/java/simpaths/model/annotations/Lag.java index 56d89b945..ee6d31e59 100644 --- a/src/main/java/simpaths/model/annotations/Lag.java +++ b/src/main/java/simpaths/model/annotations/Lag.java @@ -39,7 +39,7 @@ * @Lag(field = "yEmpPersGrossMonthL1") * private Double yEmpPersGrossMonthL2; * - * @Lag(getter = "getyEmpPersGrossMonth") + * @Lag(getter = "getYEmpPersGrossMonth") * private Double yEmpPersGrossMonthL1; * } * diff --git a/src/main/java/simpaths/model/decisions/Expectations.java b/src/main/java/simpaths/model/decisions/Expectations.java index 40c342ff3..7f54778ed 100644 --- a/src/main/java/simpaths/model/decisions/Expectations.java +++ b/src/main/java/simpaths/model/decisions/Expectations.java @@ -98,9 +98,9 @@ public Expectations(States currentStates) { // proxy to evaluate regression projections for current period benefitUnitProxyThisPeriod = new BenefitUnit(true); - benefitUnitProxyThisPeriod.setYearLocal(currentStates.getYear()); - benefitUnitProxyThisPeriod.setOccupancyLocal(currentStates.getOccupancyCode()); - benefitUnitProxyThisPeriod.setDeh_c4Local(currentStates.getEducationCode()); + benefitUnitProxyThisPeriod.setI_demYear(currentStates.getYear()); + benefitUnitProxyThisPeriod.setI_demOccupancy(currentStates.getOccupancyCode()); + benefitUnitProxyThisPeriod.setI_eduHighestC4(currentStates.getEducationCode()); benefitUnitProxyThisPeriod.setRegion(currentStates.getRegionCode()); } @@ -170,53 +170,53 @@ public Expectations(Expectations invariantExpectations) { // add new data for within period regression specifications personProxyThisPeriod = new Person(true); personProxyThisPeriod.setDemAge(ageYearsThisPeriod); - personProxyThisPeriod.setRegionLocal(currentStates.getRegionCode()); + personProxyThisPeriod.setI_demRgn(currentStates.getRegionCode()); personProxyThisPeriod.setDemMaleFlag(currentStates.getGenderCode()); - personProxyThisPeriod.setDhe(currentStates.getHealthCode()); - personProxyThisPeriod.setDeh_c4(currentStates.getEducationCode()); - personProxyThisPeriod.setDcpstLocal(currentStates.getDcpst()); + personProxyThisPeriod.setHealthSelfRated(currentStates.getHealthCode()); + personProxyThisPeriod.setEduHighestC4(currentStates.getEducationCode()); + personProxyThisPeriod.setI_demPartnerStatus(currentStates.getDcpst()); personProxyThisPeriod.setSocialCareProvision(currentStates.getSocialCareProvisionState()); personProxyThisPeriod.populateSocialCareReceipt(currentStates.getSocialCareReceiptStateCode()); // add person proxy for next period expectations personProxyNextPeriod = new Person(true); - personProxyNextPeriod.setYearLocal(currentStates.getYearByAge(ageYearsNextPeriod)); + personProxyNextPeriod.setI_demYear(currentStates.getYearByAge(ageYearsNextPeriod)); personProxyNextPeriod.setI_demCompHhC4L1(currentStates.getHouseholdTypeCode()); personProxyNextPeriod.setI_yHhQuintilesC5(Ydses_c5.Q3); - personProxyNextPeriod.setNumberChildrenAllLocal_lag1(currentStates.getChildrenAll()); - personProxyNextPeriod.setNumberChildrenAllLocal(currentStates.getChildrenAll()); - personProxyNextPeriod.setNumberChildren02Local_lag1(currentStates.getChildren02()); + personProxyNextPeriod.setI_demNchildL1(currentStates.getChildrenAll()); + personProxyNextPeriod.setI_demNchild(currentStates.getChildrenAll()); + personProxyNextPeriod.setI_demNchild0to2L1(currentStates.getChildren02()); personProxyNextPeriod.setDemAge(ageYearsNextPeriod); - personProxyNextPeriod.setRegionLocal(currentStates.getRegionCode()); + personProxyNextPeriod.setI_demRgn(currentStates.getRegionCode()); personProxyNextPeriod.setDemMaleFlag(currentStates.getGenderCode()); - personProxyNextPeriod.setDlltsd(currentStates.getDlltsd()); - personProxyNextPeriod.setDlltsd_lag1(currentStates.getDlltsd()); - personProxyNextPeriod.setDhe(currentStates.getHealthCode()); - personProxyNextPeriod.setDhe_lag1(currentStates.getHealthCode()); + personProxyNextPeriod.setHealthDsblLongtermFlag(currentStates.getDlltsd()); + personProxyNextPeriod.setHealthDsblLongtermFlagL1(currentStates.getDlltsd()); + personProxyNextPeriod.setHealthSelfRated(currentStates.getHealthCode()); + personProxyNextPeriod.setHealthSelfRatedL1(currentStates.getHealthCode()); personProxyNextPeriod.populateSocialCareReceipt_lag1(currentStates.getSocialCareReceiptStateCode()); - personProxyNextPeriod.setSocialCareProvision_lag1(currentStates.getSocialCareProvisionState()); - personProxyNextPeriod.setDed(currentStates.getStudentIndicator()); - personProxyNextPeriod.setDeh_c4(currentStates.getEducationCode()); - personProxyNextPeriod.setDeh_c4_lag1(currentStates.getEducationCode()); - personProxyNextPeriod.setDehf_c4(DecisionParams.EDUCATION_FATHER); - personProxyNextPeriod.setDehm_c4(DecisionParams.EDUCATION_MOTHER); + personProxyNextPeriod.setCareProvidedFlagL1(currentStates.getSocialCareProvisionState()); + personProxyNextPeriod.setEduSpellFlag(currentStates.getStudentIndicator()); + personProxyNextPeriod.setEduHighestC4(currentStates.getEducationCode()); + personProxyNextPeriod.setEduHighestC4L1(currentStates.getEducationCode()); + personProxyNextPeriod.setEduHighestFatherC4(DecisionParams.EDUCATION_FATHER); + personProxyNextPeriod.setEduHighestMotherC4(DecisionParams.EDUCATION_MOTHER); if (ageYearsNextPeriod <= DecisionParams.MAX_AGE_COHABITATION) { - personProxyNextPeriod.setDcpstLocal(currentStates.getDcpst()); + personProxyNextPeriod.setI_demPartnerStatus(currentStates.getDcpst()); } else { if (currentStates.getDcpst().equals(Dcpst.Partnered)) - personProxyNextPeriod.setDcpstLocal(Dcpst.Single); + personProxyNextPeriod.setI_demPartnerStatus(Dcpst.Single); else - personProxyNextPeriod.setDcpstLocal(Dcpst.Single); + personProxyNextPeriod.setI_demPartnerStatus(Dcpst.Single); } - personProxyNextPeriod.setDcpst_lag1(currentStates.getDcpst()); + personProxyNextPeriod.setDemPartnerStatusL1(currentStates.getDcpst()); personProxyNextPeriod.setLiwwh((ageYearsNextPeriod - Parameters.AGE_TO_BECOME_RESPONSIBLE) * DecisionParams.MONTHS_EMPLOYED_PER_YEAR); personProxyNextPeriod.setLabWageFullTimeHrlyL1(labWageFullTimeHrly); personProxyNextPeriod.setIoFlag(true); if (cohabitation) { - personProxyNextPeriod.setDehsp_c4_lag1(currentStates.getEducationCode()); - personProxyNextPeriod.setDhesp_lag1(DecisionParams.DEFAULT_HEALTH); + personProxyNextPeriod.setEduHighestPartnerC4L1(currentStates.getEducationCode()); + personProxyNextPeriod.setHealthPartnerSelfRatedL1(DecisionParams.DEFAULT_HEALTH); personProxyNextPeriod.setDemPartnerNYearL1(DecisionParams.DEFAULT_YEARS_MARRIED); - personProxyNextPeriod.setDcpagdf_lag1(DecisionParams.DEFAULT_AGE_DIFFERENCE); + personProxyNextPeriod.setDemAgePartnerDiffL1(DecisionParams.DEFAULT_AGE_DIFFERENCE); } } @@ -329,11 +329,11 @@ public void updateForDiscreteControls(double emp1Pr, double emp2Pr) { } // non-discretionary expenditure - benefitUnitProxyThisPeriod.setLabourHoursWeekly1Local(labourHours1Weekly); + benefitUnitProxyThisPeriod.setI_labHrsWork1Week(labourHours1Weekly); if (cohabitation) { - benefitUnitProxyThisPeriod.setLabourHoursWeekly2Local(labourHours2Weekly); + benefitUnitProxyThisPeriod.setI_labHrsWork2Week(labourHours2Weekly); } else { - benefitUnitProxyThisPeriod.setLabourHoursWeekly2Local(null); + benefitUnitProxyThisPeriod.setI_labHrsWork2Week(null); } double childcareCostAnnual = evalChildcareCostWeekly() * Parameters.WEEKS_PER_YEAR; double socialCareCostAnnual = evalSocialCareCostWeekly() * Parameters.WEEKS_PER_YEAR; @@ -365,16 +365,16 @@ public void updateForDiscreteControls(double emp1Pr, double emp2Pr) { if (ageYearsNextPeriod <= DecisionParams.maxAge) { // update objects for interaction with regression models - personProxyNextPeriod.setLes_c4_lag1(currentStates.getLesCode(emp1Pr)); - personProxyNextPeriod.setLesdf_c4_lag1(currentStates.getLesC4Code(emp1Pr, emp2Pr)); - personProxyNextPeriod.setYpnbihs_dv_lag1( + personProxyNextPeriod.setLabC4L1(currentStates.getLesCode(emp1Pr)); + personProxyNextPeriod.setLabStatusPartnerAndOwnC4L1(currentStates.getLesC4Code(emp1Pr, emp2Pr)); + personProxyNextPeriod.setYNonBenPersGrossMonthL1( asinh(labourIncome1Weekly*Parameters.WEEKS_PER_MONTH + (investmentIncome1Annual + pensionIncome1Annual) / 12.0)); if (cohabitation) { - personProxyNextPeriod.setYnbcpdf_dv_lag1( + personProxyNextPeriod.setYPersAndPartnerGrossDiffMonthL1( asinh(labourIncome1Weekly*Parameters.WEEKS_PER_MONTH + (investmentIncome1Annual + pensionIncome1Annual) / 12.0) - asinh(labourIncome2Weekly*Parameters.WEEKS_PER_MONTH + (investmentIncome2Annual + pensionIncome2Annual) / 12.0) ); } else { - personProxyNextPeriod.setYnbcpdf_dv_lag1(0.0); + personProxyNextPeriod.setYPersAndPartnerGrossDiffMonthL1(0.0); } // instantiate expectations factory diff --git a/src/main/java/simpaths/model/decisions/ExpectationsFactory.java b/src/main/java/simpaths/model/decisions/ExpectationsFactory.java index 18811a9a5..684b8f5cd 100644 --- a/src/main/java/simpaths/model/decisions/ExpectationsFactory.java +++ b/src/main/java/simpaths/model/decisions/ExpectationsFactory.java @@ -81,7 +81,7 @@ public void updateRegion() { for (int ii = 0; ii < numberExpected; ii++) { anticipated[ii].labStatesContObject[stateIndexNextPeriod] = currentStates.labStatesContObject[stateIndexCurrPeriod]; } - personProxyNextPeriod.setRegionLocal(currentStates.getRegionCode()); + personProxyNextPeriod.setI_demRgn(currentStates.getRegionCode()); } public void updateRetirement(boolean retiring) { @@ -308,7 +308,7 @@ private LocalExpectations lexpectEval(Axis axis) { lexpectations = compileSocialCareReceiptProbs(); } else if (Axis.SocialCareProvision.equals(axis)) { - if (Dcpst.Partnered.equals(personProxyNextPeriod.getDcpst())) + if (Dcpst.Partnered.equals(personProxyNextPeriod.getDemPartnerStatus())) lexpectations.evaluateDiscrete(personProxyNextPeriod, personProxyNextPeriod.getRegressionName(axis)); else lexpectations.evaluateDiscrete(personProxyNextPeriod, personProxyNextPeriod.getRegressionName(axis)); @@ -428,17 +428,17 @@ private boolean updatePersonNextPeriod(States states, Axis axis) { val0 = personProxyNextPeriod.getRegion(); val1 = states.getRegionCode(); } else if (Axis.Education.equals(axis)) { - val0 = personProxyNextPeriod.getDeh_c4(); + val0 = personProxyNextPeriod.getEduHighestC4(); val1 = states.getEducationCode(); if (val0==val1) { - val0 = personProxyNextPeriod.getDed(); + val0 = personProxyNextPeriod.getEduSpellFlag(); val1 = states.getStudentIndicator(); } } else if (Axis.Health.equals(axis)) { - val0 = personProxyNextPeriod.getDhe(); + val0 = personProxyNextPeriod.getHealthSelfRated(); val1 = states.getHealthCode(); } else if (Axis.Disability.equals(axis)) { - val0 = personProxyNextPeriod.getDlltsd(); + val0 = personProxyNextPeriod.getHealthDsblLongtermFlag(); val1 = states.getDlltsd(); } else if (Axis.SocialCareReceipt.equals(axis)) { val0 = personProxyNextPeriod.getSocialCareReceipt(); @@ -447,7 +447,7 @@ private boolean updatePersonNextPeriod(States states, Axis axis) { val0 = personProxyNextPeriod.getSocialCareProvision(); val1 = states.getSocialCareProvisionState(); } else if (Axis.Cohabitation.equals(axis)) { - val0 = personProxyNextPeriod.getDcpst(); + val0 = personProxyNextPeriod.getDemPartnerStatus(); val1 = states.getDcpst(); } else if (Axis.Child.equals(axis)) { val0 = personProxyNextPeriod.getNumberChildren017Local(); @@ -469,22 +469,22 @@ private boolean updatePersonNextPeriod(States states, Axis axis) { if (Axis.Region.equals(axis)) { personProxyNextPeriod.setRegion(states.getRegionCode()); } else if (Axis.Education.equals(axis)) { - personProxyNextPeriod.setDeh_c4(states.getEducationCode()); - personProxyNextPeriod.setDed(states.getStudentIndicator()); + personProxyNextPeriod.setEduHighestC4(states.getEducationCode()); + personProxyNextPeriod.setEduSpellFlag(states.getStudentIndicator()); } else if (Axis.Health.equals(axis)) { - personProxyNextPeriod.setDhe(states.getHealthCode()); + personProxyNextPeriod.setHealthSelfRated(states.getHealthCode()); } else if (Axis.Disability.equals(axis)) { - personProxyNextPeriod.setDlltsd(states.getDlltsd()); + personProxyNextPeriod.setHealthDsblLongtermFlag(states.getDlltsd()); } else if (Axis.SocialCareReceipt.equals(axis)) { personProxyNextPeriod.setSocialCareReceipt(states.getSocialCareReceiptCode()); } else if (Axis.SocialCareProvision.equals(axis)) { personProxyNextPeriod.setSocialCareProvision(states.getSocialCareProvisionState()); } else if (Axis.Cohabitation.equals(axis)) { - personProxyNextPeriod.setDcpstLocal(states.getDcpst()); + personProxyNextPeriod.setI_demPartnerStatus(states.getDcpst()); } else if (Axis.Child.equals(axis)) { - personProxyNextPeriod.setNumberChildren017Local(states.getChildren017()); - personProxyNextPeriod.setIndicatorChildren02Local(states.getChildrenUnder3Indicator()); - personProxyNextPeriod.setNumberChildrenAllLocal(states.getChildren017()); + personProxyNextPeriod.setI_demNchild0to17(states.getChildren017()); + personProxyNextPeriod.setI_demNChild0to2(states.getChildrenUnder3Indicator()); + personProxyNextPeriod.setI_demNchild(states.getChildren017()); } } return changed; @@ -570,8 +570,8 @@ private void expandExpectationsFertility(int expandIndex, int stateIndex, int bi // ii = number of previous births for this birth age int birthsHere02 = Math.min(ii + children02, 2); // assume at most 2 children under 3 - personProxyNextPeriod.setNumberChildrenAllLocal_lag1(childrenAll + ii); - personProxyNextPeriod.setNumberChildren02Local_lag1(birthsHere02); + personProxyNextPeriod.setI_demNchildL1(childrenAll + ii); + personProxyNextPeriod.setI_demNchild0to2L1(birthsHere02); double proportionBirths = ManagerRegressions.getProbability(personProxyNextPeriod, regression); probabilities[ii+1] += probabilities[ii] * proportionBirths; probabilities[ii] *= (1 - proportionBirths); @@ -583,8 +583,8 @@ private void expandExpectationsFertility(int expandIndex, int stateIndex, int bi // restore benefitUnit and person characteristics personProxyNextPeriod.setDemAge(ageYearsNextPeriod); - personProxyNextPeriod.setNumberChildrenAllLocal_lag1(childrenAll); - personProxyNextPeriod.setNumberChildren02Local_lag1(children02); + personProxyNextPeriod.setI_demNchildL1(childrenAll); + personProxyNextPeriod.setI_demNchild0to2L1(children02); } private void expandExpectationsAllIndices(int stateIndex, LocalExpectations lexpect) { diff --git a/src/main/java/simpaths/model/taxes/DonorPerson.java b/src/main/java/simpaths/model/taxes/DonorPerson.java index 29dd2f4eb..05db4c912 100644 --- a/src/main/java/simpaths/model/taxes/DonorPerson.java +++ b/src/main/java/simpaths/model/taxes/DonorPerson.java @@ -42,7 +42,7 @@ public long getId() { } public Integer getAge() { return this.age; } public int getHoursWorkedWeekly() { return this.labHrsWorkWeek; } - public int getDlltsd() { return this.healthDsblLongtermFlag; } + public int getHealthDsblLongtermFlag() { return this.healthDsblLongtermFlag; } public int getCarer() { return this.carer; } public double getWeight() { return this.dem; } public Set getPolicies() { return policies; } diff --git a/src/main/java/simpaths/model/taxes/KeyFunction.java b/src/main/java/simpaths/model/taxes/KeyFunction.java index 7a07b945d..0cc15d917 100644 --- a/src/main/java/simpaths/model/taxes/KeyFunction.java +++ b/src/main/java/simpaths/model/taxes/KeyFunction.java @@ -16,7 +16,7 @@ public class KeyFunction { * ATTRIBUTES */ private int simYear = -999, priceYear = -999, age, numberMembersOver17, numberChildrenUnder5, numberChildren5To9, numberChildren10To17; - private int dlltsdMan = -1, dlltsdWoman = -1, careProvision = -1; + private int healthDsblLongtermFlagMan = -1, healthDsblLongtermFlagWoman = -1, careProvision = -1; private double hoursWorkedPerWeekMan, hoursWorkedPerWeekWoman, originalIncomePerWeek, secondIncomePerWeek, xChildCareWeek; // define key function here - switchable @@ -71,8 +71,8 @@ public KeyFunction(int simYear, int priceYear, int age, int numberMembersOver17, this.hoursWorkedPerWeekMan = hoursWorkedPerWeekMan; this.hoursWorkedPerWeekWoman = hoursWorkedPerWeekWoman; this.originalIncomePerWeek = originalIncomePerWeek; - this.dlltsdMan = dlltsdMan; - this.dlltsdWoman = dlltsdWoman; + this.healthDsblLongtermFlagMan = dlltsdMan; + this.healthDsblLongtermFlagWoman = dlltsdWoman; this.careProvision = careProvision; } public KeyFunction(int simYear, int priceYear, int age, int numberMembersOver17, int numberChildrenUnder5, int numberChildren5To9, int numberChildren10To17, @@ -137,20 +137,20 @@ public void setNumberChildren10To17(int numberChildren10To17) { this.numberChildren10To17 = numberChildren10To17; } - public int getDlltsdMan() { - return dlltsdMan; + public int getHealthDsblLongtermFlagMan() { + return healthDsblLongtermFlagMan; } - public void setDlltsdMan(int dlltsdMan) { - this.dlltsdMan = dlltsdMan; + public void setHealthDsblLongtermFlagMan(int healthDsblLongtermFlagMan) { + this.healthDsblLongtermFlagMan = healthDsblLongtermFlagMan; } - public int getDlltsdWoman() { - return dlltsdWoman; + public int getHealthDsblLongtermFlagWoman() { + return healthDsblLongtermFlagWoman; } - public void setDlltsdWoman(int dlltsdWoman) { - this.dlltsdWoman = dlltsdWoman; + public void setHealthDsblLongtermFlagWoman(int healthDsblLongtermFlagWoman) { + this.healthDsblLongtermFlagWoman = healthDsblLongtermFlagWoman; } public int getCareProvision() { @@ -201,9 +201,9 @@ public Integer[] evaluateKeys() { if (keyFunction == null) { throw new InvalidParameterException("call to evaluate donor keys before KeyFunction populated"); } - //return keyFunction.evaluateKeys(simYear, priceYear, age, numberMembersOver17, numberChildrenUnder5, numberChildren5To17, hoursWorkedPerWeekMan, hoursWorkedPerWeekWoman, dlltsdMan, dlltsdWoman, originalIncomePerWeek); + //return keyFunction.evaluateKeys(simYear, priceYear, age, numberMembersOver17, numberChildrenUnder5, numberChildren5To17, hoursWorkedPerWeekMan, hoursWorkedPerWeekWoman, healthDsblLongtermFlagMan, healthDsblLongtermFlagWoman, originalIncomePerWeek); return keyFunction.evaluateKeys(simYear, priceYear, age, numberMembersOver17, numberChildrenUnder5, numberChildren5To9, numberChildren10To17, - hoursWorkedPerWeekMan, hoursWorkedPerWeekWoman, dlltsdMan, dlltsdWoman, careProvision, originalIncomePerWeek, secondIncomePerWeek, xChildCareWeek); + hoursWorkedPerWeekMan, hoursWorkedPerWeekWoman, healthDsblLongtermFlagMan, healthDsblLongtermFlagWoman, careProvision, originalIncomePerWeek, secondIncomePerWeek, xChildCareWeek); } public boolean[] isLowIncome(Integer[] keys) { diff --git a/src/main/java/simpaths/model/taxes/database/TaxDonorDataParser.java b/src/main/java/simpaths/model/taxes/database/TaxDonorDataParser.java index f422706fc..04dfcfccf 100644 --- a/src/main/java/simpaths/model/taxes/database/TaxDonorDataParser.java +++ b/src/main/java/simpaths/model/taxes/database/TaxDonorDataParser.java @@ -704,7 +704,7 @@ public static void populateDonorTaxUnitTables(Country country, boolean showGui) hoursWorkedPerWeek2 = hoursWorked; } if (agePerson >= Parameters.AGE_TO_BECOME_RESPONSIBLE) { - int dlltsd = person.getDlltsd(); + int dlltsd = person.getHealthDsblLongtermFlag(); if (dlltsd > dlltsd1) { dlltsd2 = dlltsd1; dlltsd1 = dlltsd; diff --git a/src/test/java/simpaths/data/filters/EmploymentHistoryFilterTest.java b/src/test/java/simpaths/data/filters/EmploymentHistoryFilterTest.java index 5ea3780f5..741e0aef3 100644 --- a/src/test/java/simpaths/data/filters/EmploymentHistoryFilterTest.java +++ b/src/test/java/simpaths/data/filters/EmploymentHistoryFilterTest.java @@ -14,7 +14,7 @@ private static Person createTestPerson( Les_c4 les_c4_lag1 ) { Person testPerson = new Person(true); - testPerson.setLes_c4_lag1(les_c4_lag1); + testPerson.setLabC4L1(les_c4_lag1); return testPerson; } diff --git a/src/test/java/simpaths/data/statistics/EmploymentStatisticsTest.java b/src/test/java/simpaths/data/statistics/EmploymentStatisticsTest.java index e30a2c668..a20fe1b3c 100644 --- a/src/test/java/simpaths/data/statistics/EmploymentStatisticsTest.java +++ b/src/test/java/simpaths/data/statistics/EmploymentStatisticsTest.java @@ -25,8 +25,8 @@ private static Person createTestPerson( Les_c4 les_c4 ) { Person testPerson = new Person(true); - testPerson.setLes_c4_lag1(les_c4_lag1); - testPerson.setLes_c4(les_c4); + testPerson.setLabC4L1(les_c4_lag1); + testPerson.setLabC4(les_c4); return testPerson; } diff --git a/src/test/java/simpaths/integrationtest/expected/AlignmentAdjustmentFactors1.csv b/src/test/java/simpaths/integrationtest/expected/AlignmentAdjustmentFactors1.csv new file mode 100644 index 000000000..3fedea31d --- /dev/null +++ b/src/test/java/simpaths/integrationtest/expected/AlignmentAdjustmentFactors1.csv @@ -0,0 +1,9 @@ +run,time,id_AlignmentAdjustmentFactors1,empShareSimACFemales,empShareSimACMales,empShareSimCouples,empShareSimSingleDepFemales,empShareSimSingleDepMales,empShareSimSingleFemales,empShareSimSingleMales,empShareTgtACFemales,empShareTgtACMales,empShareTgtCouples,empShareTgtSingleDepFemales,empShareTgtSingleDepMales,empShareTgtSingleFemales,empShareTgtSingleMales,fertilityAdjFactor,fertilityRateSim,fertilityRateTgt,inSchoolAdjFactor,inSchoolShareSim,inSchoolShareTgt,partnershipAdjFactor,shareCohabitingSim,shareCohabitingTgt,utilityAdjACFemales,utilityAdjACMales,utilityAdjCouples,utilityAdjSingleDepFemales,utilityAdjSingleDepMales,utilityAdjSingleFemales,utilityAdjSingleMales +1,2019.0,1,0.5623931623931624,0.5619047619047619,0.8590878148400273,0.3333333333333333,0.44308943089430897,0.43822697265011,0.5445244410761653,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.46535641588110904,0.44388496690103335,0.4705375056413739,-0.279462622342386,0.05029585798816568,0.05113363440615968,0.0,0.281711358843025,0.3023858368396759,-0.613869665517935,0.5387792565396972,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2020.0,1,0.45109780439121755,0.5709090909090909,0.9006958538706872,0.45714285714285713,0.4841628959276018,0.33030646992054485,0.4274735830931796,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.46203656399953613,0.44281420563924695,0.4648045911203806,-0.2659197918000082,0.04835164835164835,0.04996578478889472,0.0,0.28065967016491755,0.2760101854801178,1.594846751573303,0.6270179516983081,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2021.0,1,0.5,0.5580204778156996,0.9200058927519151,0.4869281045751634,0.4924812030075188,0.3886292834890966,0.4849699398797595,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.39809788164553633,0.46415923362147143,0.4451259300414946,0.4776386065456221,-0.25543875103684177,0.04774931609052475,0.04833442666835588,0.0,0.29580911593759557,0.27926552295684814,0.5242473079548589,0.632084035793023,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2022.0,1,0.5407166123778502,0.5965417867435159,0.9326554671382258,0.49188311688311687,0.5,0.42600224803297115,0.5153256704980843,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.45305412911862847,0.5097880138188646,-0.24930347300809638,0.04783875667799903,0.04938041570024613,0.0,0.27308507417499245,0.26489490270614624,-0.19554831088284996,0.614504544587809,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2019.0,1,0.5623931623931624,0.5625990491283677,0.8589656345695815,0.3341584158415842,0.4426229508196721,0.44052863436123346,0.5452823039029936,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.46535641588110904,0.44388496690103335,0.4705375056413739,-0.279462622342386,0.05025868440502587,0.05113363440615968,0.0,0.28154170430593195,0.3023858368396759,-0.613869665517935,0.5392124746118063,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2020.0,1,0.4838709677419355,0.5262206148282098,0.8990526939017169,0.4548611111111111,0.49130434782608695,0.32677016281711474,0.41590800191662675,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.46203656399953613,0.44281420563924695,0.4648045911203806,-0.2659197918000082,0.04886475814412636,0.04996578478889472,0.0,0.283987915407855,0.2760101854801178,1.6228208239181277,0.6251378885211861,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2021.0,1,0.51,0.5457685664939551,0.9157973174366617,0.49032258064516127,0.49809160305343514,0.3954562957258375,0.47687717553455994,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.39809788164553633,0.46415923362147143,0.4451259300414946,0.4776386065456221,-0.25543875103684177,0.047988002999250184,0.04833442666835588,0.0,0.2883906633906634,0.27926552295684814,0.5919873916392584,0.6303542411439714,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2022.0,1,0.5454545454545454,0.5729166666666666,0.9277628835269586,0.49226006191950467,0.5,0.4234034699150978,0.49310508796956726,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.45305412911862847,0.5097880138188646,-0.24930347300809638,0.047920214059839455,0.04938041570024613,0.0,0.28468251579897685,0.26489490270614624,0.008759262125167755,0.6138374387371905,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/EmploymentStatistics1.csv b/src/test/java/simpaths/integrationtest/expected/EmploymentStatistics1.csv index 4a927d9b5..dbdc9d645 100644 --- a/src/test/java/simpaths/integrationtest/expected/EmploymentStatistics1.csv +++ b/src/test/java/simpaths/integrationtest/expected/EmploymentStatistics1.csv @@ -1,9 +1,9 @@ run,time,id_EmploymentStatistics1,labEmpShare,labEmpToNotEmpShare,labNotEmpToEmpShare,labUnempShare -1,2019.0,1,0.7132976533552903,0.0,0.0,0.14985590778097982 -1,2020.0,1,0.718380011431371,0.07804440457501682,0.41068537506745817,0.1511390544623173 -1,2021.0,1,0.754951105267483,0.01866846603688709,0.3838761345435131,0.10781493960062453 -1,2022.0,1,0.7724121251209287,0.026419804451841066,0.3193215339233038,0.10053208642373428 -2,2019.0,1,0.7139321950012373,0.0,0.0,0.14913800214468365 -2,2020.0,1,0.7135108481262328,0.08067605633802817,0.40011007154650524,0.15335305719921105 -2,2021.0,1,0.751134956665291,0.020145686319144093,0.3759239704329461,0.11605447791993397 -2,2022.0,1,0.7650397275822929,0.027392913802221048,0.30921501706484644,0.10653478190368088 \ No newline at end of file +1,2019.0,1,0.712445288628293,0.0,0.0,0.15533900404657694 +1,2020.0,1,0.7198201879852881,0.07584807844021188,0.40958832725377803,0.15243154883530854 +1,2021.0,1,0.7541834968263128,0.019022962629446194,0.39167556029882605,0.10963646855164455 +1,2022.0,1,0.7732375030283453,0.0258098223615465,0.3328488372093023,0.10078333198740208 +2,2019.0,1,0.7128238983330583,0.0,0.0,0.15514111239478462 +2,2020.0,1,0.7117235705471,0.0796871457719338,0.39155672823218995,0.15746606334841629 +2,2021.0,1,0.75,0.017728468489076978,0.37833675564681724,0.11656187954996691 +2,2022.0,1,0.7631877022653721,0.024775962045334738,0.3002754820936639,0.10582524271844661 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/HealthStatistics1.csv b/src/test/java/simpaths/integrationtest/expected/HealthStatistics1.csv index 6337a1b52..229d12c93 100644 --- a/src/test/java/simpaths/integrationtest/expected/HealthStatistics1.csv +++ b/src/test/java/simpaths/integrationtest/expected/HealthStatistics1.csv @@ -1,25 +1,25 @@ run,time,id_HealthStatistics1,demLifeSatScore0to10Avg,demLifeSatScore0to10P10,demLifeSatScore0to10P25,demLifeSatScore0to10P50,demLifeSatScore0to10P75,demLifeSatScore0to10P90,demSex,healthLifeYearQualAdj,healthLifeYearWbAdj,healthMentalMcsAvg,healthMentalMcsP10,healthMentalMcsP25,healthMentalMcsP50,healthMentalMcsP75,healthMentalMcsP90,healthNObsSubGroup,healthPhysicalPcsAvg,healthPhysicalPcsP10,healthPhysicalPcsP25,healthPhysicalPcsP50,healthPhysicalPcsP75,healthPhysicalPcsP90,healthWbScore0to36Avg,healthWbScore0to36P10,healthWbScore0to36P25,healthWbScore0to36P50,healthWbScore0to36P75,healthWbScore0to36P90 -1,2019.0,1,6.781152019002682,3.33,5.0,7.0,8.33,8.33,Total,8383.293308034823,68516.7600000031,47.893253167062184,33.12,42.05,50.0,55.28,58.15,10104,51.14012569279499,36.69,47.81,54.52,57.49,59.72,11.472288202692003,6.0,8.0,10.0,13.0,20.0 -1,2019.0,1,6.723482647296368,3.33,5.0,7.0,8.33,8.33,Male,4181.032851742744,33321.5800000008,48.583791364003204,34.602000000000004,43.2,51.0,55.6,58.3,4956,51.66736884584304,39.0,48.98,54.53,57.47,59.393,11.063962873284908,6.0,8.0,10.0,12.0,18.0 -1,2019.0,1,6.836670551670778,3.33,5.0,8.0,8.33,8.33,Female,4202.260456292225,35195.180000001164,47.22846930846952,32.13,41.06,49.0,54.96,58.05,5148,50.632546620046,34.265,46.68,54.51,57.49,59.99,11.865384615384615,6.0,8.0,11.0,14.0,20.0 -1,2020.0,1,6.610597429925429,3.725747157128133,5.225444747484767,6.707512686074843,8.173743450458348,9.508323067411508,Total,8248.127382280165,67487.5891621087,45.86414776189753,32.76020085086762,39.36567825915321,46.26630687255094,52.772579058459826,58.55145929741281,10209,51.41362331537166,37.809208110859046,45.73384647296994,52.44484002230666,58.44637970624339,63.55871301723717,12.673641760072487,5.757683837822993,8.855665714284365,12.323114914144071,16.177565366400337,19.77501193069235 -1,2020.0,1,6.675193793681248,3.7811875127443724,5.284579497919485,6.778309213208674,8.282576492067868,9.622192906562738,Male,4130.292096535335,33395.99454978728,47.20529013987232,34.50169148556363,41.016005785585705,47.56293650740277,53.935350236344185,59.32111803447019,5003,51.87264915573842,38.990095819064884,46.59871786307795,52.77521965237201,58.5942555597642,63.63130715211379,11.868815422911723,5.259065833295279,8.230507676706083,11.493650447800562,15.31147746003376,18.6370438163055 -1,2020.0,1,6.548519902482024,3.6893578223534234,5.181411126337608,6.651222153970809,8.096580608944809,9.358913174418358,Female,4117.835285744851,34091.594612321416,44.57530117776266,31.187416041950613,37.784934777705004,44.99538240708275,51.56057343179964,57.515171741139554,5206,50.972496484915425,36.815031474570674,44.77151872337412,52.228175740249114,58.28388656932232,63.4602109908623,13.447085126345263,6.30958019594246,9.630621994991731,13.19451663960811,17.06364549597884,20.613925743739305 -1,2021.0,1,6.63728501198545,3.906714919412983,5.244765719229051,6.711315194185561,8.177539004761616,9.467362692951163,Total,8204.897167613599,67282.1581664965,45.81519400107198,32.6929340777231,38.87694420519159,46.02324949272163,52.697101507732185,58.69776956595552,10137,51.68627945808902,38.48267658869997,45.321602093101646,52.242323693813425,58.656348460202594,64.34224524959134,12.944642639520643,6.111258181698892,9.203798956284208,12.822901246213783,16.5234300303382,19.912272217118577 -1,2021.0,1,6.6358485322655705,3.9076965942735686,5.232459860244543,6.729995375335982,8.146262024519142,9.478715630575353,Male,4109.586449362942,32927.08041710176,47.19114583195416,34.32347086782174,40.70684354935384,47.35370585197653,53.91679712617439,59.88384124116227,4962,52.246977025566416,39.274635260744404,45.88936783226836,52.71278319325469,58.95916951835615,64.8297049378841,12.358180235118704,5.537784059496242,8.661657100527245,12.251099433540965,15.883454158134391,19.27237261077386 -1,2021.0,1,6.638662367032794,3.902749119826259,5.257324955851241,6.694111375454157,8.205590329730203,9.46097759166666,Female,4095.310718250644,34355.07774939471,44.49587554989563,31.542121780315558,37.41760447910149,44.63274612286482,51.442166058134916,57.52199092808827,5175,51.14865987744712,37.61772655778946,44.709477514816484,51.80695306490417,58.29028167086609,63.92259875716118,13.506966591335665,6.718243644674116,9.797545547348552,13.464675035927412,17.07856822354127,20.3689628580935 -1,2022.0,1,6.537796805616559,3.8332348993102503,5.176126980711906,6.598626146412488,7.996475599051233,9.289187134889287,Total,8257.263274108562,67633.5079541033,45.638372753757565,32.37696454418508,38.819126780135406,45.80967332601514,52.56604628714177,58.5921159841777,10345,50.97639297094621,37.6458652626698,44.466193766778716,51.32376906483475,57.98189985048771,63.813757553961736,12.87836914450102,5.894577947755574,9.225845277673308,12.877735633025202,16.424678806297514,19.87930899779249 -1,2022.0,1,6.519294918975182,3.8252696377706052,5.126614959421408,6.565950068948192,8.028186828425989,9.243384521034,Male,4153.239234454596,33065.86382904212,46.860019707275406,33.70860357654566,40.39133223778091,46.91977363016137,53.60697612037136,59.65056782943187,5072,51.72469587205957,38.81199349996316,45.39510961289852,52.188107252588,58.42091346827156,64.4397492663658,12.35481563331262,5.385654927111247,8.611029095566053,12.279330299235905,15.91700716493538,19.29854755391635 -1,2022.0,1,6.555593424058616,3.851185689839042,5.232623540208925,6.636195986476712,7.973215946319512,9.328426832946596,Female,4104.024039653982,34567.64412506108,44.46329341595297,31.264893840561108,37.601493954556176,44.64388282378564,51.29150100552935,57.518904991252576,5273,50.25661441709689,36.857799133418176,43.6279610904043,50.488075926026376,57.42608849451672,63.29882113363579,13.381965467039825,6.491033434570065,9.815293587279575,13.398464867294146,16.892856124532457,20.376237809084603 -2,2019.0,1,6.786520575111859,3.33,5.0,7.0,8.33,8.33,Total,8370.065275084518,68442.0600000031,47.907536936043265,33.14,42.05,50.0,55.34,58.15,10085,51.14231234506699,36.726,47.8,54.52,57.49,59.72,11.463460585027269,6.0,8.0,10.0,13.0,20.0 -2,2019.0,1,6.732984441301439,3.33,5.0,7.0,8.33,8.33,Male,4177.169885786301,33321.54000000082,48.593297635886024,34.65,43.25,51.0,55.6,58.3,4949,51.68286522529767,39.0,48.98,54.53,57.47,59.4,11.052131743786624,6.0,8.0,10.0,12.0,18.0 -2,2019.0,1,6.83810747663574,3.33,5.0,8.0,8.33,8.33,Female,4192.89538929836,35120.52000000116,47.246744548286806,32.198,41.06,49.0,54.96,58.05,5136,50.62144080996824,34.301,46.635000000000005,54.51,57.49,59.976000000000006,11.85981308411215,6.0,8.0,11.0,14.0,20.0 -2,2020.0,1,6.666980881030563,3.79590106316614,5.28770418897872,6.777156651456801,8.246300879034287,9.539507572747144,Total,8201.557851086345,67576.51821012578,45.90907684397509,32.80868873979895,39.39135676166323,46.34744154806434,52.82812998366706,58.59602322241514,10136,51.4643524959085,38.02795922833847,45.81243810571845,52.461400988719355,58.39984371295924,63.5902342784553,12.926555377589393,6.029525708106725,9.064060097343049,12.615954635958865,16.44490171950817,20.05181770515116 -2,2020.0,1,6.763025151659051,3.882368868197391,5.357367293133736,6.883104952861058,8.350134328945828,9.710086728973145,Male,4094.7094834551144,33632.52407920046,47.19171578023122,34.332164126600844,40.863413818890876,47.541352601059614,53.950755771678175,59.45257115934627,4973,51.707479617201685,39.0597858930488,46.39880640387963,52.49635711376552,58.35257230264243,63.479230998256035,12.062731601930048,5.4713494176136575,8.447988966601798,11.748978513813874,15.504566986130948,18.924198369688476 -2,2020.0,1,6.574471069325078,3.706649318021962,5.2053817361031065,6.677389007613972,8.125530139255224,9.360956242838096,Female,4106.848367631243,33943.99413092538,44.673639418059565,31.482250864266256,37.906688035591486,45.11163620283005,51.64137660547063,57.56915571284539,5163,51.23017252802276,37.0202915912202,45.04586060468515,52.43102083422822,58.489263858988856,63.694492938625224,13.758590170607693,6.664499723115602,9.920181231137562,13.481296148899025,17.4244349144142,20.972135635893203 -2,2021.0,1,6.690410506223148,3.9572473039645333,5.302666939172668,6.770529718835435,8.225754722136386,9.486655061027587,Total,8159.600277937682,67533.00364981646,45.9162194692259,32.730210267543,39.02530367740133,46.134722152297186,52.8052014035807,58.7723632152116,10094,51.53653184124655,38.371416381670315,45.13914006766219,52.07733794959097,58.506896926597236,64.14645840453356,13.187987524046061,6.340795149269812,9.42771417686578,13.087468280057186,16.74056825139801,20.217235416941676 -2,2021.0,1,6.7720714044941115,4.031475118840537,5.391845372873118,6.8731569932145025,8.294127220774488,9.591107991848245,Male,4071.280643536073,33454.03273820091,47.21962155443569,34.14574853047761,40.84813759196775,47.53553333291729,53.9289386934945,60.00341397134855,4940,51.90009038592889,39.04273675658537,45.532441601728294,52.34842259143208,58.566737041801815,64.23774259458806,12.305899050083758,5.533652248798487,8.582513500267025,12.213424143621932,15.863280450750297,19.250456350077414 -2,2021.0,1,6.612140262245978,3.885811128516833,5.220776628952174,6.668223234659287,8.17949364124544,9.406664742907925,Female,4088.319634401601,34078.97091161577,44.666936135711005,31.538935504556875,37.64028718792687,44.8284118573054,51.77232606635533,57.67057063044478,5154,51.18806866493094,37.74088427446952,44.6370432735218,51.80729979972644,58.401461691733466,64.05347923022762,14.033450671382774,7.198570705741167,10.389230410833193,13.971457974784702,17.58894028194424,20.935777576673452 -2,2022.0,1,6.567471124248764,3.83983422202851,5.215501515647134,6.633196288662077,8.0315552092504,9.345977678448392,Total,8200.538269196417,67474.1983305318,45.65910483226554,32.38018369234729,38.92740370546191,45.81266259668021,52.538466152646436,58.561335389855216,10274,50.97737033997559,37.65928352150519,44.388058473244406,51.36431624619166,57.935746862986434,63.67328845657897,13.035252616153041,6.051584769894543,9.325200852283366,13.015834413817585,16.574066404459955,20.05678791199157 -2,2022.0,1,6.601185109687892,3.862107408707888,5.222719745033519,6.657861999735694,8.135346354384946,9.357689309940346,Male,4101.6978084427665,33230.365842168845,46.743836270170036,33.54674714116538,40.23279881468352,46.84686646199246,53.43906423487421,59.45280187289365,5034,51.51050922509953,38.58417332817753,45.16521964421465,51.94371507187412,58.22023933012072,63.91508920596812,12.320274308863056,5.442940023403027,8.630216164928248,12.248459832455406,15.880931381862144,19.169249475015988 -2,2022.0,1,6.535082535947146,3.816532106009871,5.201619102774687,6.594161220643704,7.946371426903574,9.318671271307293,Female,4098.840460753668,34243.83248836305,44.61701741653795,31.3787293074591,37.83379846803033,44.60007362770639,51.55439572590352,57.49098286345642,5240,50.46519073163332,36.952444637874564,43.72530843948016,50.6849372492491,57.654834783012454,63.49478583621641,13.722122997622145,6.7389730039956195,10.069123579548855,13.68360798737968,17.184843538363047,20.879902981111872 \ No newline at end of file +1,2019.0,1,6.798653101737303,3.33,5.0,8.0,8.33,8.33,Total,8313.63015908381,68496.43000000333,47.53391960297742,33.416,42.19,49.52,54.79,57.73,10075,51.020747394541296,36.17,47.59,54.51,57.49,59.64,11.50302729528536,6.0,8.0,10.0,13.0,19.0 +1,2019.0,1,6.82559311740912,3.33,5.0,8.0,8.33,8.33,Male,4178.113558218262,33718.430000001055,48.500955465587225,35.652,43.66,50.86,55.197500000000005,58.15,4940,51.79769838056671,39.08,49.0,54.77,57.49,59.31,10.857489878542511,6.0,8.0,10.0,12.0,17.0 +1,2019.0,1,6.77273612463507,3.33,5.0,8.0,8.33,8.33,Female,4135.516600865757,34778.000000001084,46.60360662122688,31.608,40.8,48.87,54.2,57.33,5135,50.27330087633859,34.18,45.74,54.03,57.49,59.89,12.124050632911393,6.0,8.0,11.0,14.0,21.0 +1,2020.0,1,6.568906195238606,3.7280345321936648,5.1573978456236915,6.694649618213386,8.15059638663807,9.394204110996757,Total,8218.824994156601,66996.27428523854,45.77913999332926,32.81715134888009,39.25280560946325,46.12554727169844,52.79793088536014,58.49922241641777,10199,51.331378886565744,37.999161680301796,45.530348453583485,52.294365442267704,58.36516460930966,63.364529715812715,12.715087198499903,5.6861670877116035,8.837566202384902,12.396694719727444,16.211421392067454,20.044244175828222 +1,2020.0,1,6.6343716746983805,3.795458596829506,5.194900740546059,6.758372698239147,8.205445249143672,9.46241568645686,Male,4131.434192875296,33138.68651511841,47.14848435035804,34.43356115312875,40.9744566726149,47.52023786180159,54.00821665132945,59.51107674022268,4995,51.97857490276504,39.286952297354716,46.645559471024974,52.78246097589111,58.51874578092821,63.4621577517758,11.933371889394637,5.2486799582150665,8.301151892075413,11.598209168010907,15.371764990571515,18.745220522068184 +1,2020.0,1,6.506069902021518,3.673854571626312,5.1208938555010945,6.629403711331793,8.110261002332628,9.335509205680513,Female,4087.390801281303,33857.58777011998,44.46479044233811,31.411211462584873,38.03043811141277,44.77349721338857,51.37524060073256,56.98748329623029,5204,50.710175177703746,36.79306286014092,44.53485220513723,51.70526516442504,58.2118243135553,63.278411868097876,13.465407715214232,6.137813631629358,9.501617102128497,13.159326374560248,17.082796625194714,21.140896103431686 +1,2021.0,1,6.613794192409188,3.8463282141063115,5.210249237311273,6.682739683389917,8.158902809900637,9.447323142674595,Total,8125.022769002852,66832.39031429484,45.53468859582486,32.18547360461642,38.64450086419309,45.71144876969965,52.48103910494709,58.55903640325659,10105,51.562299559225885,38.11657489776609,45.244192952394116,52.10605004786094,58.4248628014312,64.45412206022671,13.020476165037005,5.943166465818468,9.138355545316092,12.937320836316553,16.70946692779321,20.22064592877273 +1,2021.0,1,6.646009110361918,3.915322432233361,5.26621199427967,6.719696113964639,8.171758474667543,9.408459014238895,Male,4074.641199677886,32864.51505073968,46.99455277277545,33.74666146137077,40.3295900810582,47.142220019405585,53.788902545264946,59.90075661835038,4945,52.06361178476891,38.79420858185804,45.83212473374033,52.55338399794182,58.6016114945217,64.54716256439865,12.40564109788694,5.478566120867114,8.562305059263466,12.380171876363951,15.983807099876094,19.422832333091126 +1,2021.0,1,6.582921562704467,3.7839922185146726,5.165361839413469,6.64223909238078,8.134341535509124,9.477218049948089,Female,4050.38156932492,33967.87526355505,44.1356520929143,30.75097748691335,37.36499943142023,44.34461393252897,51.045326546489314,57.2171041239603,5160,51.08187534308021,37.28085341777665,44.67665017675078,51.65438687911177,58.24323724794006,64.32433412553291,13.60969310438915,6.413926333481789,9.694817004450192,13.554090530272937,17.354702982606543,20.843658383945645 +1,2022.0,1,6.580957533929906,3.8783415332734545,5.162722733790004,6.658377378527328,8.079567750822935,9.347815497019116,Total,8235.570533835424,68093.16760357274,45.488451176048216,32.349221473773476,38.758261022494175,45.48749469659377,52.320918331937186,58.58376675862219,10347,50.958826404937426,37.48448942733354,44.32090193446454,51.38303704120461,58.06689334141203,63.953657702377406,12.918295629533814,6.014607680777572,9.160764330536555,12.858077901887523,16.57069205143966,19.843032974427825 +1,2022.0,1,6.648257544468094,3.9367624980936773,5.244579203410486,6.711720799222085,8.178965148982513,9.411432800218192,Male,4135.7757382404725,33646.83143255302,46.69179962490331,33.910719867996846,40.065290819314995,46.71021698413794,53.292869655081866,59.42480199056996,5061,51.74897868918394,38.760432645234204,45.15203566250483,52.108564560295875,58.708533503770525,64.3897626085411,12.368557625489668,5.433218311987965,8.694432552768312,12.273524626876613,15.986044838280693,19.33313311971878 +1,2022.0,1,6.516522166292055,3.835535558101451,5.096347875931046,6.605524365941974,8.014934837398403,9.281673632389827,Female,4099.7947955949385,34446.3361710198,44.336323574902316,31.086923484686647,37.45930429900152,44.44551810693079,51.32396638551549,57.45668735423818,5286,50.20230716343714,36.61579287266246,43.597393832217385,50.479467270977864,57.41947445871641,63.530268900941294,13.444633888797346,6.57958875915759,9.700831241418284,13.416769961654007,17.06538235216716,20.276711344651503 +2,2019.0,1,6.799095596985654,3.33,5.0,8.0,8.33,8.33,Total,8323.349559890836,68562.08000000333,47.54007040856779,33.425,42.19,49.52,54.79,57.73,10084,51.027703292344626,36.18,47.605000000000004,54.51,57.49,59.64,11.495934153113843,6.0,8.0,10.0,13.0,19.0 +2,2019.0,1,6.828700485044678,3.33,5.0,8.0,8.33,8.33,Male,4185.2461878088,33788.410000001066,48.517956750202266,35.67,43.66,50.864999999999995,55.197500000000005,58.15,4948,51.791240905416245,39.079,49.0,54.77,57.49,59.31,10.851657235246565,6.0,8.0,10.0,12.0,17.0 +2,2019.0,1,6.770574376947251,3.33,5.0,8.0,8.33,8.33,Female,4138.103372082248,34773.67000000108,46.59797897196263,31.616000000000003,40.7925,48.835,54.2,57.33,5136,50.29211448598103,34.271,45.74,54.03,57.49,59.89,12.116627725856699,6.0,8.0,11.0,14.0,21.0 +2,2020.0,1,6.624915598904496,3.776489343404798,5.217146548747606,6.7536993849632125,8.217152005493473,9.473265693638094,Total,8170.864778124941,67044.1458609135,45.78122260706752,32.844438623354876,39.316447808525275,46.12132882799864,52.806521383056904,58.43138200670184,10120,51.43296375490332,38.04779001502157,45.632068088458354,52.32211138012006,58.42972775554907,63.36757565663351,12.939469171506065,5.922272212861546,9.098672596390028,12.624197699668247,16.424193941792623,20.254070718212233 +2,2020.0,1,6.722030079783013,3.891809713446567,5.287712240866176,6.841910579949203,8.300724237066408,9.556758530473209,Male,4090.371445649336,33361.435285963096,47.073154308531166,34.313572143864675,40.79290266063657,47.41073415987613,53.964035321038544,59.370472223664905,4963,51.81928370414118,38.95652203718212,46.539175021941254,52.622290740139604,58.36155725179692,63.20961565773363,12.112093335443365,5.4035666641459725,8.465723783356006,11.821562699980813,15.515381525423773,18.965605525376212 +2,2020.0,1,6.531454445404358,3.6914761840511385,5.136102686240959,6.653377558581718,8.130654759526987,9.373108942839785,Female,4080.4933324756075,33682.71057495027,44.53789178791599,31.422649858800177,38.12283089433704,44.80635410150461,51.46551666974245,57.14295728194734,5157,51.06117668721542,37.22627302617849,44.88791904989476,51.99793138917041,58.49515673057068,63.555292160050165,13.735720145789404,6.497813428081362,9.824309392793275,13.38704312861772,17.375096967390412,21.320499085102735 +2,2021.0,1,6.655099951792754,3.8937438055171696,5.273788111177874,6.724345322951498,8.185599306362782,9.463501389671691,Total,8087.315881806031,67023.51161450482,45.59598184765952,32.17350914982153,38.678902994363874,45.75144583830411,52.54523258606864,58.77594194580701,10071,51.456307407470234,38.02647588256498,45.12036431965614,52.00093517090513,58.35161035315186,64.32990408965814,13.228199686748749,6.117811310137299,9.304309079672429,13.124875389882307,16.86349586715943,20.530922109975194 +2,2021.0,1,6.7473840077218705,4.021043503519735,5.390400046060927,6.818811785089155,8.26913674698907,9.49059989427676,Male,4037.921425347276,33251.10839005338,46.96597567375093,33.59521049422269,40.30935506340731,47.140368531286164,53.784106613511284,60.071902858993234,4928,51.763276754087634,38.402597496459244,45.40713761771313,52.299273285772124,58.36753411917341,64.30393774346807,12.36876289350913,5.480068014950891,8.518489550694444,12.284890145400528,15.95881903587092,19.403608980481014 +2,2021.0,1,6.566673774927379,3.797705966572773,5.172730546642006,6.623284444865746,8.097530898095862,9.418877168053017,Female,4049.3944564587614,33772.40322445151,44.283259783693055,30.87366337945144,37.43008600593824,44.47611443562308,51.28343201689265,57.24434944439322,5143,51.162170728463494,37.507515208491576,44.731376294924814,51.70297774330306,58.307394463100465,64.33469622191046,14.05170824538853,6.866400567320482,10.169361435756306,14.011287387256003,17.75592559229638,21.329895393728222 +2,2022.0,1,6.615403631095151,3.8862514351969235,5.202216830818784,6.698550074637189,8.12646931634228,9.397811917523322,Total,8202.746648328868,68151.88820754224,45.47216187802264,32.2224132845585,38.72231422625332,45.44917950686405,52.42988549440548,58.576956305014434,10302,51.01294079094625,37.535328455558265,44.2339874606229,51.36583883035484,58.14748279495597,64.12339892954641,13.019963678974504,6.107181626579257,9.272589865911364,12.982414627681795,16.668472618229554,19.936741090996588 +2,2022.0,1,6.710812476945325,3.973644346695343,5.3046354426723985,6.79485113964944,8.236698393695502,9.483057599246404,Male,4102.165902055565,33795.651633896654,46.57849302231298,33.63335277950514,39.994618418989965,46.63806750287114,53.265646742059985,59.3418167138917,5036,51.658933731430935,38.586615378628125,44.91219231195396,51.97823949637993,58.66951437157549,64.49675505682671,12.275282693153917,5.377890642510175,8.61222153984142,12.15682633874466,15.972812372231669,19.17081689275878 +2,2022.0,1,6.524161901565848,3.8232942244681865,5.095337703664975,6.611134945881528,8.033478857305774,9.308698069719094,Female,4100.580746273328,34356.23657364576,44.41415131162535,31.133715957570526,37.5535898693926,44.43906110855374,51.42692396695702,57.73039353028882,5266,50.395162506046084,36.807416017170254,43.64037062758619,50.6069317097077,57.60659795704738,63.75917667197995,13.732119669212464,6.891693373683198,9.996048813604913,13.66565433842528,17.307676312170244,20.589574105572265 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/Statistics1.csv b/src/test/java/simpaths/integrationtest/expected/Statistics1.csv index fc0863e19..87829eb5b 100644 --- a/src/test/java/simpaths/integrationtest/expected/Statistics1.csv +++ b/src/test/java/simpaths/integrationtest/expected/Statistics1.csv @@ -1,9 +1,9 @@ run,time,id_Statistics1,edi_p50,sIndex_p50,statYHhDispEquivNatGini,statYMktNatGini,yHhDispEquivP50,yHhQuintilesC5P20,yHhQuintilesC5P40,yHhQuintilesC5P60,yHhQuintilesC5P80,yLabP20,yLabP40,yLabP60,yLabP80 -1,2019.0,1,15353.892240000001,0.0,0.0,0.0,15581.795538461542,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2020.0,1,15495.281058979526,0.0,0.0,0.0,15495.281058979526,4.950197717538108,7.319940466401706,8.068515897261777,8.64602416553861,486.2888559998317,1365.233604405037,2281.4162588356758,3827.6554474883005 -1,2021.0,1,15759.869823108587,0.0,0.0,0.0,15765.89761887139,5.7212507365504806,7.447546599308169,8.116525671643636,8.668379854514725,686.3989193844578,1450.7892491313905,2352.464870213408,3902.9431875780006 -1,2022.0,1,16115.58243336745,0.0,0.0,0.0,16119.686247212114,5.982803140960501,7.501814224253487,8.149299162157433,8.710368538841145,628.8831495993874,1426.2184657764553,2303.2699334999074,3948.9547121966816 -2,2019.0,1,15357.864959999999,0.0,0.0,0.0,15588.1704,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2020.0,1,16217.792666099533,0.0,0.0,0.0,16217.792666099533,4.615480295638323,7.3329710856832655,8.175838875146923,8.7873487204666,541.0261499234446,1569.437756312981,2656.4049717752346,4590.3665061636575 -2,2021.0,1,16551.463885949386,0.0,0.0,0.0,16560.701464864364,5.618524716120628,7.499979629651158,8.235981271630662,8.82807012554799,746.7054835924638,1678.6542095657167,2810.18106441219,4675.380599832989 -2,2022.0,1,16825.09635133956,0.0,0.0,0.0,16827.001222448842,5.879082797883639,7.531308457782852,8.244604023436178,8.827737057782983,692.0987134304304,1650.597451088591,2772.945271394626,4684.924631673976 \ No newline at end of file +1,2019.0,1,15256.953965109053,0.0,0.0,0.0,15456.781759590931,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2020.0,1,15494.33940839168,0.0,0.0,0.0,15494.33940839168,5.069328576701166,7.309558066126921,8.053784068849202,8.629647308681838,496.95130739470744,1329.786987235312,2245.633585018565,3702.082767834228 +1,2021.0,1,15795.98461666872,0.0,0.0,0.0,15801.592949392198,5.786759852654809,7.432914372241713,8.117165781544978,8.68839908031111,691.8380631103834,1441.4051308067535,2391.7198830795433,4020.259615974613 +1,2022.0,1,16176.124246500869,0.0,0.0,0.0,16182.763325113257,5.921345043614325,7.461136632914112,8.149552314896253,8.710796219928115,632.4099002222833,1440.3396796778472,2359.8435096547473,3975.898696861888 +2,2019.0,1,15256.926298340906,0.0,0.0,0.0,15450.417507924612,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2020.0,1,16098.514888746395,0.0,0.0,0.0,16096.93059641256,4.769251305876071,7.3425239304769985,8.134276908628477,8.767225857306094,526.3499365600559,1517.2111935090763,2641.0746984931116,4495.057131940739 +2,2021.0,1,16623.39379793267,0.0,0.0,0.0,16623.59531070832,5.7104111946254985,7.490017765268533,8.240670492549269,8.8241653457063,740.0167668995036,1688.633193134877,2815.5377430189255,4774.736714969861 +2,2022.0,1,16869.07589913759,0.0,0.0,0.0,16869.07589913759,5.824447208207177,7.499192062689555,8.245555860954243,8.840353675418474,693.7979832467204,1654.1123172848331,2775.0120164178047,4654.001952345548 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/Statistics21.csv b/src/test/java/simpaths/integrationtest/expected/Statistics21.csv index 5e1cec678..3d31e38b7 100644 --- a/src/test/java/simpaths/integrationtest/expected/Statistics21.csv +++ b/src/test/java/simpaths/integrationtest/expected/Statistics21.csv @@ -1,9 +1,9 @@ run,time,id_Statistics21,demDsbl18to29Share,demDsbl30to54Share,demDsbl55to74Share,demMarried18to29Share,demMarried30to54Share,demMarried55to74Share,demNChild18to29Avg,demNChild30to54Avg,demNChild55to74Avg,demPop18to29N,demPop30to54N,demPop55to74N,healthScore18to29Avg,healthScore30to54Avg,healthScore55to74Avg,labNoWork18to29Share,labNoWork18to54Share,labNoWork30to54Share,labNoWork55to74Share,labWorkFullTime18to29Share,labWorkFullTime30to54Share,labWorkFullTime55to74Share,labWorkPartTime18to29Share,labWorkPartTime30to54Share,labWorkPartTime55to74Share,statInvestLoss18to29Avg,statInvestLoss30to54Avg,statInvestLoss55to74Avg,statYDisp18to29Avg,statYDisp30to54Avg,statYDisp55to74Avg,statYDispGrossOfLosses18to29Avg,statYDispGrossOfLosses30to54Avg,statYDispGrossOfLosses55to75Avg,statYInvest18to29Avg,statYInvest30to54Avg,statYInvest55to74Avg,statYLab18to29Avg,statYLab30to54Avg,statYLab55to74Avg,statYPens18to29Avg,statYPens30to54Avg,statYPens55to74Avg,wealth18to29Avg,wealth30to54Avg,wealth55to74Avg,x18to29Avg,x18to54Avg,x30to54Avg,x55to74Avg,xToLeisureRatio -1,2019.0,1,0.03737997256515775,0.09197894084855993,0.058134083450539144,0.2397119341563786,0.6731186125735522,0.636896390060947,0.27434842249657065,0.9530814493651285,0.07712142522269104,2916.0,6458.0,4266.0,3.672153635116598,3.4783214617528646,3.1167369901547115,-0.004249733744855988,-0.024792869794721395,-0.024612932548776723,0.033406073792780155,0.5555555555555556,0.6853515020130071,0.26371308016877637,0.10596707818930041,0.1347166305357696,0.10173464603844351,0.0,0.0,0.0,-225.80216051340744,-482.49109267280596,-511.8638623799602,1060.4100609151637,1617.029826077194,1566.981732262897,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.34744375,-1108.3894350892856,-1343.6696142857143,-1403.9432562499999,NaN -1,2020.0,1,0.037787701820680177,0.08387196060326255,0.08277765003449068,0.42425283407763653,0.7548476454293629,0.6792366061163486,0.3253177602198557,0.9669128962757771,0.0853069671188779,2911.0,6498.0,4349.0,3.5791824115424253,3.3901200369344413,3.076109450448379,0.007667953246307091,-0.033443064893153074,-0.0403404294244383,0.01784667192458045,0.5166609412572999,0.7425361649738381,0.32858128305357553,0.132944005496393,0.09325946445060018,0.0524258450218441,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.1095401312451,-1107.7758988237144,-1342.8526848560089,-1403.8145050070698,NaN -1,2021.0,1,0.03612767450017538,0.06753812636165578,0.07762349191896198,0.42967379866713434,0.7661064425770309,0.6849533348508992,0.33882848123465453,0.945845004668534,0.09401320282267243,2851.0,6426.0,4393.0,3.548579445808488,3.367569249922191,3.0851354427498294,-0.020734816590669947,-0.06844176166788585,-0.0822292070961718,-0.0170351141816526,0.5324447562258856,0.7950513538748832,0.3637605281129069,0.14556296036478428,0.08263305322128851,0.05212838606874573,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0494773199941,-1107.7037001629633,-1342.7765869999637,-1403.8306362458163,-0.7807440366889227 -1,2022.0,1,0.04645560908465245,0.06840739044128874,0.0976985559566787,0.37818306951135583,0.7474423576118492,0.6854693140794224,0.3479008947006194,0.9215147350740571,0.09657039711191336,2906.0,6549.0,4432.0,3.444253269098417,3.2919529699190715,2.996841155234657,-0.04850824246386787,-0.08837282927918194,-0.09460435107650023,-0.040225622382671467,0.5467997247075017,0.7992059856466636,0.38605595667870035,0.15898141775636615,0.09085356542983662,0.053023465703971116,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0307465987404,-1107.7226574258877,-1342.8190159565147,-1403.8096492035813,0.9294324069461315 -2,2019.0,1,0.037037037037037035,0.09151543353497751,0.05731735964294104,0.24039780521262002,0.6714751046998604,0.6370683579985905,0.2757201646090535,0.9530013959981387,0.07657975099835565,2916.0,6447.0,4257.0,3.672496570644719,3.4774313634248486,3.1195677707305616,-0.0045926692729766905,-0.02507772775330397,-0.025391705537459286,0.034042900305379376,0.5552126200274349,0.6865208624166279,0.26309607704956545,0.10665294924554183,0.1343260431208314,0.1017148226450552,0.0,0.0,0.0,-226.28168459165613,-472.34542838695415,-512.3576696966218,1059.930536836915,1627.1754903630458,1566.4879249462354,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.34744375,-1108.3894350892856,-1343.6696142857143,-1403.9432562499999,NaN -2,2020.0,1,0.03948735711811569,0.08334624322230828,0.08452326116996775,0.4118462071354347,0.7529047250193648,0.6860893597420543,0.32490474541046066,0.9640588690937258,0.08406264394288346,2887.0,6455.0,4342.0,3.5691028749567026,3.3696359411309063,3.0695532012897284,0.019586720574991334,-0.02791070932475881,-0.037232638884585584,0.021377982404422013,0.5053688950467613,0.7432997676219985,0.32842008291110086,0.1323172843782473,0.08938807126258715,0.0490557346844772,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0862280620779,-1107.7737621378863,-1342.8646795019974,-1403.8318431109258,1.0138926596635465 -2,2021.0,1,0.03644727530077849,0.0692403876211316,0.08236632536973834,0.41259731068648264,0.7643013441700531,0.69032992036405,0.3343949044585987,0.9509221631759925,0.09169510807736064,2826.0,6398.0,4395.0,3.549539985845718,3.367458580806502,3.0755403868031856,-0.020009477919320617,-0.06367412052279903,-0.07606715073460457,-0.012977826848691643,0.5371549893842887,0.7899343544857768,0.3647326507394767,0.14012738853503184,0.08158799624882776,0.04709897610921502,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0503848399476,-1107.739210281282,-1342.8341849891613,-1403.8546125648716,-0.5598136684247321 -2,2022.0,1,0.04946385333794535,0.07115414169356078,0.10038522547020168,0.35696990660671046,0.7467342861533733,0.690006798096533,0.32964372189553787,0.9383740587060089,0.09472014502605937,2891.0,6507.0,4413.0,3.441023867173988,3.2832334409097896,2.994108316338092,-0.03314564029747491,-0.08089872786908986,-0.08913063064392193,-0.03554456845683207,0.5316499481148391,0.7949900107576456,0.3834126444595513,0.15876859218263575,0.08959581988627632,0.05098572399728076,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.1006030884996,-1107.7675024308128,-1342.846640024502,-1403.8355827997948,1.681132246206796 \ No newline at end of file +1,2019.0,1,0.05811554332874828,0.09130434782608696,0.06236811254396248,0.2620357634112792,0.6720496894409937,0.5969519343493552,0.29332874828060523,0.9503105590062112,0.07409144196951935,2908.0,6440.0,4265.0,3.69050894085282,3.4482919254658384,3.092379835873388,0.0021834914718019127,-0.0201199603173437,-0.02022802981366459,0.036602920750293144,0.561554332874828,0.6751552795031056,0.2797186400937866,0.09353507565337002,0.140527950310559,0.08253223915592028,0.0,0.0,0.0,-220.98483429553175,-459.2130693789786,-563.0006789520651,1065.2273871330394,1640.3078493710213,1515.844915690792,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.34744375,-1108.3894350892856,-1343.6696142857143,-1403.9432562499999,NaN +1,2020.0,1,0.05670103092783505,0.07876923076923077,0.09542513863216266,0.42508591065292095,0.7641538461538462,0.6559611829944547,0.3436426116838488,0.9632307692307692,0.08086876155268022,2910.0,6500.0,4328.0,3.5814432989690723,3.348923076923077,3.0355822550831792,0.005039223024054962,-0.034611558800407616,-0.042544799999999994,0.020619049537892842,0.5034364261168385,0.7423076923076923,0.3200092421441775,0.14879725085910653,0.09569230769230769,0.05822550831792976,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.109781887632,-1107.8092946183485,-1342.906854946029,-1403.8502432182481,2.8910432170695533 +1,2021.0,1,0.043754410726887794,0.06522078327352161,0.07813211845102505,0.40578687367678196,0.7768762677484787,0.669248291571754,0.3405081157374735,0.9614604462474645,0.08610478359908884,2834.0,6409.0,4390.0,3.544107268877911,3.363863317210173,3.071753986332574,-0.014569019548341555,-0.06686049378713416,-0.08206079313465439,-0.016863739863325677,0.518348623853211,0.7913871118739273,0.3562642369020501,0.15349329569513057,0.0861288812607271,0.05945330296127563,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0724367042129,-1107.7779481616933,-1342.8822879361044,-1403.8187668256835,-0.5089642681537601 +1,2022.0,1,0.05143456962911127,0.06444748442012464,0.09497964721845319,0.3460461861441568,0.7593859249126007,0.6702849389416553,0.33100069979006297,0.9554643562851497,0.09203980099502487,2858.0,6579.0,4422.0,3.412526242127362,3.292749658002736,2.9696969696969697,-0.037268737508747374,-0.08980236318637708,-0.10088162930536555,-0.04076628141112615,0.5255423372988104,0.8062015503875969,0.3817277250113071,0.16899930020993703,0.09013527891776865,0.05789235639981909,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0535119014452,-1107.7658424396789,-1342.8777907378258,-1403.764139386643,-0.3635084069804372 +2,2019.0,1,0.05807560137457045,0.09109248913718188,0.0625732364659011,0.26082474226804125,0.6719428926132837,0.5978439184438715,0.2934707903780069,0.9497206703910615,0.07429107101007734,2910.0,6444.0,4267.0,3.689347079037801,3.450651769087523,3.089289899226623,0.0019464395189003336,-0.020478632743557712,-0.020652807448789584,0.036303999203187276,0.5618556701030928,0.675667287399131,0.28005624560581205,0.09347079037800687,0.1404407200496586,0.0824935551910007,0.0,0.0,0.0,-220.29699124714057,-458.1635502021104,-560.3573828031367,1065.9152301814306,1641.3573685478896,1518.4882118397204,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.34744375,-1108.3894350892856,-1343.6696142857143,-1403.9432562499999,NaN +2,2020.0,1,0.059231035677173534,0.0781055900621118,0.09787626962142197,0.4170419120193973,0.761335403726708,0.6574330563250231,0.33391063387599584,0.962111801242236,0.0840258541089566,2887.0,6440.0,4332.0,3.55975060616557,3.3436335403726707,3.0267774699907664,0.017162058295808802,-0.026532691368328587,-0.036687657142857155,0.026508462973222513,0.49393834430204364,0.7399068322981367,0.3183287165281625,0.14617249740214755,0.0922360248447205,0.054016620498614956,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.1227976163736,-1107.8144560713527,-1342.906595208822,-1403.855152358859,0.3748472749862686 +2,2021.0,1,0.04962779156327544,0.06609240407204385,0.084359325125399,0.39844026940801136,0.7757243539545811,0.6671226630186958,0.34420418291386035,0.9498825371965545,0.0898312813497492,2821.0,6385.0,4386.0,3.549805033676001,3.3580266249021142,3.059279525763794,-0.009511928075150666,-0.062234853090052944,-0.07768497227877838,-0.012910905882352885,0.5147110953562567,0.7899765074393109,0.34997720018239853,0.15207373271889402,0.08316366483946751,0.0617875056999544,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0543503788643,-1107.7773936439316,-1342.8926506882299,-1403.8493327175618,-0.9308433118067843 +2,2022.0,1,0.05493741307371349,0.06498470948012232,0.09533514492753623,0.35048678720445064,0.7593272171253823,0.667572463768116,0.3410987482614743,0.9327217125382263,0.09329710144927536,2876.0,6540.0,4416.0,3.4113351877607787,3.291896024464832,2.957880434782609,-0.02040442962447847,-0.08041420092539037,-0.0927710996941896,-0.035702359420289764,0.5142559109874826,0.8021406727828746,0.37296195652173914,0.16342141863699583,0.08608562691131498,0.06159420289855073,0.0,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,-720.0286754851826,-1107.7676383979426,-1342.8933862537576,-1403.808394859815,0.31595143246095514 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/Statistics31.csv b/src/test/java/simpaths/integrationtest/expected/Statistics31.csv deleted file mode 100644 index b39877965..000000000 --- a/src/test/java/simpaths/integrationtest/expected/Statistics31.csv +++ /dev/null @@ -1,9 +0,0 @@ -run,time,id_Statistics31,careAdj,demFertAdj,demFertRateSim,demFertRateTarget,demPartnerAdj,demPartnerSimShare,demPartnerTargetShare,demUtilAdjCouple,demUtilAdjSDepF,demUtilAdjSDepM,demUtilAdjSingleACF,demUtilAdjSingleACM,demUtilAdjSingleF,demUtilAdjSingleM -1,2019.0,1,0.0,-0.279462622342386,0.050626689604325384,0.05113363440615968,-0.613869665517935,0.5439801190242627,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2020.0,1,0.0,-0.2659197918000082,0.04856027330405076,0.04996578478889472,1.5923485021919526,0.625579598145286,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2021.0,1,0.0,-0.25543875103684177,0.047371031746031744,0.04833442666835588,0.6717028585667406,0.6329130294212738,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2022.0,1,0.0,-0.24930347300809638,0.047780742178025706,0.04938041570024613,-0.07967461177724555,0.615238336713996,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2019.0,1,0.0,-0.279462622342386,0.05070145212896874,0.05113363440615968,-0.613869665517935,0.5433117265763111,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2020.0,1,0.0,-0.2659197918000082,0.049038935436175456,0.04996578478889472,1.609625538158143,0.624611801242236,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2021.0,1,0.0,-0.25543875103684177,0.04912718204488778,0.04833442666835588,0.6332489183786916,0.6314628608498216,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2022.0,1,0.0,-0.24930347300809638,0.04802535348610434,0.04938041570024613,-0.036612235267410864,0.6132586130038846,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 \ No newline at end of file diff --git a/src/test/java/simpaths/model/PersonTest.java b/src/test/java/simpaths/model/PersonTest.java index 7d9fa8af9..64e2b4b68 100644 --- a/src/test/java/simpaths/model/PersonTest.java +++ b/src/test/java/simpaths/model/PersonTest.java @@ -194,7 +194,7 @@ public void under18DoesntEnterPartnership() { @DisplayName("OUTCOME B: Female over 18, student and partnered stays partnered") public void over18StudentPartneredStaysPartnered() { testPerson.setDemAge(20); - testPerson.setLes_c4(Les_c4.Student); + testPerson.setLabC4(Les_c4.Student); testPartner.setDemAge(20); @@ -214,7 +214,7 @@ public void over18StudentPartneredStaysPartnered() { @DisplayName("OUTCOME C: Aged 18-29, student and not partnered - estimate to be partnered") public void over18StudentToBePartnered() { testPerson.setDemAge(20); - testPerson.setLes_c4(Les_c4.Student); + testPerson.setLabC4(Les_c4.Student); testPerson.setEduLeftEduFlag(false); testPerson.setDemMaleFlag(Gender.Female); testPerson.setBenefitUnit(testBenefitUnit); @@ -240,7 +240,7 @@ public void over18StudentToBePartnered() { @DisplayName("OUTCOME D: Aged 18-29, student and not partnered - estimate not to be partnered") public void over18StudentNotToBePartnered() { testPerson.setDemAge(20); - testPerson.setLes_c4(Les_c4.Student); + testPerson.setLabC4(Les_c4.Student); testPerson.setEduLeftEduFlag(false); testPerson.setDemMaleFlag(Gender.Female); testPerson.setBenefitUnit(testBenefitUnit); @@ -550,7 +550,7 @@ private void setupEducationLevelRegressionMock(double draw) { @DisplayName("OUTCOME A: Lagged Student < Min Age (Always Stays)") void remainsBelowMinAge() { testPerson.setDemAge(MIN_AGE_TO_LEAVE_EDUCATION - 1); - testPerson.setLes_c4_lag1(Les_c4.Student); + testPerson.setLabC4L1(Les_c4.Student); assertTrue(testPerson.inSchool()); } @@ -561,15 +561,15 @@ void continuesCurrentSpellE1a() { final double INNOVATION_TO_STAY = 0.1; testPerson.setDemAge(25); - testPerson.setLes_c4_lag1(Les_c4.Student); - testPerson.setLes_c4(Les_c4.Student); + testPerson.setLabC4L1(Les_c4.Student); + testPerson.setLabC4(Les_c4.Student); parametersMock.when(Parameters::getRegEducationE1a).thenReturn(mockBinomialRegression); Mockito.when(mockBinomialRegression.getProbability(Mockito.anyDouble())).thenReturn(PROBABILITY_TO_STAY); Mockito.when(mockInnovations.getDoubleDraw(24)).thenReturn(INNOVATION_TO_STAY); assertTrue(testPerson.inSchool()); - assertEquals(Les_c4.Student, testPerson.getLes_c4()); + assertEquals(Les_c4.Student, testPerson.getLabC4()); assertFalse(testPerson.isToLeaveSchool()); } @@ -580,7 +580,7 @@ void triggersE2FromE1aFailure() { final double INNOVATION_TO_LEAVE = 0.95; testPerson.setDemAge(25); - testPerson.setLes_c4_lag1(Les_c4.Student); + testPerson.setLabC4L1(Les_c4.Student); parametersMock.when(Parameters::getRegEducationE1a).thenReturn(mockBinomialRegression); Mockito.when(mockBinomialRegression.getProbability(Mockito.anyDouble())).thenReturn(PROBABILITY_TO_STAY); @@ -594,7 +594,7 @@ void triggersE2FromE1aFailure() { @DisplayName("E2 Trigger: Lagged Student, at Max Age (Forced Exit)") void triggersE2FromMaxAge() { testPerson.setDemAge(MAX_AGE_TO_STAY_IN_CONTINUOUS_EDUCATION + 1); - testPerson.setLes_c4_lag1(Les_c4.Student); + testPerson.setLabC4L1(Les_c4.Student); assertFalse(testPerson.inSchool()); assertTrue(testPerson.isToLeaveSchool()); @@ -603,7 +603,7 @@ void triggersE2FromMaxAge() { @Test @DisplayName("OUTCOME C: Lagged Retired (Cannot Re-enter)") void cannotEnterIfLaggedRetired() { - testPerson.setLes_c4_lag1(Les_c4.Retired); + testPerson.setLabC4L1(Les_c4.Retired); assertFalse(testPerson.inSchool()); assertFalse(testPerson.isToLeaveSchool()); @@ -615,17 +615,17 @@ void becomesStudentE1bSuccess() { final double PROBABILITY_TO_BECOME_STUDENT = 0.8; final double INNOVATION_TO_BECOME_STUDENT = 0.1; - testPerson.setLes_c4_lag1(Les_c4.NotEmployed); - testPerson.setLes_c4(Les_c4.NotEmployed); + testPerson.setLabC4L1(Les_c4.NotEmployed); + testPerson.setLabC4(Les_c4.NotEmployed); parametersMock.when(Parameters::getRegEducationE1b).thenReturn(mockBinomialRegression); Mockito.when(mockBinomialRegression.getProbability(Mockito.anyDouble())).thenReturn(PROBABILITY_TO_BECOME_STUDENT); Mockito.when(mockInnovations.getDoubleDraw(24)).thenReturn(INNOVATION_TO_BECOME_STUDENT); assertTrue(testPerson.inSchool()); - assertEquals(Les_c4.Student, testPerson.getLes_c4()); - assertEquals(Indicator.False, testPerson.getDed()); - assertEquals(Indicator.True, testPerson.getDer()); + assertEquals(Les_c4.Student, testPerson.getLabC4()); + assertEquals(Indicator.False, testPerson.getEduSpellFlag()); + assertEquals(Indicator.True, testPerson.getEduReturnFlag()); } @Test @@ -634,15 +634,15 @@ void remainsUnchangedE1bFailure() { final double PROBABILITY_TO_BECOME_STUDENT = 0.2; final double INNOVATION_REMAIN_UNCHANGED = 0.9; - testPerson.setLes_c4_lag1(Les_c4.EmployedOrSelfEmployed); - testPerson.setLes_c4(Les_c4.EmployedOrSelfEmployed); + testPerson.setLabC4L1(Les_c4.EmployedOrSelfEmployed); + testPerson.setLabC4(Les_c4.EmployedOrSelfEmployed); parametersMock.when(Parameters::getRegEducationE1b).thenReturn(mockBinomialRegression); Mockito.when(mockBinomialRegression.getProbability(Mockito.anyDouble())).thenReturn(PROBABILITY_TO_BECOME_STUDENT); Mockito.when(mockInnovations.getDoubleDraw(24)).thenReturn(INNOVATION_REMAIN_UNCHANGED); assertFalse(testPerson.inSchool()); - assertEquals(Les_c4.EmployedOrSelfEmployed, testPerson.getLes_c4()); + assertEquals(Les_c4.EmployedOrSelfEmployed, testPerson.getLabC4()); assertFalse(testPerson.isToLeaveSchool()); } @@ -651,53 +651,53 @@ void remainsUnchangedE1bFailure() { @Test @DisplayName("OUTCOME F (First Spell): Adopts New Level (Low -> High)") void firstSpellAdoptsNewLevel() { - testPerson.setDeh_c4(Education.Low); - testPerson.setDer(Indicator.False); + testPerson.setEduHighestC4(Education.Low); + testPerson.setEduReturnFlag(Indicator.False); setupEducationLevelRegressionMock(0.9); // -> High testPerson.setEducationLevel(); - assertEquals(Education.High, testPerson.getDeh_c4()); + assertEquals(Education.High, testPerson.getEduHighestC4()); } @Test @DisplayName("OUTCOME F (Return Spell Improvement): Adopts New, Higher Level") void returnSpellAdoptsHigherLevel() { - testPerson.setDeh_c4(Education.Low); - testPerson.setDer(Indicator.True); + testPerson.setEduHighestC4(Education.Low); + testPerson.setEduReturnFlag(Indicator.True); setupEducationLevelRegressionMock(0.5); // -> Medium testPerson.setEducationLevel(); - assertEquals(Education.Medium, testPerson.getDeh_c4()); + assertEquals(Education.Medium, testPerson.getEduHighestC4()); } @Test @DisplayName("OUTCOME G (Return Spell Downgrade): Retains Current Level") void returnSpellRetainsCurrentLevelOnDowngrade() { - testPerson.setDeh_c4(Education.Medium); - testPerson.setDer(Indicator.True); + testPerson.setEduHighestC4(Education.Medium); + testPerson.setEduReturnFlag(Indicator.True); setupEducationLevelRegressionMock(0.2); // -> Low testPerson.setEducationLevel(); - assertEquals(Education.Medium, testPerson.getDeh_c4()); + assertEquals(Education.Medium, testPerson.getEduHighestC4()); } @Test @DisplayName("OUTCOME G (Return Spell Same Level): Retains Current Level") void returnSpellRetainsCurrentLevelOnSameLevel() { - testPerson.setDeh_c4(Education.Medium); - testPerson.setDer(Indicator.True); + testPerson.setEduHighestC4(Education.Medium); + testPerson.setEduReturnFlag(Indicator.True); setupEducationLevelRegressionMock(0.5); // -> Medium testPerson.setEducationLevel(); - assertEquals(Education.Medium, testPerson.getDeh_c4()); + assertEquals(Education.Medium, testPerson.getEduHighestC4()); } // ----------------------- leavingSchool() ----------------------- @@ -707,36 +707,36 @@ void returnSpellRetainsCurrentLevelOnSameLevel() { void successfulExitExecution() { testPerson.setToLeaveSchool(true); testPerson.setDemAge(20); - testPerson.setDeh_c4(Education.Low); - testPerson.setDed(Indicator.True); - testPerson.setDer(Indicator.False); - testPerson.setLes_c4(Les_c4.Student); - testPerson.setLes_c4_lag1(Les_c4.Student); + testPerson.setEduHighestC4(Education.Low); + testPerson.setEduSpellFlag(Indicator.True); + testPerson.setEduReturnFlag(Indicator.False); + testPerson.setLabC4(Les_c4.Student); + testPerson.setLabC4L1(Les_c4.Student); setupEducationLevelRegressionMock(0.5); // -> Medium testPerson.leavingSchool(); assertFalse(testPerson.isToLeaveSchool()); - assertEquals(Indicator.False, testPerson.getDed()); - assertEquals(Indicator.False, testPerson.getDer()); + assertEquals(Indicator.False, testPerson.getEduSpellFlag()); + assertEquals(Indicator.False, testPerson.getEduReturnFlag()); assertTrue(testPerson.isLeftEducation()); - assertEquals(Les_c4.NotEmployed, testPerson.getLes_c4()); - assertEquals(Education.Medium, testPerson.getDeh_c4()); - assertEquals(Indicator.True, testPerson.getSedex()); + assertEquals(Les_c4.NotEmployed, testPerson.getLabC4()); + assertEquals(Education.Medium, testPerson.getEduHighestC4()); + assertEquals(Indicator.True, testPerson.getEduExitSampleFlag()); } @Test @DisplayName("When toLeaveSchool=False: Skips execution and leaves state intact") void noExecution() { testPerson.setToLeaveSchool(false); - testPerson.setLes_c4(Les_c4.EmployedOrSelfEmployed); - testPerson.setDeh_c4(Education.High); + testPerson.setLabC4(Les_c4.EmployedOrSelfEmployed); + testPerson.setEduHighestC4(Education.High); testPerson.leavingSchool(); - assertEquals(Les_c4.EmployedOrSelfEmployed, testPerson.getLes_c4()); - assertEquals(Education.High, testPerson.getDeh_c4()); + assertEquals(Les_c4.EmployedOrSelfEmployed, testPerson.getLabC4()); + assertEquals(Education.High, testPerson.getEduHighestC4()); assertFalse(testPerson.isLeftEducation()); Mockito.verify(mockInnovations, Mockito.never()).getDoubleDraw(30); }