From dea248c9da9f82e4032b6ab4a8ce0a6422a5c2cc Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 13 九月 2024 16:35:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/async/PythonLib.java |  107 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 104 insertions(+), 3 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/async/PythonLib.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/async/PythonLib.java
index 19139d5..43d6bdb 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/async/PythonLib.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/async/PythonLib.java
@@ -2,14 +2,13 @@
 
 import com.alibaba.fastjson.JSONObject;
 import com.zt.common.servlet.Result;
-import com.zt.life.modules.mainPart.taskReliability.model.PythonResult;
+import com.zt.life.modules.mainPart.taskReliability.model.ReliaSimLibResult;
 import com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
 import java.io.BufferedReader;
@@ -66,7 +65,7 @@
 //            if (exitCode == 0) {
                 logger.info("鍚姩python璁$畻鎴愬姛");
                 if (line != null) {
-                    PythonResult rtn = JSONObject.parseObject(line, PythonResult.class);
+                    ReliaSimLibResult rtn = JSONObject.parseObject(line, ReliaSimLibResult.class);
                     if ("0".equals(rtn.getCode())) {
                         result = Result.ok();
                     } else {
@@ -243,6 +242,108 @@
                 "        </repair_model>\n" +
                 "    </repair_models>\n" +
                 "</des>";
+/*
+        String xmlfile = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<des name=\"General system\">\n" +
+                "    <tasks>\n" +
+                "        <task duration=\"200\" model=\"model1\"/>\n" +
+                "        <task duration=\"100\" model=\"model2\"/>\n" +
+                "    </tasks>\n" +
+                "    <models>\n" +
+                "        <model name =\"model1\">\n" +
+                "            <logic name=\"1813102074724945921\" type=\"series\">                \n" +
+                "\t\t\t\t<logic name=\"1721113377977629981\" type=\"series\">                \n" +
+                "\t\t\t\t\t<logic name=\"p1\" type=\"parallel\">                \n" +
+                "\t\t\t\t\t\t<node name=\"1721113796232438988\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "                            <repair_model name=\"rm1\"/>\n" +
+                "\t\t\t\t\t\t</node>                \n" +
+                "\t\t\t\t\t\t<node name=\"1721113971135848726\" type=\"node\" cycon=\"15\" cycdown=\"5\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "\t\t\t\t\t\t</node>\n" +
+                "\t\t\t\t\t</logic>\n" +
+                "                    <logic name=\"v1\" type=\"vote\" k=\"2\">\n" +
+                "\t\t\t\t\t\t<node name=\"1721113929312687055\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "                            <repair_model name=\"rm2\"/>\n" +
+                "\t\t\t\t\t\t</node>                \n" +
+                "\t\t\t\t\t\t<node name=\"1721113465658619786\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm2\"/>\n" +
+                "\t\t\t\t\t\t</node>\n" +
+                "\t\t\t\t\t\t<node name=\"1721113182603098012\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "\t\t\t\t\t\t</node>                \n" +
+                "\t\t\t\t\t</logic>\n" +
+                "\t\t\t\t</logic>\n" +
+                "\t\t\t\t<logic name=\"1721113127170514122\" type=\"series\">                \n" +
+                "\t\t\t\t\t<node name =\"1721113197988754255\" type=\"node\">\n" +
+                "\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "\t\t\t\t\t</node>\n" +
+                "\t\t\t\t\t<node name=\"1721113169705470682\" type=\"node\">\n" +
+                "\t\t\t\t\t\t<failure_model name=\"fm2\"/>\n" +
+                "\t\t\t\t\t</node>\n" +
+                "\t\t\t\t</logic>\n" +
+                "            </logic>\n" +
+                "        </model>\n" +
+                "        <model name =\"model2\">\n" +
+                "            <logic name=\"1813102074724945921\" type=\"series\">                \n" +
+                "\t\t\t\t<logic name=\"1721113377977629981\" type=\"series\">                \n" +
+                "\t\t\t\t\t<logic name=\"p1\" type=\"parallel\">                \n" +
+                "\t\t\t\t\t\t<node name=\"1721113796232438988\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "                            <repair_model name=\"rm1\"/>\n" +
+                "\t\t\t\t\t\t</node>                \n" +
+                "\t\t\t\t\t\t<node name=\"1721113971135848726\" type=\"node\" cycon=\"15\" cycdown=\"5\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "\t\t\t\t\t\t</node>\n" +
+                "\t\t\t\t\t</logic>\n" +
+                "                    <logic name=\"v1\" type=\"vote\" k=\"2\">\n" +
+                "\t\t\t\t\t\t<node name=\"1721113929312687055\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "                            <repair_model name=\"rm2\"/>\n" +
+                "\t\t\t\t\t\t</node>                \n" +
+                "\t\t\t\t\t\t<node name=\"1721113465658619786\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm2\"/>\n" +
+                "\t\t\t\t\t\t</node>\n" +
+                "\t\t\t\t\t\t<node name=\"1721113182603098012\" type=\"node\">\n" +
+                "\t\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "\t\t\t\t\t\t</node>                \n" +
+                "\t\t\t\t\t</logic>\n" +
+                "\t\t\t\t</logic>\n" +
+                "\t\t\t\t<logic name=\"1721113127170514122\" type=\"parallel\">                \n" +
+                "\t\t\t\t\t<node name =\"1721113197988754255\" type=\"node\">\n" +
+                "\t\t\t\t\t\t<failure_model name=\"fm1\"/>\n" +
+                "\t\t\t\t\t</node>\n" +
+                "\t\t\t\t\t<node name=\"1721113169705470682\" type=\"node\">\n" +
+                "\t\t\t\t\t\t<failure_model name=\"fm2\"/>\n" +
+                "\t\t\t\t\t</node>\n" +
+                "\t\t\t\t</logic>\n" +
+                "            </logic>\n" +
+                "        </model>\n" +
+                "    </models>\n" +
+                "    <failure_models>\n" +
+                "        <failure_model name=\"fm1\" type=\"exponential\">\n" +
+                "            <failure-rate value=\"0.004\"/>\n" +
+                "        </failure_model>\n" +
+                "        <failure_model name=\"fm2\" type=\"fixed\">\n" +
+                "            <unreliability value=\"0.04\"/>\n" +
+                "        </failure_model>\n" +
+                "        <failure_model name=\"fm3\" type=\"weibull\">\n" +
+                "            <scale value=\"100\"/>\n" +
+                "            <shape value=\"2\"/>\n" +
+                "        </failure_model>\n" +
+                "    </failure_models>\n" +
+                "    <repair_models>\n" +
+                "        <repair_model name=\"rm1\" type=\"exponential\">\n" +
+                "            <repair-rate value=\"0.1\"/>\n" +
+                "        </repair_model>\n" +
+                "        <repair_model name=\"rm2\" type=\"weibull\">\n" +
+                "            <scale value=\"13\"/>\n" +
+                "            <shape value=\"2\"/>\n" +
+                "        </repair_model>\n" +
+                "    </repair_models>\n" +
+                "</des>";
+*/
         JSONObject jsonObject = new JSONObject();
 /*
         Long simulate_times = 10000L;

--
Gitblit v1.9.1