Browse Source

会议修改

liyang 6 months ago
parent
commit
3637ae2dfa

+ 9 - 0
Models/SimulationCommon/Rectangular_Area_Search_Function.cs

@@ -260,6 +260,7 @@ public class Rectangular_Area_Search_Function
             }
 
 
+
             //double lat = Rectangular_Area_Search_Function.RMokatuoLat(Point0[0]);
             //double lon = Rectangular_Area_Search_Function.RMokatuoLon(Point0[1]);
             //Console.WriteLine("Point0:" + lat + "-" + lon);
@@ -281,6 +282,14 @@ public class Rectangular_Area_Search_Function
         //{
         //    Console.WriteLine("Point_muster:" + item[0] + "-" + item[1]);
         //}
+        min_area = GetRectangularArea(Point_muster[0], Point_muster[1], Point_muster[2], Point_muster[3]);
+
+        //double width = Math.Sqrt(Math.Pow(Point_muster[0][0] - Point_muster[1][0], 2) + Math.Pow(Point_muster[0][1] - Point_muster[1][1], 2));
+        //double height = Math.Sqrt(Math.Pow(Point_muster[1][0] - Point_muster[2][0], 2) + Math.Pow(Point_muster[1][1] - Point_muster[2][1], 2));
+        //Console.WriteLine("width:" + width + "-" + "height:" + height);
         return Point_muster;
     }
+
+
+    public static double min_area;
 }

+ 6 - 6
SimulationServer/Component/SJAllTotalTaskPerformance.cs

@@ -9,10 +9,10 @@ public class SJAllTotalTaskPerformance
     public string 平均搜索时间;
     public string 平均救助时间;
     public string 总飞行时间;
-    public string情覆盖率;
+    public string上搜索覆盖面积;
     public string 任务是否成功;
     public string 人员存活率;
-    public string 环境覆盖率;
+    public string 环境搜索覆盖面积;
 }
 
 public class SJAllTotalTaskPerformanceComponent
@@ -69,7 +69,7 @@ public class SJAllTotalTaskPerformanceComponent
         SSJAllTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / aircreftCount).ToString("f4");
         SSJAllTotalTaskPerformance.平均救助时间 = (平均救助时间 / aircreftCount).ToString("f4");
         SSJAllTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString("f4");
-        SSJAllTotalTaskPerformance.海情覆盖率 = "0.6".ToString();//"60%"
+        SSJAllTotalTaskPerformance.海上搜索覆盖面积 = "0.6".ToString();//"60%"
         SSJAllTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
         SSJAllTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
         sIndex++;
@@ -122,7 +122,7 @@ public class SJAllTotalTaskPerformanceComponent
         LSJAllTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / aircreftCount).ToString("f4");
         LSJAllTotalTaskPerformance.平均救助时间 = (平均救助时间 / aircreftCount).ToString();
         LSJAllTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString("f4");
-        LSJAllTotalTaskPerformance.环境覆盖率 = "0.6".ToString();//"60%"
+        LSJAllTotalTaskPerformance.环境搜索覆盖面积 = "0.6".ToString();//"60%"
         LSJAllTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
         LSJAllTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
         lIndex++;
@@ -138,7 +138,7 @@ public class SJAllTotalTaskPerformanceComponent
             { "平均搜索时间", SSJAllTotalTaskPerformance.平均搜索时间.ToString() },
             { "平均救助时间", SSJAllTotalTaskPerformance.平均救助时间.ToString() },
             { "总飞行时间", SSJAllTotalTaskPerformance.总飞行时间.ToString() },
-            { "海情覆盖率", SSJAllTotalTaskPerformance.海情覆盖率.ToString() },
+            { "海情覆盖率", SSJAllTotalTaskPerformance.海上搜索覆盖面积.ToString() },
             { "任务是否成功", SSJAllTotalTaskPerformance.任务是否成功.ToString() },
             { "人员存活率", SSJAllTotalTaskPerformance.人员存活率.ToString() }
         };
