Browse Source

修改时间计算方法,海上陆上添加类型判断,修改总体指标表格生成代码

liyang 6 months ago
parent
commit
745a8f9ad1

+ 3 - 3
Models/SimulationCommon/FXJHGenenrate.cs

@@ -807,9 +807,9 @@ namespace Model
             }
             
             bool isEnd = false || segmentnumber >= turningPoints.Count;
-            
-           
-              
+
+            currentLocation.Currentsegnum = segmentnumber;
+
                 if (segmentnumber <  turningPoints.Count - 1)
                 {
                     currentLocation.CurrentLon = turningPoints[segmentnumber].TurningPointLongitude +

+ 47 - 23
SimulationServer/Component/TaskComponent.cs

@@ -223,6 +223,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
     float 识别成功率 = 0f;
     double 平均救助时间 = 0;
     float 人员数量 = 0;
+    float 识别数量 = 0;
     double aircreftCount = 0;
 
     double searchCount = 0;
@@ -338,6 +339,8 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                 识别成功率 = 0f;
                 平均救助时间 = 0;
                 人员数量 = 0;
+                识别数量 = 0;
+
                 double aircreftCount = 0;
                 foreach (var item in self.SeaSJRescueMissions)
                 {
@@ -345,6 +348,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -356,13 +360,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("海上搜救" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("海上搜救" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("海上搜救" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("海上搜救" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("海上搜救" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("海上搜救" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("海上搜救" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("海上搜救" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("海上搜救" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("海上搜救" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -373,6 +378,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -384,13 +390,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("路上搜寻" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("路上搜寻" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("路上搜寻" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("路上搜寻" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("路上搜寻" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("路上搜寻" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("路上搜寻" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("路上搜寻" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("路上搜寻" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("路上搜寻" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -401,6 +408,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -412,13 +420,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("空中吊运" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("空中吊运" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("空中吊运" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("空中吊运" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("空中吊运" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("空中吊运" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("空中吊运" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("空中吊运" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("空中吊运" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("空中吊运" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -429,6 +438,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -440,13 +450,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("空投空送" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("空投空送" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("空投空送" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("空投空送" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("空投空送" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("空投空送" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("空投空送" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("空投空送" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("空投空送" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("空投空送" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -457,6 +468,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -468,13 +480,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("着水救援" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("着水救援" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("着水救援" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("着水救援" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("着水救援" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("着水救援" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("着水救援" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("着水救援" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("着水救援" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("着水救援" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -486,6 +499,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -497,13 +511,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("机降救援" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("机降救援" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("机降救援" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("机降救援" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("机降救援" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("机降救援" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("机降救援" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("机降救援" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("机降救援" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("机降救援" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -515,6 +530,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     {
                         识别成功率 += float.Parse(item1.Value["识别成功率"][i]);
                         人员数量 += float.Parse(item1.Value["人员数量"][i]);
+                        识别数量 += float.Parse(item1.Value["识别数量"][i]);
                         if (任务准备时间 < float.Parse(item1.Value["任务准备时间"][i]))
                             任务准备时间 = float.Parse(item1.Value["任务准备时间"][i]);
                         平均搜索时间 += float.Parse(item1.Value["平均搜索时间"][i]);
@@ -526,13 +542,14 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                             searchCount++;
                         if (item1.Value["平均救助时间"][i] != "0")
                             jzCount++;
-                        Console.WriteLine("索滑降" + item1.Key + "识别到人数:" + item1.Value["识别成功率"][i]);
-                        Console.WriteLine("索滑降" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
+                        Console.WriteLine("索滑降" + item1.Key + "识别成功数:" + item1.Value["识别成功率"][i]);
+                        Console.WriteLine("索滑降" + item1.Key + "识别数量:" + item1.Value["识别数量"][i]);
                         Console.WriteLine("索滑降" + item1.Key + "任务准备时间:" + item1.Value["任务准备时间"][i]);
                         Console.WriteLine("索滑降" + item1.Key + "平均搜索时间:" + item1.Value["平均搜索时间"][i]);
                         Console.WriteLine("索滑降" + item1.Key + "平均救助时间:" + item1.Value["平均救助时间"][i]);
                         Console.WriteLine("索滑降" + item1.Key + "总飞行时间:" + item1.Value["总飞行时间"][i]);
                         Console.WriteLine("索滑降" + item1.Key + "存活人数:" + item1.Value["人员存活率"][i]);
+                        Console.WriteLine("索滑降" + item1.Key + "人员数量:" + item1.Value["人员数量"][i]);
                         Console.WriteLine("===============================================================");
                     }
                 }
@@ -545,30 +562,37 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                 if (任务是否成功 == 1)
                     self.seaSuccessCount++;
 
-                if (人员数量 != 0)
-                {
-                    allTotalTaskPerformance.识别成功率 = (识别成功率 / 人员数量).ToString();
-                    allTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
-                }
+                if (识别数量 != 0)
+                    allTotalTaskPerformance.识别成功率 = (识别成功率 / 识别数量).ToString();
                 else
-                {
                     allTotalTaskPerformance.识别成功率 = "0";
-                    allTotalTaskPerformance.人员存活率 = "0";
-                }
+
                 allTotalTaskPerformance.任务准备时间 = 任务准备时间.ToString();
+
                 if (searchCount != 0)
                     allTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / searchCount).ToString("f4"); // aircreftCount
                 else
                     allTotalTaskPerformance.平均搜索时间 = "0";
+
                 if (jzCount != 0)
                     allTotalTaskPerformance.平均救助时间 = (平均救助时间 / jzCount).ToString("f4"); // aircreftCount
                 else
                     allTotalTaskPerformance.平均救助时间 = "0";
+
                 allTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString("f4");
+
                 allTotalTaskPerformance.海上搜索覆盖面积 = Rectangular_Area_Search_Function.min_area.ToString();//"0.6".ToString();//"60%"
-                allTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
+
                 allTotalTaskPerformance.环境搜索覆盖面积 = "0.6".ToString();
 
+                allTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
+
+
+                if (人员数量 != 0)
+                    allTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
+                else
+                    allTotalTaskPerformance.人员存活率 = "0";
+
                 Console.WriteLine("单轮次总体指标识别成功率:" + allTotalTaskPerformance.识别成功率);
                 Console.WriteLine("单轮次总体指标任务准备时间:" + allTotalTaskPerformance.任务准备时间);
                 Console.WriteLine("单轮次总体指标平均搜索时间:" + allTotalTaskPerformance.平均搜索时间);

+ 2 - 12
SimulationServer/Entity/AircraftDY.cs

@@ -67,9 +67,9 @@ public class AircraftDY : AircraftEntity
 
         // 飞到目标点时间与人员存活时间做对比  有一个人活着,整个任务成功
         double time = 0;
-        for (int i = 0; i < TurningPoints.Count - 1; i++) // 总飞行时间
+        for (int i = 0; i < TurningPoints.Count - 1; i++)
         {
-            time += TurningPoints[i].SegmentFlightTime; // 总时间  // 判断幸存-1
+            time += TurningPoints[i].SegmentFlightTime; // 判断幸存-1
         }
         //Console.WriteLine("time:" + time);
 
@@ -93,11 +93,6 @@ public class AircraftDY : AircraftEntity
                 Success = true;
                 //Console.WriteLine("Success:" + true);
             }
-            else
-            {
-                Success = false;
-                //Console.WriteLine("Success:" + false);
-            }
         }
 
         if (FlightPlanEditor.targetpoint[0].TargetType.Type == "遇险人员")
@@ -107,11 +102,6 @@ public class AircraftDY : AircraftEntity
                 Success = true;
                 //Console.WriteLine("Success:" + true);
             }
-            else
-            {
-                Success = false;
-                //Console.WriteLine("Success:" + false);
-            }
         }
 
         for (int i = 0; i < TurningPoints.Count; i++) // 总飞行时间

+ 1 - 1
SimulationServer/Entity/AircraftJJ.cs

@@ -76,7 +76,7 @@ public class AircraftJJ : AircraftEntity
         }
         Console.WriteLine("TotalTime:" + TotalTime);
         IsOver = true;
-        Success = true; //需要判断
+        //Success = true; //需要判断
         End();
     }
 

+ 1 - 1
SimulationServer/Entity/AircraftKTKS.cs

@@ -162,7 +162,7 @@ public class AircraftKTKS : AircraftEntity
         }
         Console.WriteLine("TotalTime:" + TotalTime);
         IsOver = true;
-        Success = true; //需要判断
+        //Success = true; //需要判断
         End();
     }
 

+ 60 - 50
SimulationServer/Entity/AircraftLandSJ.cs

@@ -34,6 +34,9 @@ public class AircraftLandSJ : AircraftEntity
     public bool isEndWhile;
 
     public int targetCount;
+
+    public int sbCount;
+
     public override void Reset()
     {
         base.Reset();
@@ -45,11 +48,18 @@ public class AircraftLandSJ : AircraftEntity
         isEndWhile = false;
         resulttime = 0;
         targetCount = 0;
+        sbCount = 0;
     }
 
     public override void Start()
     {
-        targetCount = FlightPlanEditor.targetpoint[0].TargetType.Count;
+        if (FlightPlanEditor.targetpoint[0].TargetType.Type == "遇险人员")
+        {
+            targetCount = FlightPlanEditor.targetpoint[0].TargetType.Count;
+            sbCount = targetCount;
+        }
+        else
+            sbCount = 1;
 
         int Year = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[0]);
         int Month = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[1].Split("月")[0]);
@@ -238,7 +248,7 @@ public class AircraftLandSJ : AircraftEntity
                     fireIndex = currentLocation.Currentsegnum; // 记录当前航路点位置
                     //IsOver = true;
                     isEndWhile = true;
-                    Success = true;
+                    //Success = true;
                     //resulttime = get_result_time_rope(30, FlightPlanEditor.targetpoint[0].TargetType.Count, windSpeed, visibility, 0.75, 1.38).time; //调运时间
                     //Console.WriteLine("resulttime:" + resulttime);
                 }
@@ -253,56 +263,10 @@ public class AircraftLandSJ : AircraftEntity
                     //IsOver = true;
                     isEndWhile = true;
                     isseePerson = false;
+                    fireIndex = currentLocation.Currentsegnum;
                 }
             } while (!isseePerson && isEndWhile == false);
 
-            if (isseePerson)
-            {
-
-                Text_readNC text_ReadNC = new Text_readNC();
-                text_ReadNC.initlatitudes = FlightPlanEditor.targetpoint[0].TargetPointLatitude;
-                text_ReadNC.initlongitudes = FlightPlanEditor.targetpoint[0].TargetPointLongitude;
-                //text_ReadNC = new Text_readNC();
-                text_ReadNC.GetNCData();
-                var nCread = text_ReadNC.windNCread;
-                var wind = SeaSJ.GetWindVelocityFromAPI(nCread, currentLocation.CurrentLat, currentLocation.CurrentLon,
-            temptime, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, text_ReadNC.times1, text_ReadNC.latitudes1, text_ReadNC.longitudes1, Days, Hour);
-
-
-                double windSpeed = Math.Sqrt(wind[0] * wind[0] + wind[1] * wind[1]);
-
-                for (int i = 0; i < TurningPoints.Count - 1; i++) // 总飞行时间
-                {
-                    TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间
-                }
-
-                double time = TotalTime; //time——搜索时间,单位:秒;数据测试用
-
-                double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
-                double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
-
-                double survivalTime = FlightPlanEditor.targetpoint[0].TargetType.LiveTime;//幸存时间
-                //  SHJParameter.person_number = Eidtor里读取   SHJParameter.windspeed Nc/Editor目标气象信息读取时间先取任务初始时间
-                resulttime = get_result_time_rope(30, FlightPlanEditor.targetpoint[0].TargetType.Count, windSpeed, visibility, 0.75, 1.38).time; //调运时间
-                Console.WriteLine("resulttime:" + resulttime);
-                //Console.WriteLine("survivalTime:" + survivalTime);
-                if (survivalTime * 3600 > time)
-                {
-                    Success = true;
-                }
-                else
-                {
-                    Success = false;
-                }
-                Log.Info("TotalTime:" + TotalTime);
-                Log.Info("幸存时间:" + survivalTime);
-            }
-
-            //Console.WriteLine(
-            //    $"海上任务1:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
-            Log.Info(
-                $"陆上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到遇险人员:{isseePerson}");
-
             //finalProbability = 1 - finalProbability; 
 
             if (fireIndex != -1)
@@ -323,6 +287,51 @@ public class AircraftLandSJ : AircraftEntity
                 FXJHGenerate.FromMissionToEnd(FlightPlanEditor, MissionEndPoint, ref TurningPoints);
             }
 
+            if (isseePerson)
+            {
+                if(FlightPlanEditor.targetpoint[0].TargetType.Type == "遇险人员")
+                {
+                    Text_readNC text_ReadNC = new Text_readNC();
+                    text_ReadNC.initlatitudes = FlightPlanEditor.targetpoint[0].TargetPointLatitude;
+                    text_ReadNC.initlongitudes = FlightPlanEditor.targetpoint[0].TargetPointLongitude;
+                    //text_ReadNC = new Text_readNC();
+                    text_ReadNC.GetNCData();
+                    var nCread = text_ReadNC.windNCread;
+                    var wind = SeaSJ.GetWindVelocityFromAPI(nCread, currentLocation.CurrentLat, currentLocation.CurrentLon,
+                temptime, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, text_ReadNC.times1, text_ReadNC.latitudes1, text_ReadNC.longitudes1, Days, Hour);
+
+
+                    double windSpeed = Math.Sqrt(wind[0] * wind[0] + wind[1] * wind[1]);
+
+                    for (int i = 0; i < TurningPoints.Count - 1; i++) // 总飞行时间
+                    {
+                        TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间
+                    }
+
+                    double time = TotalTime; //time——搜索时间,单位:秒;数据测试用
+
+                    double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
+                    double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
+
+                    double survivalTime = FlightPlanEditor.targetpoint[0].TargetType.LiveTime;//幸存时间
+                                                                                              //  SHJParameter.person_number = Eidtor里读取   SHJParameter.windspeed Nc/Editor目标气象信息读取时间先取任务初始时间
+                    resulttime = get_result_time_rope(30, FlightPlanEditor.targetpoint[0].TargetType.Count, windSpeed, visibility, 0.75, 1.38).time; //调运时间
+                    Console.WriteLine("resulttime:" + resulttime);
+                    //Console.WriteLine("survivalTime:" + survivalTime);
+                    if (survivalTime * 3600 > time)
+                    {
+                        Success = true;
+                    }
+                    //Log.Info("TotalTime:" + TotalTime);
+                    //Log.Info("幸存时间:" + survivalTime);
+                }
+            }
+
+            //Console.WriteLine(
+            //    $"海上任务1:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
+            Log.Info(
+                $"陆上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到遇险人员:{isseePerson}");
+
             FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, ref TurningPoints, Velocitys, FuelConsumptions);
 
             End();
@@ -368,7 +377,6 @@ public class AircraftLandSJ : AircraftEntity
 
     public override void End()
     {
-        IsOver = true;
         for (int i = 0; i < TurningPoints.Count - 2; i++)
         {
             EffMisTime += TurningPoints[i].SegmentFlightTime;
@@ -387,6 +395,8 @@ public class AircraftLandSJ : AircraftEntity
 
         TotalFuelConsumption = TurningPoints[0].RemainingFuel -
                                TurningPoints[TurningPoints.Count - 1].RemainingFuel;
+
+        IsOver = true;
     }
 }
 

+ 1 - 1
SimulationServer/Entity/AircraftSHJ.cs

@@ -57,7 +57,7 @@ public class AircraftSHJ : AircraftEntity
         }
         Console.WriteLine("TotalTime:" + TotalTime);
         IsOver = true;
-        Success = true;
+        //Success = true;
         End();
     }
 

+ 48 - 40
SimulationServer/Entity/AircraftSJ.cs

@@ -41,6 +41,8 @@ public class AircraftSJ : AircraftEntity
 
     public bool isEndWhile;
 
+    public int sbCount;
+
     public override void Reset()
     {
         base.Reset();
@@ -52,11 +54,18 @@ public class AircraftSJ : AircraftEntity
         resulttime = 0;
         isEndWhile = false;
         targetCount = 0;
+        sbCount = 0;
     }
 
     public override void Start()
     {
-        targetCount = FlightPlanEditor.targetpoint[0].TargetType.Count;
+        if (FlightPlanEditor.targetpoint[0].TargetType.Type == "落水人员")
+        {
+            targetCount = FlightPlanEditor.targetpoint[0].TargetType.Count;
+            sbCount = targetCount;
+        }
+        else
+            sbCount = 1;
 
         int Year = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[0]);
         int Month = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[1].Split("月")[0]);
@@ -161,7 +170,7 @@ public class AircraftSJ : AircraftEntity
                 lat = startPoint1.lat / 2 + startPoint2.lat / 2,
                 lon = startPoint1.lon / 2 + startPoint2.lon / 2
             };
-           //Console.WriteLine("centerPoint:" + centerPoint.lat + "-" + centerPoint.lon);
+            //Console.WriteLine("centerPoint:" + centerPoint.lat + "-" + centerPoint.lon);
             // 以 centerPoint 为中心,生成正方形区域
             var lonD = Math.Abs(points[0].lon - points[1].lon);
             var latD1 = Math.Abs(points[1].lat - points[2].lat);
@@ -320,6 +329,7 @@ public class AircraftSJ : AircraftEntity
                 double randomValue = random.NextInt64(9006, 10000); // 生成随机数比较概率 //0.05 第一个参数越高概率越低 / 8985 0.212 100 / 9000 0.16 100 / 8995 0.14 100 / 8997 0.12 100 / 8999  0.18 100 / 9006 0.11 100 / 9010 0.12 100 / 9030 0.03 100 / 9026 0.07 0.04 100 / 9028 0.03 100 / 9027 0.04 100 / 9025 0.05 100 /
                 //9025 0.02 100 / 9015 0.02 100 / 9020 0.04 100 / 9022 0.05 100 / 9022 0.04 100 / 9022 0 100 /9018 0.01 100 / 9021 0.01 100 / 9023 0.03 100 / 9000 0.08 100 / 9006
                 randomValue /= 10000;
+                //randomValue = 0.8;
                 if (randomValue < probability) //  1 - finalProbability
                 {
                     isseePerson = true;
@@ -337,43 +347,10 @@ public class AircraftSJ : AircraftEntity
                     //IsOver = true;
                     isEndWhile = true;
                     isseePerson = false;
+                    fireIndex = currentLocation.Currentsegnum;
                 }
                 temptime += 10;
-            } while (!isseePerson && isEndWhile == false); //IsOver == false
-            if (isseePerson)
-            {
-
-                for (int i = 0; i < TurningPoints.Count - 1; i++) // 总飞行时间
-                {
-                    TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间
-                }
-
-                double time = TotalTime; //time——搜索时间,单位:秒;数据测试用
-
-                double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
-                double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
-
-                double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, Days, Hour); //幸存时间
-                //  SHJParameter.person_number = Eidtor里读取   SHJParameter.windspeed Nc/Editor目标气象信息读取时间先取任务初始时间
-                resulttime = get_result_time_rope(30, FlightPlanEditor.targetpoint[0].TargetType.Count, windSpeed, vis, 0.75, 1.38).time; //调运时间
-                Console.WriteLine("resulttime:" + resulttime);
-                if (survivalTime * 3600 > time)
-                {
-                    Success = true;
-                }
-                else
-                {
-                    Success = false;
-                }
-                Log.Info("TotalTime:" + TotalTime);
-                Log.Info("幸存时间:" + survivalTime);
-            }
-
-
-            //Console.WriteLine(
-            //    $"海上任务1:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
-            Log.Info(
-                $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到目标:{isseePerson},人员是否幸存:{Success}");
+            } while (!isseePerson && !isEndWhile); //IsOver == false
 
             //finalProbability = 1 - finalProbability;
 
@@ -395,6 +372,39 @@ public class AircraftSJ : AircraftEntity
                 FXJHGenerate.FromMissionToEnd(FlightPlanEditor, MissionEndPoint, ref TurningPoints);
             }
 
+            if (isseePerson)
+            {
+                double seeTime = 0;
+                if (FlightPlanEditor.targetpoint[0].TargetType.Type == "落水人员")
+                {
+                    for (int i = 0; i < TurningPoints.Count - 1; i++)
+                    {
+                        seeTime += TurningPoints[i].SegmentFlightTime;
+                    }
+
+                    //time = TotalTime; //time——搜索时间,单位:秒;数据测试用
+
+                    double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
+                    double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
+
+                    double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, Days, Hour); //幸存时间
+                                                                                                                                                                                                         //  SHJParameter.person_number = Eidtor里读取   SHJParameter.windspeed Nc/Editor目标气象信息读取时间先取任务初始时间
+                    resulttime = get_result_time_rope(30, FlightPlanEditor.targetpoint[0].TargetType.Count, windSpeed, vis, 0.75, 1.38).time; //调运时间
+                    Console.WriteLine("resulttime:" + resulttime);
+                    if (survivalTime * 3600 > seeTime)
+                    {
+                        Success = true;
+                    }
+                    //Log.Info("TotalTime:" + TotalTime);
+                    //Log.Info("幸存时间:" + survivalTime);
+                }
+            }
+
+            //Console.WriteLine(
+            //    $"海上任务1:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
+            Log.Info(
+                $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到目标:{isseePerson},人员是否幸存:{Success}");
+
             FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, ref TurningPoints, Velocitys, FuelConsumptions);
 
             End();
@@ -442,7 +452,6 @@ public class AircraftSJ : AircraftEntity
 
     public override void End()
     {
-        IsOver = true;
         for (int i = 0; i < TurningPoints.Count - 2; i++)
         {
             EffMisTime += TurningPoints[i].SegmentFlightTime;
@@ -458,7 +467,6 @@ public class AircraftSJ : AircraftEntity
             TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间
         }
 
-
         TotalFuelConsumption = TurningPoints[0].RemainingFuel -
                                TurningPoints[TurningPoints.Count - 1].RemainingFuel;
 
@@ -466,7 +474,7 @@ public class AircraftSJ : AircraftEntity
         //GetNCData getNCData = new GetNCData();
         ////getNCData.GetData();
 
-
+        IsOver = true;
     }
 }
 

+ 1 - 5
SimulationServer/Entity/AircraftZS.cs

@@ -29,10 +29,6 @@ public class AircraftZS : AircraftEntity
     public override void End()
     {
         TotalFuelConsumption = TurningPoints[0].RemainingFuel - TurningPoints[^1].RemainingFuel;
-        for (int i = 0; i < TurningPoints.Count - 3; i++)
-        {
-            SearchTime += TurningPoints[i].SegmentFlightTime; //搜索时间
-        }
     }
 
     public override void Reset()
@@ -115,7 +111,7 @@ public class AircraftZS : AircraftEntity
         Console.WriteLine("TotalTime:" + TotalTime);
 
         IsOver = true;
-        Success = true; //需要判断
+        //Success = true; //需要判断
         End();
     }
 

+ 3 - 0
SimulationServer/Entity/JJJYMission.cs

@@ -78,6 +78,9 @@ public class JJJYMission : Entity
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
             aircraftSJDatas[key]["识别成功率"].Add("0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add("0");
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add("0");

+ 3 - 0
SimulationServer/Entity/KTKSMission.cs

@@ -79,6 +79,9 @@ public class KTKSMission : Entity
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
             aircraftSJDatas[key]["识别成功率"].Add("0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add("0");
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add("0");

+ 3 - 0
SimulationServer/Entity/KZDYMission.cs

@@ -80,6 +80,9 @@ public class KZDYMission : Entity
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
             aircraftSJDatas[key]["识别成功率"].Add("0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add("0");
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add(aircraftEntity.targetCount.ToString());

+ 4 - 1
SimulationServer/Entity/LandSJRescueMission.cs

@@ -92,7 +92,10 @@ public class LandSJRescueMission : Entity
             }
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
-            aircraftSJDatas[key]["识别成功率"].Add(aircraftEntity.isseePerson ? aircraftEntity.targetCount.ToString() : "0");
+            aircraftSJDatas[key]["识别成功率"].Add(aircraftEntity.isseePerson ? aircraftEntity.sbCount.ToString() : "0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add(aircraftEntity.sbCount.ToString());
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add(aircraftEntity.targetCount.ToString());

+ 3 - 0
SimulationServer/Entity/SHJMission.cs

@@ -78,6 +78,9 @@ public class SHJMission : Entity
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
             aircraftSJDatas[key]["识别成功率"].Add("0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add("0");
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add("0");

+ 4 - 1
SimulationServer/Entity/SeaSJRescueMission.cs

@@ -92,7 +92,10 @@ public class SeaSJRescueMission : Entity
             }
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
-            aircraftSJDatas[key]["识别成功率"].Add(aircraftEntity.isseePerson ? aircraftEntity.targetCount.ToString() : "0");
+            aircraftSJDatas[key]["识别成功率"].Add(aircraftEntity.isseePerson ? aircraftEntity.sbCount.ToString() : "0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add(aircraftEntity.sbCount.ToString());
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add(aircraftEntity.targetCount.ToString());

+ 4 - 1
SimulationServer/Entity/ZSJYMission.cs

@@ -78,6 +78,9 @@ public class ZSJYMission : Entity
             if (!aircraftSJDatas[key].ContainsKey("识别成功率"))
                 aircraftSJDatas[key]["识别成功率"] = new List<string>();
             aircraftSJDatas[key]["识别成功率"].Add("0");
+            if (!aircraftSJDatas[key].ContainsKey("识别数量"))
+                aircraftSJDatas[key]["识别数量"] = new List<string>();
+            aircraftSJDatas[key]["识别数量"].Add("0");
             if (!aircraftSJDatas[key].ContainsKey("人员数量"))
                 aircraftSJDatas[key]["人员数量"] = new List<string>();
             aircraftSJDatas[key]["人员数量"].Add("0");
@@ -86,7 +89,7 @@ public class ZSJYMission : Entity
             aircraftSJDatas[key]["任务准备时间"].Add(aircraftEntity.TaskReadyTime.ToString());
             if (!aircraftSJDatas[key].ContainsKey("平均搜索时间"))
                 aircraftSJDatas[key]["平均搜索时间"] = new List<string>();
-            aircraftSJDatas[key]["平均搜索时间"].Add(aircraftEntity.SearchTime.ToString("f4"));
+            aircraftSJDatas[key]["平均搜索时间"].Add("0");
             if (!aircraftSJDatas[key].ContainsKey("平均救助时间"))
                 aircraftSJDatas[key]["平均救助时间"] = new List<string>();
             aircraftSJDatas[key]["平均救助时间"].Add("0");

BIN
SimulationServer/bin/Debug/net7.0/SimulationCommon.dll


BIN
SimulationServer/bin/Debug/net7.0/SimulationCommon.pdb


BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.dll


BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.exe


BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.pdb