123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- using static Fire;
- namespace SimulationServer;
- public class SJAllTotalTaskPerformance
- {
- public string 识别成功率;
- public string 任务准备时间;
- public string 平均搜索时间;
- public string 平均救助时间;
- public string 总飞行时间;
- public string 海情覆盖率;
- public string 任务是否成功;
- public string 人员存活率;
- }
- public class SJAllTotalTaskPerformanceComponent
- {
- public SJAllTotalTaskPerformance SJAllTotalTaskPerformance = new SJAllTotalTaskPerformance();
- public int index;
- public void FillData(List<SeaSJRescueMission> missions)
- {
- double 任务准备时间 = 0;
- double 平均搜索时间 = 0;
- double 总飞行时间 = 0;
- double 人员存活率 = 0;
- double 任务是否成功 = 0;
- float 识别成功率 = 0f;
- double aircreftCount = 0;
- foreach (SeaSJRescueMission mhRescueMission in missions)
- {
- //foreach (var aircraft in mhRescueMission.aircrafts)
- //{
- // if (aircraft.isseePerson)
- // 识别成功率 += 1f;
- // if (任务准备时间 < aircraft.TaskReadyTime)
- // 任务准备时间 = aircraft.TaskReadyTime;
- // 平均搜索时间 += aircraft.SearchTime;
- // 总飞行时间 += aircraft.TotalTime;
- // 人员存活率 += aircraft.Success ? 1 : 0;
- // aircreftCount++;
- //}
- foreach (var item in mhRescueMission.aircraftSJDatas)
- {
- 识别成功率 += float.Parse(item.Value["识别成功率"][index]);
- if (任务准备时间 < float.Parse(item.Value["任务准备时间"][index]))
- 任务准备时间 = float.Parse(item.Value["任务准备时间"][index]);
- 平均搜索时间 += float.Parse(item.Value["平均搜索时间"][index]);
- 总飞行时间 += float.Parse(item.Value["总飞行时间"][index]);
- 人员存活率 += float.Parse(item.Value["人员存活率"][index]);
- aircreftCount++;
- }
- }
- if (人员存活率 != 0)
- 任务是否成功 = 1;
- SJAllTotalTaskPerformance.识别成功率 = (识别成功率 / aircreftCount).ToString();
- SJAllTotalTaskPerformance.任务准备时间 = 任务准备时间.ToString();
- SJAllTotalTaskPerformance.平均搜索时间 = (平均搜索时间 / aircreftCount).ToString();
- SJAllTotalTaskPerformance.平均救助时间 = 5.ToString();
- SJAllTotalTaskPerformance.总飞行时间 = 总飞行时间.ToString();
- SJAllTotalTaskPerformance.海情覆盖率 = "0.6".ToString();//"60%"
- SJAllTotalTaskPerformance.任务是否成功 = 任务是否成功.ToString();
- SJAllTotalTaskPerformance.人员存活率 = (人员存活率 / aircreftCount).ToString();
- index++;
- }
- public Dictionary<string, Dictionary<string, string>> GetReport()
- {
- Dictionary<string, Dictionary<string, string>> report = new Dictionary<string, Dictionary<string, string>>();
- report["总任务表现"] = new Dictionary<string, string>
- {
- { "识别成功率", SJAllTotalTaskPerformance.识别成功率.ToString() },
- { "任务准备时间", SJAllTotalTaskPerformance.任务准备时间.ToString() },
- { "平均搜索时间", SJAllTotalTaskPerformance.平均搜索时间.ToString() },
- { "平均救助时间", SJAllTotalTaskPerformance.平均救助时间.ToString() },
- { "总飞行时间", SJAllTotalTaskPerformance.总飞行时间.ToString() },
- { "海情覆盖率", SJAllTotalTaskPerformance.海情覆盖率.ToString() },
- { "任务是否成功", SJAllTotalTaskPerformance.任务是否成功.ToString() },
- { "人员存活率", SJAllTotalTaskPerformance.人员存活率.ToString() }
- };
- return report;
- }
- }
|