@@ -155,7 +155,7 @@ public class SJAllTotalTaskPerformanceComponent
             { "平均搜索时间", LSJAllTotalTaskPerformance.平均搜索时间.ToString() },
             { "平均救助时间", LSJAllTotalTaskPerformance.平均救助时间.ToString() },
             { "总飞行时间", LSJAllTotalTaskPerformance.总飞行时间.ToString() },
-            { "环境覆盖率", LSJAllTotalTaskPerformance.环境覆盖率.ToString() },
+            { "环境覆盖率", LSJAllTotalTaskPerformance.环境搜索覆盖面积.ToString() },
             { "任务是否成功", LSJAllTotalTaskPerformance.任务是否成功.ToString() },
             { "人员存活率", LSJAllTotalTaskPerformance.人员存活率.ToString() }
         };

+ 17 - 8
SimulationServer/Component/TaskComponent.cs

@@ -1,6 +1,7 @@
 using KYFramework;
 using Model;
 using OpenQA.Selenium.Remote;
+using SimulationCommon;
 using SimulationServer.Utils;
 
 namespace SimulationServer;
@@ -544,7 +545,16 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                 if (任务是否成功 == 1)
                     self.seaSuccessCount++;
 
-                allTotalTaskPerformance.识别成功率 = (识别成功率 / 人员数量).ToString();
+                if (人员数量 != 0)
+                {
+                    allTotalTaskPerformance.识别成功率 = (识别成功率 / 人员数量).ToString();
+                    allTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
+                }
+                else
+                {
+                    allTotalTaskPerformance.识别成功率 = "0";
+                    allTotalTaskPerformance.人员存活率 = "0";
+                }
                 allTotalTaskPerformance.任务准备时间 = 任务准备时间.ToString();
                 if (searchCount != 0)
                     allTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / searchCount).ToString("f4"); // aircreftCount
@@ -555,18 +565,17 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                 else
                     allTotalTaskPerformance.平均救助时间 = "0";
                 allTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString("f4");
-                allTotalTaskPerformance.海情覆盖率 = "0.6".ToString();//"60%"
+                allTotalTaskPerformance.海上搜索覆盖面积 = Rectangular_Area_Search_Function.min_area.ToString();//"0.6".ToString();//"60%"
                 allTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
-                allTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
-                allTotalTaskPerformance.环境覆盖率 = "0.6".ToString();
+                allTotalTaskPerformance.环境搜索覆盖面积 = "0.6".ToString();
 
                 Console.WriteLine("单轮次总体指标识别成功率:" + allTotalTaskPerformance.识别成功率);
                 Console.WriteLine("单轮次总体指标任务准备时间:" + allTotalTaskPerformance.任务准备时间);
                 Console.WriteLine("单轮次总体指标平均搜索时间:" + allTotalTaskPerformance.平均搜索时间);
                 Console.WriteLine("单轮次总体指标平均救助时间:" + allTotalTaskPerformance.平均救助时间);
                 Console.WriteLine("单轮次总体指标总飞行时间:" + allTotalTaskPerformance.总飞行时间);
-                Console.WriteLine("单轮次总体指标海情覆盖率:" + allTotalTaskPerformance.海情覆盖率);
-                Console.WriteLine("单轮次总体指标环境覆盖率:" + allTotalTaskPerformance.环境覆盖率);
+                Console.WriteLine("单轮次总体指标海上搜索覆盖面积:" + allTotalTaskPerformance.海上搜索覆盖面积);
+                Console.WriteLine("单轮次总体指标环境搜索覆盖面积:" + allTotalTaskPerformance.环境搜索覆盖面积);
                 Console.WriteLine("单轮次总体指标任务是否成功:" + allTotalTaskPerformance.任务是否成功);
                 Console.WriteLine("单轮次总体指标人员存活率:" + allTotalTaskPerformance.人员存活率);
                 Console.WriteLine("===============================================================");
