123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712 |
- using KYFramework;
- using Model;
- using OpenQA.Selenium.Remote;
- using SimulationCommon;
- using SimulationServer.Utils;
- namespace SimulationServer;
- public class TaskComponent : Component
- {
- public static Weather Weather;
- public static int Speed = 100;
- // 救援任务列表
- public List<MHRescueMission> MHRescueMissions;
- public List<XHRescueMission> XHRescueMissions;
- public List<ZCRescueMission> ZCRescueMissions;
- public List<SeaSJRescueMission> SeaSJRescueMissions;
- public List<LandSJRescueMission> LandSJRescueMissions;
- public List<KZDYMission> KZDYMissions;
- public List<KTKSMission> KTKSMissions;
- public List<ZSJYMission> ZSJYMissions;
- public List<JJJYMission> JJJYMissions;
- public List<SHJMission> SHJMissions;
- public List<XCJJMission> XCJJMissions;
- public List<YLZYMission> YLZYMissions;
- public List<YLWPYSMission> YLWPYSMissions;
- public List<JCDZZYMission> JCDZZYMissions;
- public SJAllTotalTaskPerformanceComponent SSJAllTotalTaskPerformance = new SJAllTotalTaskPerformanceComponent();
- public Dictionary<string, Dictionary<string, List<string>>> alltotalReportSea = new();
- public Dictionary<string, Dictionary<string, List<string>>> alltotalReportLand = new();
- // <sheet,<指标名,值列表>>
- public Dictionary<string, Dictionary<string, List<string>>> totalReportSea = new();
- public Dictionary<string, Dictionary<string, List<string>>> totalReportLand = new();
- private int currentSeaExecuteCount = 1;
- private int currentLandExecuteCount = 1;
- public int ExecutionContext = 0;
- public int seaSuccessCount = 0;
- public int landSuccessCount = 0;
- public bool isSea;
- public bool isLand;
- public string date;
- public int missionCount;
- public void Start()
- {
- MHRescueMissions?.ForEach(r => r.Reset());
- XHRescueMissions?.ForEach(r => r.Reset());
- MHRescueMissions?.ForEach(r => r.Start());
- XHRescueMissions?.ForEach(r => r.Start());
- ZCRescueMissions?.ForEach(r => r.Start());
- SeaSJRescueMissions?.ForEach(r => r.Start());
- LandSJRescueMissions?.ForEach(r => r.Start());
- KZDYMissions?.ForEach(r => r.Start());
- KTKSMissions?.ForEach(r => r.Start());
- ZSJYMissions?.ForEach(r => r.Start());
- JJJYMissions?.ForEach(r => r.Start());
- SHJMissions?.ForEach(r => r.Start());
- XCJJMissions?.ForEach(r => r.Start());
- YLZYMissions?.ForEach(r => r.Start());
- YLWPYSMissions?.ForEach(r => r.Start());
- JCDZZYMissions?.ForEach(r => r.Start());
- }
- public void SaveSeaSJ(Dictionary<string, Dictionary<string, string>> totalReport)
- {
- //把totalReport保存到alltotalReport
- foreach (var kv in totalReport)
- {
- if (!alltotalReportSea.ContainsKey(kv.Key)) alltotalReportSea[kv.Key] = new Dictionary<string, List<string>>();
- foreach (var kv2 in kv.Value)
- {
- if (!alltotalReportSea[kv.Key].ContainsKey(kv2.Key)) alltotalReportSea[kv.Key][kv2.Key] = new List<string>();
- alltotalReportSea[kv.Key][kv2.Key].Add(kv2.Value);
- }
- }
- if (currentSeaExecuteCount == ExecutionContext)
- {
- // 求一个平均值放到最后一位
- foreach (var kv in alltotalReportSea)
- {
- foreach (var kv2 in kv.Value)
- {
- var sum = 0f;
- foreach (var value in kv2.Value)
- {
- bool isfloat = float.TryParse(value, out float f);
- if (isfloat)
- sum += float.Parse(value);
- else
- sum = -1f;
- }
- if (sum != -1f)
- kv2.Value.Add((sum / kv2.Value.Count).ToString());
- else
- kv2.Value.Add("");
- }
- }
- }
- currentSeaExecuteCount++;
- }
- public void SaveLandSJ(Dictionary<string, Dictionary<string, string>> totalReport)
- {
- //把totalReport保存到alltotalReport
- foreach (var kv in totalReport)
- {
- if (!alltotalReportLand.ContainsKey(kv.Key)) alltotalReportLand[kv.Key] = new Dictionary<string, List<string>>();
- foreach (var kv2 in kv.Value)
- {
- if (!alltotalReportLand[kv.Key].ContainsKey(kv2.Key)) alltotalReportLand[kv.Key][kv2.Key] = new List<string>();
- alltotalReportLand[kv.Key][kv2.Key].Add(kv2.Value);
- }
- }
- if (currentLandExecuteCount == ExecutionContext)
- {
- // 求一个平均值放到最后一位
- foreach (var kv in alltotalReportLand)
- {
- foreach (var kv2 in kv.Value)
- {
- var sum = 0f;
- foreach (var value in kv2.Value)
- {
- bool isfloat = float.TryParse(value, out float f);
- if (isfloat)
- sum += float.Parse(value);
- else
- sum = -1f;
- }
- if (sum != -1f)
- kv2.Value.Add((sum / kv2.Value.Count).ToString());
- else
- kv2.Value.Add("");
- }
- }
- }
- currentLandExecuteCount++;
- }
- public void ReportAllSJSea()
- {
- //string data = DateTime.Now.ToString("yyyy-MM-dd");
- string path = $"Reports/{date}";
- if (!Directory.Exists(path)) Directory.CreateDirectory(path);
- string totalPath = "";
- if (isSea)
- totalPath = $"{path}/{"海上搜救任务总体指标报告"}.xls";
- if (isLand)
- totalPath = $"{path}/{"陆上搜救任务总体指标报告"}.xls";
- DataTableExtensions.SaveToExcel(totalPath, alltotalReportSea, true, true, (seaSuccessCount * 1f / ExecutionContext).ToString());
- //string totalPath1 = $"{path}/{"搜救任务总体指标报告"}.xls";
- //DataTableExtensions.SaveToExcel(totalPath1, totalReportSea);
- }
- public void ReportAllSJLand()
- {
- string data = DateTime.Now.ToString("yyyy-MM-dd");
- string path = $"Reports/{date}";
- if (!Directory.Exists(path)) Directory.CreateDirectory(path);
- string totalPath = $"{path}/{"陆上搜寻任务总体指标报告"}.xls";
- DataTableExtensions.SaveToExcel(totalPath, alltotalReportLand, true, true, (landSuccessCount * 1f / ExecutionContext).ToString());
- //string totalPath1 = $"{path}/{"搜救任务总体指标报告"}.xls";
- //DataTableExtensions.SaveToExcel(totalPath1, totalReportLand);
- }
- public void SaveTotalMHSea()
- {
- if (!totalReportSea.ContainsKey("总任务表现")) totalReportSea["总任务表现"] = new Dictionary<string, List<string>>();
- if (!totalReportSea["总任务表现"].ContainsKey("任务成功率")) totalReportSea["总任务表现"]["任务成功率"] = new List<string>();
- totalReportSea["总任务表现"]["任务成功率"].Add((seaSuccessCount * 1f / ExecutionContext).ToString());
- }
- public void SaveTotalMHLand()
- {
- if (!totalReportLand.ContainsKey("总任务表现")) totalReportLand["总任务表现"] = new Dictionary<string, List<string>>();
- if (!totalReportLand["总任务表现"].ContainsKey("任务成功率")) totalReportLand["总任务表现"]["任务成功率"] = new List<string>();
- totalReportLand["总任务表现"]["任务成功率"].Add((landSuccessCount * 1f / ExecutionContext).ToString());
- }
- }
- [ObjectSystem]
- public class TaskComponentAwakeSystem : AwakeSystem<TaskComponent>
- {
- public override void Awake(TaskComponent self)
- {
- self.MHRescueMissions = new List<MHRescueMission>();
- self.ZCRescueMissions = new List<ZCRescueMission>();
- self.XHRescueMissions = new List<XHRescueMission>();
- self.SeaSJRescueMissions = new List<SeaSJRescueMission>();
- self.LandSJRescueMissions = new List<LandSJRescueMission>();
- self.KZDYMissions = new List<KZDYMission>();
- self.KTKSMissions = new List<KTKSMission>();
- self.ZSJYMissions = new List<ZSJYMission>();
- self.JJJYMissions = new List<JJJYMission>();
- self.SHJMissions = new List<SHJMission>();
- self.XCJJMissions = new List<XCJJMission>();
- self.YLZYMissions = new List<YLZYMission>();
- self.YLWPYSMissions = new List<YLWPYSMission>();
- self.JCDZZYMissions = new List<JCDZZYMission>();
- }
- }
- [ObjectSystem]
- public class TaskComponentUpdateSystem : UpdateSystem<TaskComponent>
- {
- double 任务准备时间 = 0;
- double 平均搜索时间 = 0;
- double 总飞行时间 = 0;
- double 人员存活率 = 0;
- double 任务是否成功 = 0;
- float 识别成功率 = 0f;
- double 平均救助时间 = 0;
- float 人员数量 = 0;
- float 识别数量 = 0;
- double 环境搜索覆盖面积 = 0;
- double 海上搜索覆盖面积 = 0;
- double aircreftCount = 0;
- double searchCount = 0;
- double jzCount = 0;
- public bool isSeaSJRescueMissionsOver = false;
- public bool isLandSJRescueMissionsOver = false;
- public bool isKZDYMissionsOver = false;
- public bool isKTKSMissionsOver = false;
- public bool isZSJYMissionsOver = false;
- public bool isJJJYMissionsOver = false;
- public bool isSHJMissionsOver = false;
- public bool isXCJJMissionsOver = false;
- public bool isYLZYMissionsOver = false;
- public bool isYLWPYSMissionsOver = false;
- public bool isJCDZZYMissionsOver = false;
- public bool isReport;
- public override void Update(TaskComponent self)
- {
- if (self.SeaSJRescueMissions.Count > 0)
- {
- if (self.SeaSJRescueMissions.All(m => m.IsOver) && !isSeaSJRescueMissionsOver)
- {
- self.missionCount -= self.SeaSJRescueMissions.Count;
- isSeaSJRescueMissionsOver = true;
- //for (int i = 0; i < self.ExecutionContext; i++)
- //{
- // self.SSJAllTotalTaskPerformance.FillData(self.SeaSJRescueMissions);
- // var report = self.SSJAllTotalTaskPerformance.GetReport();
- // if (report["总任务表现"]["任务是否成功"] == "1")
- // self.seaSuccessCount++;
- // self.SaveSeaSJ(report);
- //}
- ////self.SaveTotalMHSea();
- //self.ReportAllSJSea();
- //self.SeaSJRescueMissions.Clear();
- }
- }
- if (self.LandSJRescueMissions.Count > 0)
- {
- if (self.LandSJRescueMissions.All(m => m.IsOver) && !isLandSJRescueMissionsOver)
- {
- self.missionCount -= self.LandSJRescueMissions.Count;
- isLandSJRescueMissionsOver = true;
- //for (int i = 0; i < self.ExecutionContext; i++)
- //{
- // self.SSJAllTotalTaskPerformance.FillData1(self.LandSJRescueMissions);
- // var report = self.SSJAllTotalTaskPerformance.GetReport1();
- // if (report["总任务表现"]["任务是否成功"] == "1")
- // self.landSuccessCount++;
- // self.SaveLandSJ(report);
- //}
- ////self.SaveTotalMHLand();
- //self.ReportAllSJLand();
- //self.LandSJRescueMissions.Clear();
- }
- }
- if (self.KZDYMissions.Count > 0)
- {
- if (self.KZDYMissions.All(m => m.IsOver) && !isKZDYMissionsOver)
- {
- self.missionCount -= self.KZDYMissions.Count;
- isKZDYMissionsOver = true;
- }
- }
- if (self.KTKSMissions.Count > 0)
- {
- if (self.KTKSMissions.All(m => m.IsOver) && !isKTKSMissionsOver)
- {
- self.missionCount -= self.KTKSMissions.Count;
- isKTKSMissionsOver = true;
- }
- }
- if (self.ZSJYMissions.Count > 0)
- {
- if (self.ZSJYMissions.All(m => m.IsOver) && !isZSJYMissionsOver)
- {
- self.missionCount -= self.ZSJYMissions.Count;
- isZSJYMissionsOver = true;
- }
- }
- if (self.JJJYMissions.Count > 0)
- {
- if (self.JJJYMissions.All(m => m.IsOver) && !isJJJYMissionsOver)
- {
- self.missionCount -= self.JJJYMissions.Count;
- isJJJYMissionsOver = true;
- }
- }
- if (self.SHJMissions.Count > 0)
- {
- if (self.SHJMissions.All(m => m.IsOver) && !isSHJMissionsOver)
- {
- self.missionCount -= self.SHJMissions.Count;
- isSHJMissionsOver = true;
- }
- }
- if (self.XCJJMissions.Count > 0)
- {
- if (self.XCJJMissions.All(m => m.IsOver) && !isXCJJMissionsOver)
- {
- self.missionCount -= self.XCJJMissions.Count;
- isXCJJMissionsOver = true;
- }
- }
- if (self.YLZYMissions.Count > 0)
- {
- if (self.YLZYMissions.All(m => m.IsOver) && !isYLZYMissionsOver)
- {
- self.missionCount -= self.YLZYMissions.Count;
- isYLZYMissionsOver = true;
- }
- }
- if (self.YLWPYSMissions.Count > 0)
- {
- if (self.YLWPYSMissions.All(m => m.IsOver) && !isYLWPYSMissionsOver)
- {
- self.missionCount -= self.YLWPYSMissions.Count;
- isYLWPYSMissionsOver = true;
- }
- }
- if (self.JCDZZYMissions.Count > 0)
- {
- if (self.JCDZZYMissions.All(m => m.IsOver) && !isJCDZZYMissionsOver)
- {
- self.missionCount -= self.JCDZZYMissions.Count;
- isJCDZZYMissionsOver = true;
- }
- }
- //Console.WriteLine("self.missionCount:" + self.missionCount);
- if (self.missionCount == 0 && !isReport)
- {
- for (int i = 0; i < self.ExecutionContext; i++)
- {
- 任务准备时间 = 0;
- 平均搜索时间 = 0;
- 总飞行时间 = 0;
- 人员存活率 = 0;
- 任务是否成功 = 0;
- 识别成功率 = 0f;
- 平均救助时间 = 0;
- 人员数量 = 0;
- 识别数量 = 0;
- 环境搜索覆盖面积 = 0;
- 海上搜索覆盖面积 = 0;
- aircreftCount = 0;
- searchCount = 0;
- jzCount = 0;
- foreach (var item in self.SeaSJRescueMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- 海上搜索覆盖面积 += float.Parse(item1.Value["海上搜索覆盖面积"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- foreach (var item in self.LandSJRescueMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- 环境搜索覆盖面积 += float.Parse(item1.Value["环境搜索覆盖面积"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- foreach (var item in self.KZDYMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- foreach (var item in self.KTKSMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- foreach (var item in self.ZSJYMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- foreach (var item in self.JJJYMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- foreach (var item in self.SHJMissions)
- {
- foreach (var item1 in item.aircraftSJDatas)
- {
- 识别成功率 += 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]);
- 平均救助时间 += float.Parse(item1.Value["平均救助时间"][i]);
- 总飞行时间 += float.Parse(item1.Value["总飞行时间"][i]);
- 人员存活率 += float.Parse(item1.Value["人员存活率"][i]);
- aircreftCount++;
- if (item1.Value["平均搜索时间"][i] != "0")
- 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("===============================================================");
- }
- }
- SJAllTotalTaskPerformance allTotalTaskPerformance = new SJAllTotalTaskPerformance();
- if (人员存活率 != 0)
- 任务是否成功 = 1;
- if (任务是否成功 == 1)
- self.seaSuccessCount++;
- if (识别数量 != 0)
- allTotalTaskPerformance.识别成功率 = (识别成功率 / 识别数量).ToString();
- else
- 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.海上搜索覆盖面积 = 海上搜索覆盖面积.ToString();//"0.6".ToString();//"60%"
- allTotalTaskPerformance.环境搜索覆盖面积 = 环境搜索覆盖面积.ToString();//"0.6".ToString();
- allTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
- if (人员数量 != 0)
- allTotalTaskPerformance.人员存活率 = (人员存活率 / 人员数量).ToString();
- else
- allTotalTaskPerformance.人员存活率 = "0";
- 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("===============================================================");
- Dictionary<string, Dictionary<string, string>> report = new Dictionary<string, Dictionary<string, string>>();
- if (self.isSea)
- {
- report["总任务表现"] = new Dictionary<string, string>
- {
- { "识别成功率", allTotalTaskPerformance.识别成功率.ToString() },
- { "任务准备时间", allTotalTaskPerformance.任务准备时间.ToString() },
- { "平均搜索时间", allTotalTaskPerformance.平均搜索时间.ToString() },
- { "平均救助时间", allTotalTaskPerformance.平均救助时间.ToString() },
- { "总飞行时间", allTotalTaskPerformance.总飞行时间.ToString() },
- { "海上搜索覆盖面积", allTotalTaskPerformance.海上搜索覆盖面积.ToString() },
- { "任务是否成功", allTotalTaskPerformance.任务是否成功.ToString() },
- { "人员存活率", allTotalTaskPerformance.人员存活率.ToString() }
- };
- }
- else if (self.isLand)
- {
- report["总任务表现"] = new Dictionary<string, string>
- {
- { "识别成功率", allTotalTaskPerformance.识别成功率.ToString() },
- { "任务准备时间", allTotalTaskPerformance.任务准备时间.ToString() },
- { "平均搜索时间", allTotalTaskPerformance.平均搜索时间.ToString() },
- { "平均救助时间", allTotalTaskPerformance.平均救助时间.ToString() },
- { "总飞行时间", allTotalTaskPerformance.总飞行时间.ToString() },
- { "环境搜索覆盖面积", allTotalTaskPerformance.环境搜索覆盖面积.ToString() },
- { "任务是否成功", allTotalTaskPerformance.任务是否成功.ToString() },
- { "人员存活率", allTotalTaskPerformance.人员存活率.ToString() }
- };
- }
- self.SaveSeaSJ(report);
- }
- self.ReportAllSJSea();
- isReport = true;
- Console.WriteLine("所有任务执行完成");
- }
- }
- }
|