|
|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.support.normalizing.batch; |
|
|
|
|
|
|
|
import com.epmet.support.normalizing.Correlation; |
|
|
|
import com.epmet.support.normalizing.ScoreCalculator; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
@ -70,9 +71,13 @@ public class BatchScoreCalculator { |
|
|
|
if (maxValue.compareTo(minValue) == 0) { |
|
|
|
//*((max-min)/ (Math.PI/2))+min
|
|
|
|
//Math.atan(new Double(vo.getSampleValue().toString()))*
|
|
|
|
normalizeValue = new BigDecimal(Math.atan(new Double(vo.getSampleValue().toString()))) |
|
|
|
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) |
|
|
|
.multiply( |
|
|
|
(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.UNNECESSARY))).add(minValue).setScale(6, RoundingMode.HALF_UP); |
|
|
|
//
|
|
|
|
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) { |
|
|
|
normalizeValue = maxValue.subtract(normalizeValue); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|