Pārlūkot izejas kodu

数据拟合数据过滤调整

王波 3 dienas atpakaļ
vecāks
revīzija
da7a91fb44

+ 16 - 15
runeconomy-xk/src/main/java/com/gyee/runeconomy/model/PowerProcessALG.java

@@ -283,19 +283,6 @@ public class PowerProcessALG {
                     }
                 }
             }
-            if (needQF) {
-                // 标记当前点
-                filter = 1;
-                reason = appendReason(reason, "under_generation_detected");
-                // 回溯标记 tempqfIndex 里最近 5 分钟的数据为过滤
-                for (Integer idx : tempqfIndex) {
-                    if (idx >= 0 && idx < list.size()) {
-                        list.get(idx).setFilter(1);
-                        filterReasons.put(idx, appendReason(filterReasons.get(idx), "pre_under_gen_5min"));
-                    }
-                }
-            }
-
             // 维护 tempqfIndex(保持最近不超过 5 分钟)
             while (!tempqfIndex.isEmpty()) {
                 int firstIdx = tempqfIndex.peekFirst();
@@ -307,9 +294,23 @@ public class PowerProcessALG {
                     break;
                 }
             }
-            // 将当前索引放到 tempqfIndex 尾部
+
+            // ----------- 欠发判断----------------
+            if (needQF) {
+                filter = 1;
+                reason = appendReason(reason, "under_generation_detected");
+
+                // 回溯标记 tempqfIndex 里最近 5 分钟的数据为过滤
+                for (Integer idx : tempqfIndex) {
+                    if (idx >= 0 && idx < list.size()) {
+                        list.get(idx).setFilter(1);
+                        filterReasons.put(idx, appendReason(filterReasons.get(idx), "pre_under_gen_5min"));
+                    }
+                }
+            }
             tempqfIndex.addLast(i);
 
+
             // ---------- 7. 功率曲线偏差(isglpc) - 使用最近的 map key ----------
             if (filter == 0 && isglpc != null && isglpc && map != null && !map.isEmpty()) {
                 Double key = findNearestMapKey(map, speed, SPEED_TOLERANCE);
@@ -359,7 +360,7 @@ public class PowerProcessALG {
                 if (reason == null) reason = "generic_filtered";
                 filterReasons.put(i, reason);
                 // 输出调试信息(你可以改为日志)
-//                System.out.println("Index " + i + " filtered: " + reason + " (time=" + currentTime + ", speed=" + speed + ", power=" + power + ", mxzt=" + mxzt + ", qfzt=" + item.getQfzt() + ")");
+                System.out.println("Index " + i + " filtered: " + reason + " (time=" + currentTime + ", speed=" + speed + ", power=" + power + ", mxzt=" + mxzt + ", qfzt=" + item.getQfzt() + ")");
             }
 
             // 注意:tempeiIndex/tempqfIndex 的维护在循环各自分支里完成(tempei 在 istj 分支中)