Browse Source

医疗场景修改报告中航程利用率的计算方法

liyang 3 months ago
parent
commit
0c62ec2e90

+ 12 - 3
SimulationServer/Component/SJStaticCapacityComponent.cs

@@ -319,7 +319,10 @@ public class SJStaticCapacityComponent : Component
 
         SJStaticCapacity.资源利用效率 = "1";
         if (Convert.ToDouble(SJStaticCapacity.最大航程) != 0)
-            SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程)).ToString();
+            if (Convert.ToDouble(reportInfo["航程利用率"]) != 0)
+                SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程) / (Convert.ToDouble(reportInfo["航程利用率"]) + 1)).ToString();
+            else
+                SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程)).ToString();
         else
             SJStaticCapacity.航程利用率 = "0";
         SJStaticCapacity.燃油效率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(reportInfo["单机总油耗"])).ToString(); // 公里数/耗油量(L)
@@ -366,7 +369,10 @@ public class SJStaticCapacityComponent : Component
 
         SJStaticCapacity.资源利用效率 = "1";
         if (Convert.ToDouble(SJStaticCapacity.最大航程) != 0)
-            SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程)).ToString();
+            if (Convert.ToDouble(reportInfo["航程利用率"]) != 0)
+                SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程) / (Convert.ToDouble(reportInfo["航程利用率"]) + 1)).ToString();
+            else
+                SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程)).ToString();
         else
             SJStaticCapacity.航程利用率 = "0";
         SJStaticCapacity.燃油效率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(reportInfo["单机总油耗"])).ToString(); // 公里数/耗油量(L)
@@ -412,7 +418,10 @@ public class SJStaticCapacityComponent : Component
 
         SJStaticCapacity.资源利用效率 = "1";
         if (Convert.ToDouble(SJStaticCapacity.最大航程) != 0)
-            SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程)).ToString();
+            if (Convert.ToDouble(reportInfo["航程利用率"]) != 0)
+                SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程) / (Convert.ToDouble(reportInfo["航程利用率"]) + 1)).ToString();
+            else
+                SJStaticCapacity.航程利用率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(SJStaticCapacity.最大航程)).ToString();
         else
             SJStaticCapacity.航程利用率 = "0";
         SJStaticCapacity.燃油效率 = (Convert.ToDouble(reportInfo["单机导航使用情况"]) / Convert.ToDouble(reportInfo["单机总油耗"])).ToString(); // 公里数/耗油量(L)

+ 7 - 0
SimulationServer/Entity/AircraftXCJJ.cs

@@ -167,10 +167,16 @@ public class AircraftXCJJ : AircraftEntity
             //Console.WriteLine("救助时间:" + jiuzhuTimes[i] + " 黄金救援时间:" + sortedPatients[i].GoldenHour * 60);
         }
         //Console.WriteLine("存活率:" + chl / sortedPatients.Count);
+
+        int refuelCount = 0;
+
         for (int i = 0; i < TurningPoints.Count; i++) // 总飞行时间
         {
             TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间   //仿真轮次1 数值1
+            if (TurningPoints[i].TurningPointName == "加油")
+                refuelCount++;
         }
+        Console.WriteLine("加油次数:" + refuelCount);
         Console.WriteLine("TotalTime:" + TotalTime);
 
         reportInfo.Add("准备时间", TaskReadyTime.ToString());
@@ -183,6 +189,7 @@ public class AircraftXCJJ : AircraftEntity
         reportInfo.Add("到达时间", reachTime.ToString()); // 基地 -> 目标点
 
         reportInfo.Add("任务周期时间", TotalTime.ToString());
+        reportInfo.Add("航程利用率", refuelCount.ToString());
         if (sortedPatients.Count != 0)
             reportInfo.Add("存活率", (chl / sortedPatients.Count).ToString());
         else

+ 5 - 1
SimulationServer/Entity/AircraftYLWPYS.cs

@@ -56,11 +56,14 @@ public class AircraftYLWPYS : AircraftEntity
         };
         FXJHGenerate.FromMissionToEnd(FlightPlanEditor, hospitalPoint, ref TurningPoints);
         FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, ref TurningPoints, Velocitys, FuelConsumptions);
-
+        int refuelCount = 0;
         for (int i = 0; i < TurningPoints.Count; i++) // 总飞行时间
         {
             TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间   //仿真轮次1 数值1
+            if (TurningPoints[i].TurningPointName == "加油")
+                refuelCount++;
         }
+        Console.WriteLine("加油次数:" + refuelCount);
         Console.WriteLine("TotalTime:" + TotalTime);
 
         reportInfo.Add("准备时间", TaskReadyTime.ToString());
@@ -71,6 +74,7 @@ public class AircraftYLWPYS : AircraftEntity
         }
         reportInfo.Add("到达时间", reachTime.ToString());
         reportInfo.Add("任务周期时间", TotalTime.ToString());
+        reportInfo.Add("航程利用率", refuelCount.ToString());
         reportInfo.Add("执行任务飞机型号", Name);
         reportInfo.Add("执行任务飞机数量", "1");
         reportInfo.Add("单机操作员人数", taskParameter.operatorPersonnel.ToString());

+ 5 - 0
SimulationServer/Entity/AircraftYLZY.cs

@@ -129,11 +129,15 @@ public class AircraftYLZY : AircraftEntity
         FXJHGenerate.FromMissionToEnd(FlightPlanEditor, hospitalPoint, ref TurningPoints);
         FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, ref TurningPoints, Velocitys, FuelConsumptions);
 
+        int refuelCount = 0;
 
         for (int i = 0; i < TurningPoints.Count; i++) // 总飞行时间
         {
             TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间   //仿真轮次1 数值1
+            if (TurningPoints[i].TurningPointName == "加油")
+                refuelCount++;
         }
+        Console.WriteLine("加油次数:" + refuelCount);
         Console.WriteLine("TotalTime:" + TotalTime);
 
         reportInfo.Add("准备时间", TaskReadyTime.ToString());
@@ -144,6 +148,7 @@ public class AircraftYLZY : AircraftEntity
         }
         reportInfo.Add("到达时间", reachTime.ToString());
         reportInfo.Add("任务周期时间", TotalTime.ToString());
+        reportInfo.Add("航程利用率", refuelCount.ToString());
         reportInfo.Add("执行任务飞机型号", Name);
         reportInfo.Add("执行任务飞机数量", "1");
         reportInfo.Add("单机飞行员人数", taskParameter.pilotPersonnel.ToString());

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

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

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


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


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