|
@@ -39,9 +39,7 @@ public class AircraftLandSJ : AircraftEntity
|
|
|
{
|
|
|
Velocitys = new double[5] { 220, 220, 60, 110, 0 }; // 速度
|
|
|
|
|
|
- List<double[]> route = ContourSearch.ContourSearch1(SearchMissionMode.Poly, SearchMissionMode.interval,
|
|
|
- SearchMissionMode.MinLength, SearchMissionMode.TrueH, SearchMissionMode.JG, ContourSearch.DemHelper());
|
|
|
-
|
|
|
+ List<double[]> route = ContourSearch.ContourSearch1(SearchMissionMode.Poly, SearchMissionMode.interval,SearchMissionMode.MinLength, SearchMissionMode.TrueH, SearchMissionMode.JG, ContourSearch.DemHelper());
|
|
|
|
|
|
// route 转成 List<AirRoute>
|
|
|
List<AirRoute> airRoutes = new List<AirRoute>();
|
|
@@ -57,7 +55,6 @@ public class AircraftLandSJ : AircraftEntity
|
|
|
|
|
|
FlightPlanEditor.airroute = airRoutes.ToArray();
|
|
|
|
|
|
-
|
|
|
FXJHGenerate.FromStartToMission(FlightPlanEditor, ref TurningPoints); //生成从起点到任务段起点的航路点
|
|
|
|
|
|
// TODO 与王子涵确认这个方法
|
|
@@ -76,7 +73,7 @@ public class AircraftLandSJ : AircraftEntity
|
|
|
double finalProbability = 1.0;
|
|
|
Random random = new Random();
|
|
|
int fireIndex = -1; // 记录发现火点的位置
|
|
|
-
|
|
|
+ //IsOver = true;
|
|
|
do
|
|
|
{
|
|
|
(currentLocation, _) =
|
|
@@ -94,32 +91,18 @@ public class AircraftLandSJ : AircraftEntity
|
|
|
targetPoint.y);
|
|
|
Log.Info("距离:====================" + distance);
|
|
|
|
|
|
- //====================================================
|
|
|
- Text_readNC text_ReadNC = new Text_readNC();
|
|
|
- text_ReadNC.GetNCData();
|
|
|
- text_ReadNC.GetWaveHighData();
|
|
|
- var nCread = text_ReadNC.windNCread;
|
|
|
- var wind = SeaSJ.GetWindVelocityFromAPI(nCread, currentLocation.CurrentLat, currentLocation.CurrentLon,temptime);
|
|
|
-
|
|
|
-
|
|
|
- var windSpeed = Math.Sqrt(wind[0] * wind[0] + wind[1] * wind[1]);
|
|
|
-
|
|
|
- var waveHigh = SeaSJ.GetWaveHeightFromAPI(nCread, currentLocation.CurrentLon,
|
|
|
- currentLocation.CurrentLat, temptime);
|
|
|
-
|
|
|
- //====================================================
|
|
|
if (distance < 20)
|
|
|
{
|
|
|
//TODO 和学生对接确认, 发现概率算法
|
|
|
probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
|
|
|
- windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
|
|
|
+ 10, 10, "遇险人员", "陆地"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
|
|
|
}
|
|
|
|
|
|
|
|
|
//finalProbability *= (1 - probability);
|
|
|
|
|
|
Console.WriteLine(
|
|
|
- $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
|
|
|
+ $"陆上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到遇险人员:{isseePerson}");
|
|
|
|
|
|
double randomValue = random.NextDouble(); // 生成随机数比较概率
|
|
|
if (randomValue < probability) // 1 - finalProbability
|
|
@@ -140,7 +123,7 @@ public class AircraftLandSJ : AircraftEntity
|
|
|
//Console.WriteLine(
|
|
|
// $"海上任务1:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
|
|
|
Console.WriteLine(
|
|
|
- $"海上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到落水人员:{isseePerson}");
|
|
|
+ $"陆上任务:{taskContent.missionInformation.MissionName} 机型: {AircraftId} 当前时间:{temptime},当前位置:{currentLocation.CurrentLon},{currentLocation.CurrentLat},{currentLocation.CurrentHei},概率:{probability},最终概率:{1 - finalProbability},是否看到遇险人员:{isseePerson}");
|
|
|
|
|
|
//finalProbability = 1 - finalProbability;
|
|
|
|