微调
This commit is contained in:
@@ -41,6 +41,7 @@ import com.njcn.gather.util.StorageUtil;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.log4j.Log4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@ import java.util.stream.Stream;
|
|||||||
* @description
|
* @description
|
||||||
* @date 2024/12/20 13:52
|
* @date 2024/12/20 13:52
|
||||||
*/
|
*/
|
||||||
|
@Log4j
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DetectionServiceImpl {
|
public class DetectionServiceImpl {
|
||||||
@@ -2286,14 +2288,59 @@ public class DetectionServiceImpl {
|
|||||||
public Map<String, List<List<Double>>> devListMap(Map<String, List<List<Double>>> phaseValueList, DictDataEnum dataRule, boolean isRemoveMaxElement) {
|
public Map<String, List<List<Double>>> devListMap(Map<String, List<List<Double>>> phaseValueList, DictDataEnum dataRule, boolean isRemoveMaxElement) {
|
||||||
Map<String, List<List<Double>>> resultMap = new HashMap<>(3);
|
Map<String, List<List<Double>>> resultMap = new HashMap<>(3);
|
||||||
|
|
||||||
List<Double> aDev = BeanUtil.copyToList(phaseValueList.get(TYPE_A).get(0), Double.class);
|
List<Double> aDev = new ArrayList<>();
|
||||||
List<Double> aStandardDev = BeanUtil.copyToList(phaseValueList.get(TYPE_A).get(1), Double.class);
|
List<Double> aStandardDev = new ArrayList<>();
|
||||||
List<Double> bDev = BeanUtil.copyToList(phaseValueList.get(TYPE_B).get(0), Double.class);
|
|
||||||
List<Double> bStandardDev = BeanUtil.copyToList(phaseValueList.get(TYPE_B).get(1), Double.class);
|
if (phaseValueList.containsKey(TYPE_A)) {
|
||||||
List<Double> cDev = BeanUtil.copyToList(phaseValueList.get(TYPE_C).get(0), Double.class);
|
if (phaseValueList.get(TYPE_A).size() >= 1) {
|
||||||
List<Double> cStandardDev = BeanUtil.copyToList(phaseValueList.get(TYPE_C).get(1), Double.class);
|
aDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_A).get(0), Double.class));
|
||||||
List<Double> tDev = BeanUtil.copyToList(phaseValueList.get(TYPE_T).get(0), Double.class);
|
aStandardDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_A).get(1), Double.class));
|
||||||
List<Double> tStandardDev = BeanUtil.copyToList(phaseValueList.get(TYPE_T).get(1), Double.class);
|
} else {
|
||||||
|
log.error("数据异常,phaseValueList.get(TYPE_A).size()=" + phaseValueList.get(TYPE_A).size());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.equals("数据异常,phaseValueList.containsKey(TYPE_A)=" + phaseValueList.containsKey(TYPE_A));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Double> bDev = new ArrayList<>();
|
||||||
|
List<Double> bStandardDev = new ArrayList<>();
|
||||||
|
|
||||||
|
if (phaseValueList.containsKey(TYPE_B)) {
|
||||||
|
if (phaseValueList.get(TYPE_B).size() >= 1) {
|
||||||
|
bDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_B).get(0), Double.class));
|
||||||
|
bStandardDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_B).get(1), Double.class));
|
||||||
|
} else {
|
||||||
|
log.error("数据异常,phaseValueList.get(TYPE_B).size()=" + phaseValueList.get(TYPE_B).size());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.equals("数据异常,phaseValueList.containsKey(TYPE_B)=" + phaseValueList.containsKey(TYPE_B));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Double> cDev = new ArrayList<>();
|
||||||
|
List<Double> cStandardDev = new ArrayList<>();
|
||||||
|
if (phaseValueList.containsKey(TYPE_C)) {
|
||||||
|
if (phaseValueList.get(TYPE_C).size() >= 1) {
|
||||||
|
cDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_C).get(0), Double.class));
|
||||||
|
cStandardDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_C).get(1), Double.class));
|
||||||
|
} else {
|
||||||
|
log.error("数据异常,phaseValueList.get(TYPE_C).size()=" + phaseValueList.get(TYPE_C).size());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.equals("数据异常,phaseValueList.containsKey(TYPE_C)=" + phaseValueList.containsKey(TYPE_C));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Double> tDev = new ArrayList<>();
|
||||||
|
List<Double> tStandardDev = new ArrayList<>();
|
||||||
|
if (phaseValueList.containsKey(TYPE_T)) {
|
||||||
|
if (phaseValueList.get(TYPE_T).size() >= 1) {
|
||||||
|
tDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_T).get(0), Double.class));
|
||||||
|
tStandardDev.addAll(BeanUtil.copyToList(phaseValueList.get(TYPE_T).get(1), Double.class));
|
||||||
|
} else {
|
||||||
|
log.error("数据异常,phaseValueList.get(TYPE_T).size()=" + phaseValueList.get(TYPE_T).size());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.equals("数据异常,phaseValueList.containsKey(TYPE_T)=" + phaseValueList.containsKey(TYPE_T));
|
||||||
|
}
|
||||||
|
|
||||||
if (isRemoveMaxElement) {
|
if (isRemoveMaxElement) {
|
||||||
List<Double> aErrorValueList = new ArrayList<>();
|
List<Double> aErrorValueList = new ArrayList<>();
|
||||||
@@ -2350,12 +2397,12 @@ public class DetectionServiceImpl {
|
|||||||
tDev.addAll(newArray);
|
tDev.addAll(newArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Integer> aIdxs = DetectionUtil.sort(aStandardDev, false);
|
|
||||||
List<Integer> bIdxs = DetectionUtil.sort(bStandardDev, false);
|
|
||||||
List<Integer> cIdxs = DetectionUtil.sort(cStandardDev, false);
|
|
||||||
List<Integer> tIdxs = DetectionUtil.sort(tStandardDev, false);
|
|
||||||
switch (dataRule) {
|
switch (dataRule) {
|
||||||
case SECTION_VALUE:
|
case SECTION_VALUE: {
|
||||||
|
List<Integer> aIdxs = DetectionUtil.sort(aStandardDev, false);
|
||||||
|
List<Integer> bIdxs = DetectionUtil.sort(bStandardDev, false);
|
||||||
|
List<Integer> cIdxs = DetectionUtil.sort(cStandardDev, false);
|
||||||
|
List<Integer> tIdxs = DetectionUtil.sort(tStandardDev, false);
|
||||||
if (aStandardDev.size() > 2) {
|
if (aStandardDev.size() > 2) {
|
||||||
aStandardDev.remove(0);
|
aStandardDev.remove(0);
|
||||||
aStandardDev.remove(aStandardDev.size() - 1);
|
aStandardDev.remove(aStandardDev.size() - 1);
|
||||||
@@ -2363,7 +2410,6 @@ public class DetectionServiceImpl {
|
|||||||
aDev.clear();
|
aDev.clear();
|
||||||
aDev.addAll(newArray);
|
aDev.addAll(newArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bStandardDev.size() > 2) {
|
if (bStandardDev.size() > 2) {
|
||||||
bStandardDev.remove(0);
|
bStandardDev.remove(0);
|
||||||
bStandardDev.remove(bStandardDev.size() - 1);
|
bStandardDev.remove(bStandardDev.size() - 1);
|
||||||
@@ -2371,7 +2417,6 @@ public class DetectionServiceImpl {
|
|||||||
bDev.clear();
|
bDev.clear();
|
||||||
bDev.addAll(newArray);
|
bDev.addAll(newArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cStandardDev.size() > 2) {
|
if (cStandardDev.size() > 2) {
|
||||||
cStandardDev.remove(0);
|
cStandardDev.remove(0);
|
||||||
cStandardDev.remove(cStandardDev.size() - 1);
|
cStandardDev.remove(cStandardDev.size() - 1);
|
||||||
@@ -2379,7 +2424,6 @@ public class DetectionServiceImpl {
|
|||||||
cDev.clear();
|
cDev.clear();
|
||||||
cDev.addAll(newArray);
|
cDev.addAll(newArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tStandardDev.size() > 2) {
|
if (tStandardDev.size() > 2) {
|
||||||
tStandardDev.remove(0);
|
tStandardDev.remove(0);
|
||||||
tStandardDev.remove(tStandardDev.size() - 1);
|
tStandardDev.remove(tStandardDev.size() - 1);
|
||||||
@@ -2387,8 +2431,13 @@ public class DetectionServiceImpl {
|
|||||||
tDev.clear();
|
tDev.clear();
|
||||||
tDev.addAll(newArray);
|
tDev.addAll(newArray);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
case CP95_VALUE:
|
break;
|
||||||
|
case CP95_VALUE: {
|
||||||
|
List<Integer> aIdxs = DetectionUtil.sort(aStandardDev, false);
|
||||||
|
List<Integer> bIdxs = DetectionUtil.sort(bStandardDev, false);
|
||||||
|
List<Integer> cIdxs = DetectionUtil.sort(cStandardDev, false);
|
||||||
|
List<Integer> tIdxs = DetectionUtil.sort(tStandardDev, false);
|
||||||
if (CollUtil.isNotEmpty(aStandardDev)) {
|
if (CollUtil.isNotEmpty(aStandardDev)) {
|
||||||
int cp95Idx = DetectionUtil.getCP95Idx(aStandardDev);
|
int cp95Idx = DetectionUtil.getCP95Idx(aStandardDev);
|
||||||
aStandardDev = Collections.singletonList(aStandardDev.get(cp95Idx));
|
aStandardDev = Collections.singletonList(aStandardDev.get(cp95Idx));
|
||||||
@@ -2399,20 +2448,18 @@ public class DetectionServiceImpl {
|
|||||||
bStandardDev = Collections.singletonList(bStandardDev.get(cp95Idx));
|
bStandardDev = Collections.singletonList(bStandardDev.get(cp95Idx));
|
||||||
bDev = Collections.singletonList(bDev.get(bIdxs.get(cp95Idx)));
|
bDev = Collections.singletonList(bDev.get(bIdxs.get(cp95Idx)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(cStandardDev)) {
|
if (CollUtil.isNotEmpty(cStandardDev)) {
|
||||||
int cp95Idx = DetectionUtil.getCP95Idx(cStandardDev);
|
int cp95Idx = DetectionUtil.getCP95Idx(cStandardDev);
|
||||||
cStandardDev = Collections.singletonList(cStandardDev.get(cp95Idx));
|
cStandardDev = Collections.singletonList(cStandardDev.get(cp95Idx));
|
||||||
cDev = Collections.singletonList(cDev.get(cIdxs.get(cp95Idx)));
|
cDev = Collections.singletonList(cDev.get(cIdxs.get(cp95Idx)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(tStandardDev)) {
|
if (CollUtil.isNotEmpty(tStandardDev)) {
|
||||||
int cp95Idx = DetectionUtil.getCP95Idx(tStandardDev);
|
int cp95Idx = DetectionUtil.getCP95Idx(tStandardDev);
|
||||||
tStandardDev = Collections.singletonList(tStandardDev.get(cp95Idx));
|
tStandardDev = Collections.singletonList(tStandardDev.get(cp95Idx));
|
||||||
tDev = Collections.singletonList(tDev.get(tIdxs.get(cp95Idx)));
|
tDev = Collections.singletonList(tDev.get(tIdxs.get(cp95Idx)));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AVG_VALUE:
|
case AVG_VALUE:
|
||||||
aDev = DetectionUtil.getAvgDoubles(aDev);
|
aDev = DetectionUtil.getAvgDoubles(aDev);
|
||||||
bDev = DetectionUtil.getAvgDoubles(bDev);
|
bDev = DetectionUtil.getAvgDoubles(bDev);
|
||||||
@@ -2425,54 +2472,82 @@ public class DetectionServiceImpl {
|
|||||||
tStandardDev = DetectionUtil.getAvgDoubles(tStandardDev);
|
tStandardDev = DetectionUtil.getAvgDoubles(tStandardDev);
|
||||||
break;
|
break;
|
||||||
case Own_value:
|
case Own_value:
|
||||||
List<Double> newArray = DetectionUtil.getNewArray(aDev, aIdxs);
|
|
||||||
aDev.clear();
|
|
||||||
aDev.addAll(newArray);
|
|
||||||
|
|
||||||
newArray = DetectionUtil.getNewArray(bDev, bIdxs);
|
|
||||||
bDev.clear();
|
|
||||||
bDev.addAll(newArray);
|
|
||||||
|
|
||||||
newArray = DetectionUtil.getNewArray(cDev, cIdxs);
|
|
||||||
cDev.clear();
|
|
||||||
cDev.addAll(newArray);
|
|
||||||
|
|
||||||
newArray = DetectionUtil.getNewArray(tDev, tIdxs);
|
|
||||||
tDev.clear();
|
|
||||||
tDev.addAll(newArray);
|
|
||||||
break;
|
break;
|
||||||
case AT_WILL_VALUE:
|
case AT_WILL_VALUE:
|
||||||
if (CollUtil.isNotEmpty(aStandardDev)) {
|
if (isRemoveMaxElement) {
|
||||||
aStandardDev = aStandardDev.subList(0, 1);
|
if (CollUtil.isNotEmpty(aStandardDev) && CollUtil.isNotEmpty(aDev)) {
|
||||||
}
|
aStandardDev = aStandardDev.subList(aStandardDev.size() - 1, aStandardDev.size());
|
||||||
if (CollUtil.isNotEmpty(aDev)) {
|
aDev = aDev.subList(aDev.size() - 1, aDev.size());
|
||||||
Double v = aDev.get(aIdxs.get(0));
|
}
|
||||||
aDev.clear();
|
if (CollUtil.isNotEmpty(bStandardDev) && CollUtil.isNotEmpty(bDev)) {
|
||||||
aDev.add(v);
|
bStandardDev = bStandardDev.subList(bStandardDev.size() - 1, bStandardDev.size());
|
||||||
}
|
bDev = bDev.subList(bDev.size() - 1, bDev.size());
|
||||||
if (CollUtil.isNotEmpty(bStandardDev)) {
|
}
|
||||||
bStandardDev = bStandardDev.subList(0, 1);
|
if (CollUtil.isNotEmpty(cStandardDev) && CollUtil.isNotEmpty(cDev)) {
|
||||||
}
|
cStandardDev = cStandardDev.subList(cStandardDev.size() - 1, cStandardDev.size());
|
||||||
if (CollUtil.isNotEmpty(bDev)) {
|
cDev = cDev.subList(cDev.size() - 1, cDev.size());
|
||||||
Double v = bDev.get(bIdxs.get(0));
|
}
|
||||||
bDev.clear();
|
if (CollUtil.isNotEmpty(tStandardDev) && CollUtil.isNotEmpty(tDev)) {
|
||||||
bDev.add(v);
|
tStandardDev = tStandardDev.subList(tStandardDev.size() - 1, tStandardDev.size());
|
||||||
}
|
tDev = tDev.subList(tDev.size() - 1, tDev.size());
|
||||||
if (CollUtil.isNotEmpty(cStandardDev)) {
|
}
|
||||||
cStandardDev = cStandardDev.subList(0, 1);
|
} else {
|
||||||
}
|
List<Double> aErrorValueList = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(cDev)) {
|
List<Double> bErrorValueList = new ArrayList<>();
|
||||||
Double v = cDev.get(cIdxs.get(0));
|
List<Double> cErrorValueList = new ArrayList<>();
|
||||||
cDev.clear();
|
List<Double> tErrorValueList = new ArrayList<>();
|
||||||
cDev.add(v);
|
for (int i = 0; i < aStandardDev.size(); i++) {
|
||||||
}
|
aErrorValueList.add(Math.abs(aStandardDev.get(i) - aDev.get(i)));
|
||||||
if (CollUtil.isNotEmpty(tStandardDev)) {
|
}
|
||||||
tStandardDev = tStandardDev.subList(0, 1);
|
for (int i = 0; i < bStandardDev.size(); i++) {
|
||||||
}
|
bErrorValueList.add(Math.abs(bStandardDev.get(i) - bDev.get(i)));
|
||||||
if (CollUtil.isNotEmpty(tDev)) {
|
}
|
||||||
Double v = tDev.get(tIdxs.get(0));
|
for (int i = 0; i < cStandardDev.size(); i++) {
|
||||||
tDev.clear();
|
cErrorValueList.add(Math.abs(cStandardDev.get(i) - cDev.get(i)));
|
||||||
tDev.add(v);
|
}
|
||||||
|
for (int i = 0; i < tStandardDev.size(); i++) {
|
||||||
|
tErrorValueList.add(Math.abs(tStandardDev.get(i) - tDev.get(i)));
|
||||||
|
}
|
||||||
|
List<Integer> aErrorValueIdxs = DetectionUtil.sort(aErrorValueList, true);
|
||||||
|
List<Integer> bErrorValueIdxs = DetectionUtil.sort(bErrorValueList, true);
|
||||||
|
List<Integer> cErrorValueIdxs = DetectionUtil.sort(cErrorValueList, true);
|
||||||
|
List<Integer> tErrorValueIdxs = DetectionUtil.sort(tErrorValueList, true);
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(aStandardDev) && CollUtil.isNotEmpty(aDev)) {
|
||||||
|
Double v = aStandardDev.get(aErrorValueIdxs.get(0));
|
||||||
|
aStandardDev.clear();
|
||||||
|
aStandardDev.add(v);
|
||||||
|
v = aDev.get(aErrorValueIdxs.get(0));
|
||||||
|
aDev.clear();
|
||||||
|
aDev.add(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(bStandardDev) && CollUtil.isNotEmpty(bDev)) {
|
||||||
|
Double v = bStandardDev.get(bErrorValueIdxs.get(0));
|
||||||
|
bStandardDev.clear();
|
||||||
|
bStandardDev.add(v);
|
||||||
|
v = bDev.get(bErrorValueIdxs.get(0));
|
||||||
|
bDev.clear();
|
||||||
|
bDev.add(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(cStandardDev) && CollUtil.isNotEmpty(cDev)) {
|
||||||
|
Double v = cStandardDev.get(cErrorValueIdxs.get(0));
|
||||||
|
cStandardDev.clear();
|
||||||
|
cStandardDev.add(v);
|
||||||
|
v = cDev.get(cErrorValueIdxs.get(0));
|
||||||
|
cDev.clear();
|
||||||
|
cDev.add(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(tStandardDev) && CollUtil.isNotEmpty(tDev)) {
|
||||||
|
Double v = tStandardDev.get(tErrorValueIdxs.get(0));
|
||||||
|
tStandardDev.clear();
|
||||||
|
tStandardDev.add(v);
|
||||||
|
v = tDev.get(tErrorValueIdxs.get(0));
|
||||||
|
tDev.clear();
|
||||||
|
tDev.add(v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2647,9 +2722,10 @@ public class DetectionServiceImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(value)) {
|
if (CollUtil.isNotEmpty(value)) {
|
||||||
List<Integer> idx = DetectionUtil.sort(value, false);
|
|
||||||
switch (dataRule) {
|
switch (dataRule) {
|
||||||
case SECTION_VALUE:
|
case SECTION_VALUE: {
|
||||||
|
List<Integer> idx = DetectionUtil.sort(value, false);
|
||||||
if (value.size() > 2) {
|
if (value.size() > 2) {
|
||||||
value.remove(0);
|
value.remove(0);
|
||||||
value.remove(value.size() - 1);
|
value.remove(value.size() - 1);
|
||||||
@@ -2657,9 +2733,11 @@ public class DetectionServiceImpl {
|
|||||||
devPhaseHarmData.clear();
|
devPhaseHarmData.clear();
|
||||||
devPhaseHarmData.addAll(newArray);
|
devPhaseHarmData.addAll(newArray);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case CP95_VALUE:
|
case CP95_VALUE:
|
||||||
if (CollUtil.isNotEmpty(value)) {
|
if (CollUtil.isNotEmpty(value)) {
|
||||||
|
List<Integer> idx = DetectionUtil.sort(value, false);
|
||||||
int cp95Idx = DetectionUtil.getCP95Idx(value);
|
int cp95Idx = DetectionUtil.getCP95Idx(value);
|
||||||
List<Double> newValue = Collections.singletonList(value.get(cp95Idx));
|
List<Double> newValue = Collections.singletonList(value.get(cp95Idx));
|
||||||
value.clear();
|
value.clear();
|
||||||
@@ -2678,18 +2756,30 @@ public class DetectionServiceImpl {
|
|||||||
devPhaseHarmData.addAll(devAvgData);
|
devPhaseHarmData.addAll(devAvgData);
|
||||||
break;
|
break;
|
||||||
case Own_value:
|
case Own_value:
|
||||||
List<Double> newArray = DetectionUtil.getNewArray(devPhaseHarmData, idx);
|
|
||||||
devPhaseHarmData.clear();
|
|
||||||
devPhaseHarmData.addAll(newArray);
|
|
||||||
break;
|
break;
|
||||||
case AT_WILL_VALUE:
|
case AT_WILL_VALUE:
|
||||||
if (CollUtil.isNotEmpty(value)) {
|
if (isRemoveMaxElement) {
|
||||||
Double v = value.get(0);
|
if (CollUtil.isNotEmpty(value)) {
|
||||||
|
Double v = value.get(value.size() - 1);
|
||||||
|
value.clear();
|
||||||
|
value.add(v);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(devPhaseHarmData)) {
|
||||||
|
Double v = devPhaseHarmData.get(devPhaseHarmData.size() - 1);
|
||||||
|
devPhaseHarmData.clear();
|
||||||
|
devPhaseHarmData.add(v);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<Double> errorValueList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < value.size(); i++) {
|
||||||
|
errorValueList.add(Math.abs(value.get(i) - devPhaseHarmData.get(i)));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Integer> idxErrorValueList = DetectionUtil.sort(errorValueList, true);
|
||||||
|
Double v = value.get(idxErrorValueList.get(0));
|
||||||
value.clear();
|
value.clear();
|
||||||
value.add(v);
|
value.add(v);
|
||||||
}
|
v = devPhaseHarmData.get(idxErrorValueList.get(0));
|
||||||
if (CollUtil.isNotEmpty(devPhaseHarmData)) {
|
|
||||||
Double v = devPhaseHarmData.get(idx.get(0));
|
|
||||||
devPhaseHarmData.clear();
|
devPhaseHarmData.clear();
|
||||||
devPhaseHarmData.add(v);
|
devPhaseHarmData.add(v);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user