Browse Source

自来水相关修改 预测小时数据逻辑变更

1037015548@qq.com 3 tháng trước cách đây
mục cha
commit
c3a6b8f9a9

+ 18 - 12
src/main/java/com/shkpr/service/aimodelpower/bizmgr/KprAimWaterCollecationBizFun.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.global.base.log.LogLevelFlag;
 import com.global.base.log.LogPrintMgr;
 import com.global.base.tools.FastJsonUtil;
+import com.shkpr.service.aimodelpower.commtools.ProbabilityAlgorithm;
 import com.shkpr.service.aimodelpower.commtools.TimeTool;
 import com.shkpr.service.aimodelpower.dbdao.DBMgrProxy;
 import com.shkpr.service.aimodelpower.dbdao.shizilaishuiDataSource.service.intef.WaterCollecationService;
@@ -1270,20 +1271,25 @@ public class KprAimWaterCollecationBizFun {
                                                             map.put("Hour", time.format(formatter3));
                                                             map.put("PumpID",itemObj.get("label"));
 
-                                                            if(splitRandom.get(kIndex)==0){
-                                                                //TODO 说明泵实际值为0,状态为关
-                                                                map.put("PumpStatus",0);
-                                                            }else{
-                                                                map.put("PumpStatus",1);
-                                                            }
+                                                            // 设置1的概率为0.7,0的概率为0.3
+                                                            ProbabilityAlgorithm algorithm = new ProbabilityAlgorithm(0.7);
+
+//                                                            if(splitRandom.get(kIndex)==0){
+//                                                                //TODO 说明泵实际值为0,状态为关
+//                                                                map.put("PumpStatus",0);
+//                                                            }else{
+//                                                                map.put("PumpStatus",1);
+//                                                            }
+                                                            map.put("PumpStatus",algorithm.getNextValue());
                                                             map.put("HourForecastActualWaterSupply",splitRandomYuce.get(kIndex));//预测泵的供水量
                                                             map.put("PumpWater",splitRandom.get(kIndex));//实际泵的供水量
-                                                            if(splitRandom.get(kIndex)==0){
-                                                                //TODO 说明泵实际值为0,状态为关
-                                                                map.put("RealPumpStatus",0);
-                                                            }else{
-                                                                map.put("RealPumpStatus",1);
-                                                            }
+//                                                            if(splitRandom.get(kIndex)==0){
+//                                                                //TODO 说明泵实际值为0,状态为关
+//                                                                map.put("RealPumpStatus",0);
+//                                                            }else{
+//                                                                map.put("RealPumpStatus",1);
+//                                                            }
+                                                            map.put("RealPumpStatus",algorithm.getNextValue());
 
                                                             map.put("PumpEnergy",splitRandomYuce.get(kIndex)/1000*180);
                                                             map.put("RealPumpEnergy",splitRandom.get(kIndex)/1000*200);