|
|
@ -76,19 +76,24 @@ public class BatchScoreCalculator { |
|
|
|
if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) { |
|
|
|
//*((max-min)/ (Math.PI/2))+min
|
|
|
|
//Math.atan(new Double(vo.getSampleValue().toString()))*
|
|
|
|
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) |
|
|
|
.multiply( |
|
|
|
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) |
|
|
|
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
|
|
|
|
if (Correlation.POSITIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) { |
|
|
|
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) |
|
|
|
.multiply( |
|
|
|
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) |
|
|
|
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP); |
|
|
|
}else{ |
|
|
|
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) |
|
|
|
.multiply( |
|
|
|
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)).multiply(new BigDecimal(-1))) |
|
|
|
.add(maxScoreValue).setScale(6, RoundingMode.HALF_UP); |
|
|
|
} |
|
|
|
} else { |
|
|
|
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); |
|
|
|
} |
|
|
|
//如果是负相关 则用100-归一后的值为最大值减
|
|
|
|
/* //如果是负相关 则用100-归一后的值为最大值减
|
|
|
|
if (Correlation.NEGATIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) { |
|
|
|
normalizeValue = maxScoreValue.subtract(normalizeValue); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|
//如果归一后的值小于0 则置为0
|
|
|
|
if (normalizeValue.compareTo(NumConstant.ZERO_DECIMAL)<=-1){ |
|
|
|