/// <summary> /// 全时域查询 /// </summary> public CMostTyphoonPoint FullTimeDomainInquiry(DateTime time) { DateTime startTime = points[0].recordTime; TimeSpan span = time - startTime; double totalHour = (points[points.Count - 1].recordTime - startTime).TotalHours; double hour = span.TotalHours; if (hour < 0 || hour >= totalHour) { return(null); } CMostTyphoonPoint requiredPoint = new CMostTyphoonPoint(); for (int i = 0; i < mostPoints.Count; i += 2) { if (hour >= mostPoints[i].StartHour && hour < mostPoints[i].EndHour) { double x0 = ETCProject.Latitude2X(mostPoints[i].latitude); double y0 = ETCProject.Longitude2Y(mostPoints[i].longitude); double vx0 = ETCProject.LatSpeed2Vx(mostPoints[i].latSpeed, mostPoints[i].latitude); double vy0 = ETCProject.LngSpeed2Vy(mostPoints[i].longSpeed, mostPoints[i].latitude); double x_predict = x0 + vx0 * (hour - mostPoints[i].StartHour); //预测x double y_predict = y0 + vy0 * (hour - mostPoints[i].StartHour); //预测y requiredPoint.aveSpeed = mostPoints[i].aveSpeed; requiredPoint.latitude = ETCProject.X2Latitude(x_predict); requiredPoint.longitude = ETCProject.Y2Longitude(y_predict); break; } } return(requiredPoint); }
/// <summary> /// 短期预测 /// </summary> public CMostTyphoonPoint ShortTimePredict(int hour) { CMostTyphoonPoint endPoint = points[POINTSNUM - 1]; double x0 = ETCProject.Latitude2X(endPoint.latitude); double y0 = ETCProject.Longitude2Y(endPoint.longitude); double vx0 = ETCProject.LatSpeed2Vx(endPoint.latSpeed, endPoint.latitude); double vy0 = ETCProject.LngSpeed2Vy(endPoint.longSpeed, endPoint.latitude); double x_predict = x0 + vx0 * hour; //预测x double y_predict = y0 + vy0 * hour; //预测y CMostTyphoonPoint requiredPoint = new CMostTyphoonPoint() { aveSpeed = endPoint.aveSpeed, latitude = ETCProject.X2Latitude(x_predict), longitude = ETCProject.Y2Longitude(y_predict) }; return(requiredPoint); }
/// <summary> /// MOST模型台风构造函数 /// </summary> internal void InitMostModel() { mostPoints.Clear(); int count = POINTSNUM; //轨迹总点数 int hour = 0; CMostTyphoonPoint startpoint = points[0]; startpoint.StartHour = hour; mostPoints.Add(startpoint); for (int j = 1; j < count; j++) { hour = j * 6; double x0 = ETCProject.Latitude2X(mostPoints[mostPoints.Count - 1].latitude); double y0 = ETCProject.Longitude2Y(mostPoints[mostPoints.Count - 1].longitude); double vx0 = ETCProject.LatSpeed2Vx(mostPoints[mostPoints.Count - 1].latSpeed, points[j].latitude); double vy0 = ETCProject.LngSpeed2Vy(mostPoints[mostPoints.Count - 1].longSpeed, points[j].latitude); double x_predict = x0 + vx0 * (hour - mostPoints[mostPoints.Count - 1].StartHour); //预测x double y_predict = y0 + vy0 * (hour - mostPoints[mostPoints.Count - 1].StartHour); //预测y double x1 = ETCProject.Latitude2X(points[j].latitude); //真实x double y1 = ETCProject.Longitude2Y(points[j].longitude); //真实y double vx1 = ETCProject.LatSpeed2Vx(points[j].latSpeed, points[j].latitude); //真实vx double vy1 = ETCProject.LngSpeed2Vy(points[j].longSpeed, points[j].latitude); //真实vy if (GeometryMethod.EuclideanDistance(x_predict, y_predict, x1, y1) > DistanceThreshold) //大于距离阈值 { mostPoints[mostPoints.Count - 1].EndHour = hour; CMostTyphoonPoint endpoint = new CMostTyphoonPoint() { aveSpeed = mostPoints[mostPoints.Count - 1].aveSpeed, latitude = ETCProject.X2Latitude(x_predict), longitude = ETCProject.Y2Longitude(y_predict) }; mostPoints.Add(endpoint); CMostTyphoonPoint newpoint = points[j]; newpoint.StartHour = hour; mostPoints.Add(newpoint); } else if (GeometryMethod.Speed(vx0, vy0) - GeometryMethod.Speed(vx1, vy1) > SpeedThreshold) //大于速度阈值 { mostPoints[mostPoints.Count - 1].EndHour = hour; CMostTyphoonPoint endpoint = new CMostTyphoonPoint() { aveSpeed = mostPoints[mostPoints.Count - 1].aveSpeed, latitude = ETCProject.X2Latitude(x_predict), longitude = ETCProject.Y2Longitude(y_predict) }; mostPoints.Add(endpoint); CMostTyphoonPoint newpoint = points[j]; newpoint.StartHour = hour; mostPoints.Add(newpoint); } else if (GeometryMethod.VelocityDirection(vx0, vy0) - GeometryMethod.VelocityDirection(vx1, vy1) > AngleThreshold) //大于角度阈值 { mostPoints[mostPoints.Count - 1].EndHour = hour; CMostTyphoonPoint endpoint = new CMostTyphoonPoint() { aveSpeed = mostPoints[mostPoints.Count - 1].aveSpeed, latitude = ETCProject.X2Latitude(x_predict), longitude = ETCProject.Y2Longitude(y_predict) }; mostPoints.Add(endpoint); CMostTyphoonPoint newpoint = points[j]; newpoint.StartHour = hour; mostPoints.Add(newpoint); } else if (j == count - 1) //是最后一个点 { mostPoints[mostPoints.Count - 1].EndHour = hour; CMostTyphoonPoint endpoint = new CMostTyphoonPoint() { aveSpeed = mostPoints[mostPoints.Count - 1].aveSpeed, latitude = ETCProject.X2Latitude(x_predict), longitude = ETCProject.Y2Longitude(y_predict) }; mostPoints.Add(endpoint); CMostTyphoonPoint newpoint = points[j]; newpoint.StartHour = hour; mostPoints.Add(newpoint); } } }