Skip to content
Snippets Groups Projects
Commit fc823eec authored by jtn's avatar jtn
Browse files

Minor modifications to the model

Inn FinnCerealModels the different risk levels have been added. Now the
model will give a low level warning if accumulated risk is over 50 and a
high level warning if the accumulated risk is over 100.
The model-constants has been modified to use new values for calculating
the accumulated risk value from the daily risk value.
parent 9eed4280
Branches
Tags
2 merge requests!4Aalto spring2019,!2Aalto spring2019
Pipeline #107 failed
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
......@@ -19,6 +19,8 @@ org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
......@@ -30,7 +30,7 @@
"]20,25]":{ "[0,4]":{ "Value":0 }, "]4,6]":{ "Value":0.7 }, "]6,8]":{ "Value":1 }, "]8,[":{ "Value":1 } },
"]25,[":{ "[0,4]":{ "Value":0 }, "]4,6]":{ "Value":1 }, "]6,8]":{ "Value":1 }, "]8,[":{ "Value":1 } }
},
"AccumulatedRisk":{ "[0,5[":{ "Value":0 }, "[5,33[":{ "Value":3 }, "[33,70[":{ "Value":5 }, "[70,92[":{ "Value":10 }, "[92,116[":{ "Value":10 }, "[116,[":{ "Value":15 } }
"AccumulatedRisk":{ "[0,10[":{ "Value":0 }, "[10,71[":{ "Value":1 }, "[71,151[":{ "Value":2.5 }, "[151,201[":{ "Value":5 }, "[201,251[":{ "Value":5 }, "[251,[":{ "Value":7.5 } }
},
"DrechsleraTriticiRepentis":{
"PrecedingCrop":{
......@@ -64,7 +64,7 @@
"]20,25]":{ "[0,3]":{ "Value":0 }, "]3,6]":{ "Value":0.2 }, "]6,12]":{ "Value":0.6 }, "]12,24]":{ "Value":1 }, "]24,[":{ "Value":1 } },
"]25,[":{ "[0,3]":{ "Value":0 }, "]3,6]":{ "Value":0.2 }, "]6,12]":{ "Value":0.3 }, "]12,24]":{ "Value":1 }, "]24,[":{ "Value":1 } }
},
"AccumulatedRisk":{ "[0,10[":{ "Value":0 }, "[10,71[":{ "Value":2.5 }, "[71,151[":{ "Value":5 }, "[151,201[":{ "Value":10 }, "[201,251[":{ "Value":10 }, "[251,[":{ "Value":15 } }
"AccumulatedRisk":{ "[0,10[":{ "Value":0 }, "[10,71[":{ "Value":1 }, "[71,151[":{ "Value":2.5 }, "[151,201[":{ "Value":5 }, "[201,251[":{ "Value":5 }, "[251,[":{ "Value":7.5 } }
},
"StagonosporaNodorum":{
"PrecedingCrop":{
......
......@@ -46,6 +46,10 @@ public class FinnCerealModels implements Model {
private TimeZone zone;
private String pathogen;
// warning status limits; these define the upper limits for the corresponding risk category
private int noRisk = 50; // no risk warning required
private int lowRisk = 100; // low risk warning; if the value is higher than this high risk warning is given
@Override
public String getCopyright() {
// TODO Auto-generated method stub
......@@ -78,7 +82,7 @@ public class FinnCerealModels implements Model {
@Override
public String getModelName() {
return "Model for pyrenophora teres, dreschlera triciti-repentis, and stagonospora nodorum";
return "Model for net blotch (pyrenophora teres), tan spot (pyrenophora triciti-repentis), and stagonospora blotch (s. nodorum)";
}
@Override
......@@ -146,8 +150,14 @@ public class FinnCerealModels implements Model {
accumulatedRisk += m.getAccumulatedRisk();
r.setValue(pathogen, "DAILY_ACCUMULATION", "" + accumulatedRisk);
r.setValidTimeStart(currentDate);
// TODO give each result the correct warning status
r.setWarningStatus(Result.WARNING_STATUS_NO_RISK);
// TODO create means to dynamically set warning statuses
if(accumulatedRisk < noRisk) {
r.setWarningStatus(Result.WARNING_STATUS_NO_RISK);
} else if (accumulatedRisk < lowRisk) {
r.setWarningStatus(Result.WARNING_STATUS_MINOR_RISK);
} else {
r.setWarningStatus(Result.WARNING_STATUS_HIGH_RISK);
}
resultList.add(r);
}
return resultList;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment