Closed sourcejedi closed 4 years ago
OK, I understand it now.
In "API Mode 2", the app calculates risk scores and tests them against a threshold in ExposureWindowRiskCalculator
and ExposureWindowRiskManager
. ExposureWindow
refers to part of the new API. This mode includes the more precise distance calculation. The calculation using the distance is performed in riskscore-kt (packages uk.nhs.riskscore.*
).
"API Mode 2" uses the daysSinceOnsetToInfectiousness
config. It does not use a smooth curve of infectiousness. It calculates either 100% infectious ("high"), or 40% infectious ("normal"), depending on days since symptom onset. After accounting duration, distance, and infectiousness, the threshold score is 120 points.
If "API Mode 2" is not available, the app calculates risk scores and tests them against a threshold in RiskCalculator
[sic] and ExposureInformationRiskManager
. In this case, the distance is only known as 0-2m, 2-4m, or 4m+. 4m+ is ignored. The infectiousness is calculated using the smooth infectiousness curve / formula shown in issue #6.
This explanation applies to git version 36ba4bd, "Changes for 2020-10-29".
Thank you for the detailed explanation in issue #6 . Is there a problem in
ExposureWindow.riskScore()
?riskScoreCalculator.calculate()
calculates infectiousness from days from onset, using a formula. We then multiply this byinfectiousnessFactor()
.infectiousnessFactor()
is calculated fromExposureWindow.infectiousness
. But I think this is also calculated from days from onset.I think this would cause the infectiousness curve to fall faster than it is supposed to.
https://github.com/nhsx/covid-19-app-android-ag-public/blob/36ba4bd/app/src/main/java/uk/nhs/nhsx/covid19/android/app/exposure/encounter/calculation/ExposureWindowRiskCalculator.kt#L55
I believe the
daysToInfectiousness
values used are defined here:https://github.com/nhsx/covid19-app-system-public/commit/621f1c8a5f0dd17984c313ff9d4f5a61548d3d13#diff-c2b1334f0a4a1bf2207e788ffdfd602d5177f43bdd515b726a7b69fda25e88b5R64