@@ -582,7 +591,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     { "平均搜索时间", allTotalTaskPerformance.平均搜索时间.ToString() },
                     { "平均救助时间", allTotalTaskPerformance.平均救助时间.ToString() },
                     { "总飞行时间", allTotalTaskPerformance.总飞行时间.ToString() },
-                    { "海情覆盖率", allTotalTaskPerformance.海情覆盖率.ToString() },
+                    { "海上搜索覆盖面积", allTotalTaskPerformance.海上搜索覆盖面积.ToString() },
                     { "任务是否成功", allTotalTaskPerformance.任务是否成功.ToString() },
                     { "人员存活率", allTotalTaskPerformance.人员存活率.ToString() }
                 };
@@ -596,7 +605,7 @@ public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
                     { "平均搜索时间", allTotalTaskPerformance.平均搜索时间.ToString() },
                     { "平均救助时间", allTotalTaskPerformance.平均救助时间.ToString() },
                     { "总飞行时间", allTotalTaskPerformance.总飞行时间.ToString() },
-                    { "环境覆盖率", allTotalTaskPerformance.环境覆盖率.ToString() },
+                    { "环境搜索覆盖面积", allTotalTaskPerformance.环境搜索覆盖面积.ToString() },
                     { "任务是否成功", allTotalTaskPerformance.任务是否成功.ToString() },
                     { "人员存活率", allTotalTaskPerformance.人员存活率.ToString() }
                 };

+ 1 - 1
SimulationServer/Entity/AircraftLandSJ.cs

@@ -200,7 +200,7 @@ public class AircraftLandSJ : AircraftEntity
                     // Pd0 = 0.5 / Pf0 = Math.Pow(10,-6) / Pf = Math.Pow(10,-6) / R0 = 23645 / sigma0 = 5000 / sigma = Editor雷达截面面积 // R 单位m 
                     probability = helper.GetRadarPossibility(0.5, Math.Pow(10, -6), Math.Pow(10, -6), 23645, aricraftPoint, FlightPlanEditor.targetpoint[0], FlightPlanEditor.targetpoint[0].TargetType.RadarArea, 5000, visibility);
                 }
-                else if (searchMissionPayload.SearchPayload == "目视搜")
+                else if (searchMissionPayload.SearchPayload == "目视搜")
                 {
                     probability = helper.GetMushiLandProbability(aricraftPoint, visibility, FlightPlanEditor.targetpoint[0]);
                 }

+ 6 - 4
SimulationServer/Entity/AircraftSJ.cs

@@ -98,7 +98,7 @@ public class AircraftSJ : AircraftEntity
             MissionEndPointHeight = 0
         };
 
-        var temp = SeaSJ.getminEnclosingRect(trajectory);
+        var temp = SeaSJ.getminEnclosingRect(trajectory); // 
         // temp 转成 List<Point>
         List<Point> points = new List<Point>();
         foreach (var item in temp)
@@ -292,12 +292,14 @@ public class AircraftSJ : AircraftEntity
                     targetPoint.y);
                 //Console.WriteLine("targetPoint:" + targetPoint.x + "-" + targetPoint.y + "-" + targetPoint.z);
                 Log.Info("距离:====================" + distance);
+
+                //Console.WriteLine("searchMissionPayload.SearchPayload:" + searchMissionPayload.SearchPayload);
                 if (searchMissionPayload.SearchPayload == "雷达搜索")
                 {
                     // Pd0 = 0.5 / Pf0 = Math.Pow(10,-6) / Pf = Math.Pow(10,-6) / R0 = 23645 / sigma0 = 5000 / sigma = Editor雷达截面面积 // R 单位m 
                     probability = helper.GetRadarPossibility(0.5, Math.Pow(10, -6), Math.Pow(10, -6), 23645, aricraftPoint, FlightPlanEditor.targetpoint[0], FlightPlanEditor.targetpoint[0].TargetType.RadarArea, 5000, vis);
                 }
