Skip to content

Commit

Permalink
Integrated formulas for WQI, HEI, and PTI
Browse files Browse the repository at this point in the history
  • Loading branch information
jparrell committed Apr 11, 2021
1 parent 0b4b110 commit 59b137e
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ public void onClick(View v) {
WaterWayDoubleFields.put("BM_fairly_tolerant", fairTolerantVal);
WaterWayDoubleFields.put("BM_very_tolerant", veryTolerantVal);

WaterWayDoubleFields.put("WQI", new Double(0.0));
WaterWayDoubleFields.put("HEI", new Double(0.0));
WaterWayDoubleFields.put("PTI", new Double(0.0));
WaterWayDoubleFields.put("WQI", calculateWQI());
WaterWayDoubleFields.put("HEI", calculate_HEI());
WaterWayDoubleFields.put("PTI", calculatePTI());

//Boolean Fields
WaterWayBoolFields.put("DWS_needs_maintenance", needMaintenance);
Expand Down Expand Up @@ -313,7 +313,23 @@ public void onClick(View v) {

return root;
}
private double calculate_HEI()
{
return subVal + smothVal + siltVal + rootVal + overVegVal +
oxVal + downVal + shallowVal + watVal + deepVal +
logVal + bouldVal + underVal + 2 * (sinVal + natVal) +
ripVal + landVal + bankVal + streamVal + deepestVal +
velocityVal + riffleDepthVal + riffleSubstrateVal;
}
private double calculatePTI() {
return 4.0 * intolerantVal + 3.0 * modTolerantVal + 2.0 * fairTolerantVal + 1.0 * veryTolerantVal;
}
private double calculateWQI() {
double WQIScore = tempVal * 0.11 + turbidityVal * 0.09 + phVal * 0.12 + nitrateVal * 0.1 +
phosphateVal * 0.11 + oxygenVal * 0.18;

return WQIScore;
}
private void setupFormGen() {

boolgen = true;
Expand Down

0 comments on commit 59b137e

Please sign in to comment.