Planner no longer writes local physics formulas. All kinematics/geometry/damage go through shared utility classes (Kinematics/RouteGeometry/CloudExpansionModel/DamageAssessment). Core: RouteGeometry (route geometry), PlannerConfig + planner_config.json (config externalization). Planner route-aware layout (offset along tangent), cloud overlap 20pct. DroneEntity arc-length driven. Fixes: PathInSphere cloud-frame correction (root cause), GaussianPuffDispersion hardcoded Sunny, ComputeEffectiveRadius cloud age, planner wind offset, remove drone wind bias. Tests 167 to 191, 41s. Windy scenarios pass.
2.2 KiB
2.2 KiB
天气纳入 Planner 规划与物理模型统一
- 日期:2026-06-14
- 提出人:tian
- 关联需求:技术要求终版 2.2.3(云团扩散效果受气象条件影响)
- 优先级:高
变更描述
将天气/风要素纳入 DefensePlanner 规划,并在此过程中发现并修复 planner 与仿真引擎物理模型分裂的根本问题。
起因
原 planner 未考虑天气对云团漂移的影响,有风场景下规划方案与仿真结果不一致。深入排查后发现根因不止于风偏补偿,而是 planner 大量本地重写了运动学/几何公式(直线距离、写死 X 轴 offset、2R 相切假设等),与引擎的实际行为(折线航路、云团移动、PathInSphere 几何)系统性偏离。
变更内容
- 天气纳入扩散模型:修复
GaussianPuffDispersion写死WeatherType.Sunny的 bug,Phase3 高斯扩散改用真实环境天气推导 Pasquill 稳定度 - Planner 风偏补偿:抛撒点逆风预置,云团生成后漂移 expansionTime 秒回到无人机穿越点
- PathInSphere 云团参考系修正:毁伤判定改在云团参考系计算,修正云团在 tick 内移动导致的每 tick ~2m 系统误差(关键根因)
- 物理模型统一架构:新增
RouteGeometry静态工具类,planner 与引擎共用航路几何;planner 删除所有本地物理公式 - 配置外置:新增
PlannerConfig+planner_config.json,策略参数(重叠系数、类型系数、弹药匹配、概率阈值)全部从配置读,代码零默认值 - 云团重叠布局:间距
2R×(1−重叠比例),默认重叠 20%,offset 沿航路切向,支持任意方向/折线航路
影响范围
- 接口变更:
DefaultDefensePlanner构造函数必传PlannerConfig;CloudExpansionModel.RoundsNeeded签名变更(effectiveRadius→spacing) - 数据库变更
- UI 变更
- 文档变更:架构设计 6.5 节、CHANGELOG、VERSION、实施计划
验收
- 全量测试 167 → 191(+24),41s 通过
- 活塞+西风 5m/s、空基+东风 5m/s 有风场景击毁成功(非边界)
- Z 向航路云团沿航路分布(不再写死 X 轴)
- L 形折线多 waypoint 运动正确