Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Incorrect benefit-unit equivalence scale understates equivalised income for multi-adult units

未關閉 適合新手
#541 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
89/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
java
領域
backend, databases

研究方向

閱讀 src/main/java/simpaths/model/BenefitUnit.java 中的 BenefitUnit.getEquivalisedWeight(),並將成人權重與文件所述的尺度以及 src/main/java/simpaths/model/Household.java 中的家戶計算進行比較。檢查 issue 中描述的兩名成人案例:福利單位等值尺度應為1.5,月可支配收入為£3,000時,年等值收入應為£24,000。

由索引模型根據 Issue 內容生成。

描述

Problem

In BenefitUnit.getEquivalisedWeight(), firstAdult is initialised to true but never set to false. Consequently, every member aged at least AGE_TO_BECOME_RESPONSIBLE receives a weight of 1.0, rather than 1.0 for the first adult and 0.5 for subsequent adults.

This differs from the scale documented above the method and from the household calculation, which does update the flag.

Reproduction and effect

For a household containing one benefit unit with two adults aged 40 and 38, and total disposable income of £3,000 per month:

  • Expected equivalence scale: 1.5; annual equivalised income: £24,000.
  • Current benefit-unit calculation: 2.0; annual equivalised income: £18,000.
  • The household calculation correctly returns £24,000 for those same people and income.

The error therefore understates benefit-unit equivalised income by 25% in this example. Cash income itself is unchanged. It can affect quantities and regressors derived from benefit-unit equivalised income; the aggregate effect on model outputs has not been established by this check.

Proposed correction and verification

Setting the flag after the first adult's contribution resolves the tested cases:

if (firstAdult) {
    weight += 1.0;
    firstAdult = false;
} else {
    weight += 0.5;
}

The error remains in the latest shared code. Although the existing automated tests pass, a direct check shows that two adults receive an equivalence scale of 2 rather than 1.5.

主要語言
Java
星號
26
分支
38
平均合併
13 小時 5 分鐘
30 天內合併 PR
7

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

simpaths/SimPaths 的其他 Issue

查看 simpaths/SimPaths 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。