-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
app/src/main/java/com/sf/stormwaterutilityandroid/WaterWay/WQI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.sf.stormwaterutilityandroid.WaterWay; | ||
|
||
public class WQI { | ||
private double CT_temperature_change = 0; | ||
private double CT_turbidity = 0; | ||
private double CT_pH = 0; | ||
private double CT_nitrate = 0; | ||
private double CT_total_phosphate = 0; | ||
private double CT_dissolved_oxygen = 0; | ||
|
||
WQI(double CT_temperature_change, double CT_turbidity, double CT_pH, double CT_nitrate, double CT_total_phosphate, | ||
double CT_dissolved_oxygen) { | ||
this.CT_temperature_change = CT_temperature_change; | ||
this.CT_turbidity = CT_turbidity; | ||
this.CT_pH = CT_pH; | ||
this.CT_nitrate = CT_nitrate; | ||
this.CT_total_phosphate = CT_total_phosphate; | ||
this.CT_dissolved_oxygen = CT_dissolved_oxygen; | ||
} | ||
|
||
public double calculateWQI() { | ||
double WQIScore = CT_temperature_change * 0.11 + CT_turbidity * 0.09 + CT_pH * 0.12 + CT_nitrate * 0.1 + | ||
CT_total_phosphate * 0.11 + CT_dissolved_oxygen * 0.18; | ||
|
||
return WQIScore; | ||
} | ||
|
||
public static double getWQI(double tempChange, double turbidity, double pH, double nitrate, double phosphate, double oxygen) { | ||
return tempChange * 0.11 + turbidity * 0.09 + pH * 0.12 + nitrate * 0.1 + phosphate * 0.11 + oxygen * 0.18; | ||
} | ||
} |