* 리포트 결과값을 계산합니다
* @param sampleform
* @return Report
*/
public Report computeReport(Sampleform sampleform,Project projectForm) {
Report reportBean = new Report();
reportBean.setProUid(projectForm.getProUid());
reportBean.setSampleCount(sampleform.getIteration());
reportBean.setSampleAve(sampleform.getTotAvailability());
reportBean.setIterationArr(sampleform.getIterationArr());
reportBean.setStepFigName(sampleform.getStepFigName());
if (reportBean.getIterationArr() != null) {
for (int i=0;i<reportBean.getIterationArr().length;i++) {
reportBean.setTempiterationArr((reportBean.getTempiterationArr()+String.valueOf(reportBean.getIterationArr()[i]+"||")).trim());
}
}
/*if (reportBean.getStepFigName() != null) {
for (int i=0;i<reportBean.getStepFigName().length;i++) {
reportBean.setTempstepFigName((reportBean.getTempstepFigName()+reportBean.getStepFigName()[i]+"||").trim());
}
}*/
if (sampleform.getStepAve()[0].length > 0) {
String TempstepFigName = "";
for (int i=0;i<sampleform.getStepAve()[0].length;i++) {
TempstepFigName += sampleform.getStepAve()[0][i]+";;;"+sampleform.getStepAve()[1][i]+"||";
TempstepFigName.trim();
}
reportBean.setTempstepFigName(TempstepFigName);
}
//표준편차
for (int i=0;i<reportBean.getIterationArr().length;i++) {
reportBean.setVariance(reportBean.getVariance()+Math.pow(((double)(reportBean.getIterationArr()[i]*100)-sampleform.getTotAvailability()),2d));
}
reportBean.setVariance(reportBean.getVariance()/(sampleform.getIteration()-1));
reportBean.setStdDeviation(Math.sqrt(reportBean.getVariance()));
//신뢰수준 68%
reportBean.setConfidenceLevel68st(reportBean.getSampleAve()-(reportBean.getStdDeviation()/Math.sqrt(reportBean.getSampleCount())));
reportBean.setConfidenceLevel68ed(reportBean.getSampleAve()+(reportBean.getStdDeviation()/Math.sqrt(reportBean.getSampleCount())));
//신뢰수준 95%
reportBean.setConfidenceLevel95st(reportBean.getSampleAve()-1.96*(reportBean.getStdDeviation()/Math.sqrt(reportBean.getSampleCount())));
reportBean.setConfidenceLevel95ed(reportBean.getSampleAve()+1.96*(reportBean.getStdDeviation()/Math.sqrt(reportBean.getSampleCount())));
//신뢰수준 99%
reportBean.setConfidenceLevel99st(reportBean.getSampleAve()-2.54*(reportBean.getStdDeviation()/Math.sqrt(reportBean.getSampleCount())));
reportBean.setConfidenceLevel99ed(reportBean.getSampleAve()+2.54*(reportBean.getStdDeviation()/Math.sqrt(reportBean.getSampleCount())));
return reportBean;
}