-                else if (searchMissionPayload.SearchPayload == "目视搜")
+                else if (searchMissionPayload.SearchPayload == "目视搜")
                 {
                     probability = helper.GetMushiSeaProbability(aricraftPoint, vis, waveHigh, FlightPlanEditor.targetpoint[0]);
                 }
@@ -314,7 +316,7 @@ public class AircraftSJ : AircraftEntity
 
                 // 到搜寻航路点的最后一个点 (?)
                 Log.Info(
-                    $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到落水人员{isseePerson}");
+                    $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到目标{isseePerson}");
                 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;
@@ -371,7 +373,7 @@ public class AircraftSJ : AircraftEntity
             //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}");
+                $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},是否看到目标{isseePerson},人员是否幸存:{Success}");
 
             //finalProbability = 1 - finalProbability;
 

+ 13 - 13
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -115,19 +115,19 @@ public class ServerStartEventHandler : AEvent<ServerStart>
         //}
         //Console.WriteLine("taskConfig.seaSouJiuTasks.Count:" + taskConfig.seaSouJiuTasks.Count);
         //创建搜救
-        //foreach (var seaSJTask in taskConfig.seaSouJiuTasks)
-        //{
-        //    taskSys.missionCount++;
-        //    //Console.WriteLine("seaSJTask.missionInformation.MissionName:" + seaSJTask.missionInformation.MissionName);
-        //    //Console.WriteLine("TargetPointId:" + seaSJTask.TargetPointId);
-        //    //Console.WriteLine("SearchPayload:" + seaSJTask.SearchPayload);
-        //    //Console.WriteLine("SearchMode:" + seaSJTask.SearchMode);
-        //    //Console.WriteLine("RadarTransmitterPower:" + seaSJTask.RadarTransmitterPower);
-        //    //Console.WriteLine("仿真次数:" + editorConfig.runCounts);
-        //    Game.EventSystem.Publish(new CreateSeaSJTask
-        //    { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
-        //    //break;
-        //}
+        foreach (var seaSJTask in taskConfig.seaSouJiuTasks)
+        {
+            taskSys.missionCount++;
+            //Console.WriteLine("seaSJTask.missionInformation.MissionName:" + seaSJTask.missionInformation.MissionName);
+            //Console.WriteLine("TargetPointId:" + seaSJTask.TargetPointId);
+            //Console.WriteLine("SearchPayload:" + seaSJTask.SearchPayload);
+            //Console.WriteLine("SearchMode:" + seaSJTask.SearchMode);
+            //Console.WriteLine("RadarTransmitterPower:" + seaSJTask.RadarTransmitterPower);
+            //Console.WriteLine("仿真次数:" + editorConfig.runCounts);
+            Game.EventSystem.Publish(new CreateSeaSJTask
+            { EditorConfig = editorConfig, SeaSJTask = seaSJTask });
+            //break;
+        }
 
         foreach (var landSXTask in taskConfig.LandSouXunTasks)
         {

+ 1 - 1
SimulationServer/bin/Debug/net7.0/Missions/editor_config.json

@@ -1,5 +1,5 @@
 {
-    "仿真次数":2,
+    "仿真次数":1,
     "想定信息": {
         "想定日期": "2024年6月4日",
         "想定时间": "00时00分00秒"

+ 2 - 0
SimulationServer/bin/Debug/net7.0/Missions/task_config.json

@@ -129,6 +129,7 @@
                             30.0709
                         ]
                     ],
+                    "环境搜索覆盖面积": 95.8,
                     "搜索扫视宽度": 0.02
                 }
             ]
@@ -202,6 +203,7 @@
                             30.0709
                         ]
                     ],
+                    "环境搜索覆盖面积": 95.8,
                     "等高线高度间隔": 300,
                     "最小等高线节点数": 1000,
                     "航线真实高度": 200,

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