Skip to content
Snippets Groups Projects
Commit c434049b authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Bugfix in warning status determination

Added INFECTION_THRESHOLD as result parameter
parent cad222a0
No related branches found
No related tags found
No related merge requests found
...@@ -96,17 +96,18 @@ public class NegativePrognosisModel extends I18nImpl implements Model{ ...@@ -96,17 +96,18 @@ public class NegativePrognosisModel extends I18nImpl implements Model{
result.setValue(this.getModelId().toString(), DataMatrix.DAILY_CONTRIB_D, this.dataMatrix.getDefaultFormattedValueForDate(currentDate, DataMatrix.DAILY_CONTRIB_D)); result.setValue(this.getModelId().toString(), DataMatrix.DAILY_CONTRIB_D, this.dataMatrix.getDefaultFormattedValueForDate(currentDate, DataMatrix.DAILY_CONTRIB_D));
result.setValue(this.getModelId().toString(), DataMatrix.DAILY_CONTRIB, this.dataMatrix.getDefaultFormattedValueForDate(currentDate, DataMatrix.DAILY_CONTRIB)); result.setValue(this.getModelId().toString(), DataMatrix.DAILY_CONTRIB, this.dataMatrix.getDefaultFormattedValueForDate(currentDate, DataMatrix.DAILY_CONTRIB));
result.setValue(this.getModelId().toString(), DataMatrix.AGGREGATED_CONTRIB, this.dataMatrix.getDefaultFormattedValueForDate(currentDate, DataMatrix.AGGREGATED_CONTRIB)); result.setValue(this.getModelId().toString(), DataMatrix.AGGREGATED_CONTRIB, this.dataMatrix.getDefaultFormattedValueForDate(currentDate, DataMatrix.AGGREGATED_CONTRIB));
result.setValue(this.getModelId().toString(), "INFECTION_THRESHOLD", String.valueOf(this.INFECTION_THRESHOLD));
// Deciding warning status // Deciding warning status
Double aggregatedContribution = this.dataMatrix.getParamDoubleValueForDate(currentDate, DataMatrix.AGGREGATED_CONTRIB); Double aggregatedContribution = this.dataMatrix.getParamDoubleValueForDate(currentDate, DataMatrix.AGGREGATED_CONTRIB);
Double dailyContribution = this.dataMatrix.getParamDoubleValueForDate(currentDate, DataMatrix.DAILY_CONTRIB); Double dailyContribution = this.dataMatrix.getParamDoubleValueForDate(currentDate, DataMatrix.DAILY_CONTRIB);
Integer warningStatus = 2; Integer warningStatus = 2;
// If aggregated contribution < INFECTION_THRESHOLD: NO RISK // If aggregated contribution < INFECTION_THRESHOLD: NO RISK
if(aggregatedContribution <= this.INFECTION_THRESHOLD) if(aggregatedContribution >= this.INFECTION_THRESHOLD)
{ {
// If aggregated contribution >= INFECTION_THRESHOLD and daily contribution <= INFECTION_DAILY_CONTRIBUTION_THRESHOLD: MEDIUM RISK // If aggregated contribution >= INFECTION_THRESHOLD and daily contribution <= INFECTION_DAILY_CONTRIBUTION_THRESHOLD: MEDIUM RISK
warningStatus = 3; warningStatus = 3;
// If aggregated contributin >= INFECTION_THRESHOLD and daily contribution > INFECTION_DAILY_CONTRIBUTION_THRESHOLD: HIGH RISK // If aggregated contributin >= INFECTION_THRESHOLD and daily contribution > INFECTION_DAILY_CONTRIBUTION_THRESHOLD: HIGH RISK
if(dailyContribution >this.INFECTION_DAILY_CONTRIBUTION_THRESHOLD) if(dailyContribution > this.INFECTION_DAILY_CONTRIBUTION_THRESHOLD)
{ {
warningStatus = 4; warningStatus = 4;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment