//仿真时间单独计时 public class Fire { public class Aircraft { public string f_model { get; set; } //机型 public string f_type { get; set; } //飞机种类 public int f_pswaterw { get; set; } //喷洒宽度 public int f_pswaterl { get; set; } //长度 public double f_psmj { get; set; } //喷洒面积 } //随机数X:0到1 public static double GenerateRandomNumber() { Random random = new Random(); double randomNumber = random.NextDouble(); return randomNumber; } //小型直升机洒水概率(IP*POS) public static double SAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.72 + 0.01 * Math.Exp(exponent); double result = POS * 1; return POS; } //中型直升机洒水概率 public static double MAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.8 + 0.1 * Math.Exp(exponent); double result = POS * 0.93; return POS; } //大型直升机 public static double LAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.62 + 0.2 * Math.Exp(exponent); double result = POS * 0.87; return POS; } //多引擎水陆两栖飞机 public static double MultiAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.72 + 0.16 * Math.Exp(exponent); double result = POS * 1; return POS; } //单引擎水陆两栖飞机 public static double AmAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.88 + 0.02 * Math.Exp(exponent); double result = POS * 1; return POS; } //单引擎灭火飞机 public static double SEAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.53 + 0.27 * Math.Exp(exponent); double result = POS * 0.8; return POS; } //大型灭火飞机 public static double LFAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.53 + 0.27 * Math.Exp(exponent); double result = POS * 0.74; return POS; } //超大型灭火飞机 public static double ULFAirProbability(double sigma = 1) { double x = GenerateRandomNumber(); double exponent = -Math.Pow(x, 2) / (2 * Math.Pow(sigma, 2)); double POS = 0.53 + 0.27 * Math.Exp(exponent); double result = POS * 0.76; return POS; } //飞机有效洒水面积,sigma一般等于1 public static double SprinklerArea(string type, double sprinklerArea,double sigma = 1) { double _sprinklerArea = 0; switch (type) { case "大型直升机": double probability1 = LAirProbability(sigma)* AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability1; break; case "中型直升机": double probability2 = MAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability2; break; case "小型直升机": double probability3 = SAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability3; break; case "多引擎水陆两栖飞机": double probability4 = MultiAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability4; break; case "单引擎水陆两栖飞机": double probability5 = AmAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability5; break; case "单引擎灭火飞机": double probability6 = SEAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability6; break; case "大型灭火飞机": double probability7 = LFAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability7; break; case "超大型灭火飞机": double probability8 = ULFAirProbability(sigma) * AirdropAccuracy.GetIpForType(type); _sprinklerArea = sprinklerArea * probability8; break; default: break; } return _sprinklerArea; } //地面人员灭火有效面积 //任务开始后,每一批次人员相当于一架飞机,每半小时灭火面积相当于一次洒水面积 //地面部署人员、机降人员到达时间、介入人数(王子涵传入) public static double groundPersonnelWater(int num) { // 灭火火线长度 double PL; // 10分钟洒水火线长度 PL = 0.16 * num * 55; // 10分钟灭火面积 double result = PL * 5; return result; } public class CountArea { public double burncount { get; set; } //火焰蔓延网格数 public double burnarea { get; set; } //火焰蔓延面积 } //输入初始火场面积,计算已蔓延时间 public static double InitialburnTime(double wind, double slope, double InitialArea) { double count = InitialArea / 400; double time = -((-24.889674335 * slope + 3.646092538 * Math.Pow(slope, 2) - 0.088770151 * Math.Pow(slope, 3) - 0.000209294 * Math.Pow(wind, 4) + 0.000048718 * Math.Pow(wind, 3) * slope + 0.000071368 * Math.Pow(wind, 2) * Math.Pow(slope, 2) - 0.000004081 * wind * Math.Pow(slope, 3) + 0.000693082 * Math.Pow(slope, 4) + 14 - count) *60)/ 0.833706211; return time; } /// /// 火焰蔓延计算方法,第一次洒水前是仿真时间 /// /// 风速 /// 坡度 /// 飞机仿真时间/s /// 上一次洒水后的面积 /// 本次洒水时间 /// 上一次洒水时间 /// 初始输入火场面积 /// // public static CountArea burnCalculate(double wind, double slope, double time, double burnarea, double tn, double tn_1, double InitialArea) { double x = GenerateRandomNumber(); if (wind > 12) wind = 12; if(slope > 10) slope = 10*x; if(burnarea == 0) { if (InitialArea > 0) time = InitialburnTime(wind, slope, InitialArea) + time; } else { //上一次洒水后面积计算得到的时间,加上两次洒水间隔 time = InitialburnTime(wind, slope, burnarea) + (tn - tn_1); } double count = -24.889674335 * slope + 3.646092538 * Math.Pow(slope, 2) - 0.088770151 * Math.Pow(slope, 3) - 0.000209294 * Math.Pow(wind, 4) + 0.000048718 * Math.Pow(wind, 3) * slope + 0.000071368 * Math.Pow(wind, 2) * Math.Pow(slope, 2) - 0.000004081 * wind * Math.Pow(slope, 3) + 0.000693082 * Math.Pow(slope, 4) + 0.0138951 * time + 14; double area = count * 400; return new CountArea { burncount = count, burnarea = area }; } /// /// 过火面积计算输出公式 /// /// 风速 /// 坡度 /// 任务耗时 /// 初始输入火场面积 /// public static CountArea burnedCalculate(double wind, double slope, double time, double InitialArea) { double x = GenerateRandomNumber(); if (wind > 14) wind = 14; if (slope > 30) slope = 30*x; if (InitialArea > 0) time += InitialburnTime(wind, slope, InitialArea); double count = -0.001177737 * wind + 0.030355707 * slope - 0.215432836 * Math.Pow(wind, 2)+ 2.581114293 * wind * slope - 0.492540312 * Math.Pow(wind, 3) + 0.332922535 * Math.Pow(wind, 2) * slope- 0.062450523 * wind * Math.Pow(slope, 2) - 0.007056557 * Math.Pow(slope, 2)+ 0.6554745 * time ; double area = count * 400; return new CountArea { burncount = count, burnarea = area }; } }