12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using KYFramework;
- using Define = SimulationServer.Utils.Define;
- namespace SimulationServer;
- public class TotalTaskPerformance
- {
- public string 任务响应时间 = String.Empty;
- public string 总任务耗时 = String.Empty;
- public string 任务是否成功 = String.Empty;
- public string 火场面积变化率 = String.Empty;
- public string 蔓延速度变化率 = String.Empty;
- public string 直接灭火面积 = String.Empty;
- public string 过火面积 = String.Empty;
- public string 伤亡人数 = String.Empty;
- }
- public class TotalTaskPerformanceComponent : Component
- {
- public TotalTaskPerformance TotalTaskPerformance = new TotalTaskPerformance();
-
- public void FillData()
- {
- var mission = GetParent<MHRescueMission>();
-
- TotalTaskPerformance.任务响应时间 = mission.aircrafts.First().TaskResponseTime.ToString("#0.00");
-
- TotalTaskPerformance.总任务耗时 = mission.tn.ToString("#0.00");
- TotalTaskPerformance.任务是否成功 = mission.Success ? "成功" : "失败";
-
- //终止时刻过火面积
- var end = Fire.burnedCalculate(Define.WIND, mission.slope, mission.tn, mission.InitArea);
- TotalTaskPerformance.火场面积变化率 = (end.burnarea/mission.InitArea).ToString("#0.00");
-
- //初始时刻过火面积
- var start = Fire.burnedCalculate(Define.WIND, mission.slope, 10*60, mission.InitArea);
-
- //初始时刻过火面积变化(10分钟面积差)/终止时刻过火面积变化(10分钟面积差);总共算四个面积
- TotalTaskPerformance.蔓延速度变化率 = (start.burnarea/end.burnarea).ToString("#0.00");
-
- //飞机加地面有效洒水面积叠加
- TotalTaskPerformance.直接灭火面积 = mission.area.ToString("#0.00");
-
- TotalTaskPerformance.过火面积 = end.burnarea.ToString("#0.00");
-
- double x = end.burnarea/10000;
- double y1 = 0.3096 * Math.Pow(x, 0.4893);
- double y2 = 1004.4520 * Math.Pow(x, 0.2193);
- double y3 = 0.2312 * Math.Pow(y1, 1.1668);
- double deadRoundedInt = Math.Round(y3);
- double injuredRoundedInt = Math.Round(y1-y3);
-
- TotalTaskPerformance.伤亡人数 = (deadRoundedInt + injuredRoundedInt).ToString();
- }
- public Dictionary<string, Dictionary<string, string>> GetReport()
- {
- Dictionary<string, Dictionary<string, string>> report = new Dictionary<string, Dictionary<string, string>>();
- report["总任务表现"] = new Dictionary<string, string>
- {
- { "任务响应时间/s", TotalTaskPerformance.任务响应时间.ToString() },
- { "总任务耗时/s", TotalTaskPerformance.总任务耗时.ToString() },
- { "任务成功率/-", TotalTaskPerformance.任务是否成功.ToString() },
- { "火场面积变化率/m2/s", TotalTaskPerformance.火场面积变化率.ToString() },
- { "蔓延速度变化率m2/s2", TotalTaskPerformance.蔓延速度变化率.ToString() },
- { "直接灭火面积/m2", TotalTaskPerformance.直接灭火面积.ToString() },
- { "过火面积/m2", TotalTaskPerformance.过火面积.ToString() },
- { "伤亡人数/人", TotalTaskPerformance.伤亡人数.ToString() }
- };
- return report;
- }
-
- }
|