Skip to content

Commit

Permalink
modify soilwater-result.csv
Browse files Browse the repository at this point in the history
second commit
  • Loading branch information
jiadw007 committed Sep 19, 2013
1 parent 0426bc2 commit c4d808c
Show file tree
Hide file tree
Showing 6 changed files with 384 additions and 354 deletions.
Binary file modified bin/timeBasedSoilWaterCalculation.class
Binary file not shown.
Binary file modified bin/verify/soilWaterResult.class
Binary file not shown.
Binary file modified soil.xls
Binary file not shown.
700 changes: 350 additions & 350 deletions soilwater-result.csv

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/timeBasedSoilWaterCalculation.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public void writeDataToFile(){
for(int i =0;i<this.Ihrsoil.size();i++){

bw.write(this.b.Hour.get(i)+","+this.b.Rhr.get(i)+","+this.getIhrsoil().get(i)+","+b.ET0.get(i)+","+this.getET().get(i)+","+this.getWB().get(i)+","+this.getSWC().get(i+1)+","+this.getDelta().get(i)+","
+this.getF().get(i)+","+this.getRateF().get(i)+","+this.getQ().get(i)+","+this.getInF().get(i)+","+this.getPERC().get(i)+","+this.getLoss().get(i)+","+this.getPerLoss().get(i)+","+this.b.Ihr.get(i)
+","+this.getwLostHr().get(i)+","+this.getwLostDay().get(i)+","+this.getiLostHr().get(i)+","+this.getiLostDay().get(i));
+this.getF().get(i)+","+this.getRateF().get(i)+","+this.getQ().get(i)+","+this.getInF().get(i)+","+this.getPERC().get(i)+","+this.getLoss().get(i)+","+this.getPerLoss().get(i)
+","+this.getwLostHr().get(i)+","+this.getwLostDay().get(i)+","+this.getiLostHr().get(i)+","+this.getiLostDay().get(i)+","+this.b.Ihr.get(i));
bw.newLine();

}
Expand Down
34 changes: 32 additions & 2 deletions src/verify/soilWaterResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public class soilWaterResult {
private ArrayList<Double> PERC;
private ArrayList<Double> Loss;
private ArrayList<Double> PerLoss;
private ArrayList<Double> wLostHr;
private ArrayList<Double> wLostDay;
private ArrayList<Double> iLostHr;
private ArrayList<Double> iLostDay;

private String fileName;

/**
Expand All @@ -54,11 +59,16 @@ public soilWaterResult(String Filename){
this.PERC=new ArrayList<Double>();
this.Loss=new ArrayList<Double>();
this.PerLoss=new ArrayList<Double>();
wLostHr=new ArrayList<Double>();
wLostDay=new ArrayList<Double>();
iLostHr=new ArrayList<Double>();
iLostDay=new ArrayList<Double>();
this.fileName=Filename;
System.out.println(fileName);
try{

/*import jxl, get xls object*/
InputStream is=new FileInputStream(fileName);
InputStream is=new FileInputStream(this.fileName);
jxl.Workbook rwb=Workbook.getWorkbook(is);
jxl.Sheet rs=rwb.getSheet(0);

Expand All @@ -77,7 +87,10 @@ public soilWaterResult(String Filename){
this.Q.add(Double.parseDouble(cell[10].getContents()));
this.InF.add(Double.parseDouble(cell[11].getContents()));
this.PERC.add(Double.parseDouble(cell[12].getContents()));

this.wLostHr.add(Double.parseDouble(cell[15].getContents()));
this.wLostDay.add(Double.parseDouble(cell[16].getContents()));
this.iLostHr.add(Double.parseDouble(cell[17].getContents()));
this.iLostDay.add(Double.parseDouble(cell[18].getContents()));
}


Expand Down Expand Up @@ -150,6 +163,23 @@ public static void main(String args[]){

System.out.println("The Data in PERC "+(i+1)+"has error");

}else if(Math.abs(swr.wLostHr.get(i)-Double.parseDouble(item[15]))>=0.001){

System.out.println("The Data in wLostHr "+(i+1)+"has error");

}else if(Math.abs(swr.wLostDay.get(i)-Double.parseDouble(item[16]))>=0.001){
System.out.println(swr.wLostDay.get(i));
System.out.println(Double.parseDouble(item[16]));
System.out.println("The Data in wLostDay "+(i+1)+"has error");

}else if(Math.abs(swr.iLostHr.get(i)-Double.parseDouble(item[17]))>=0.001){

System.out.println("The Data in iLostHr "+(i+1)+"has error");

}else if(Math.abs(swr.iLostDay.get(i)-Double.parseDouble(item[18]))>=0.001){

System.out.println("The Data in iLostDay "+(i+1)+"has error");

}else{

correctCount++;
Expand Down

0 comments on commit c4d808c

Please sign in to comment.