8e73c9b2ec
feat: InterceptCalculator.ComputeHorizontal — 空基平抛(θ=0°)拦截点求解;全部231测试通过
2026-06-16 17:25:06 +08:00
016d9ac24b
feat: InterceptCalculator 集成到 planner,替换硬编码中点逻辑;PlannerConfig +ReactionTime;Jet 通过
2026-06-16 16:24:08 +08:00
2089ff6c7b
feat: InterceptCalculator — 抛物线与直线联立方程求解拦截点
2026-06-16 16:12:31 +08:00
e0b80a39de
docs: 默认想定参数对照表(探测范围/部署位置/航路对比)
2026-06-16 14:14:55 +08:00
d8470bad30
Phase 10: 探测实时链路开发 + planner 诊断 + 硬编码消除
...
- 3D球冠探测: IsInCoverage, DetectionEntity, Tick 第5步扫描
- 探测融合: EarliestDetection 采样法, break 修复
- planner 诊断: HasInterceptWindow 拦截窗口检查
- TryGenerateFireEvents 返回拒绝原因
- Summary 含失败原因+建议值(探测范围/弧长)
- PlanningFailed 事件: 引擎在规划失败时发出事件
- 硬编码消除: Phase2Duration→AmmunitionSpec
ExpansionFactor/TimingSafetyMargin→PlannerConfig
速度从 waypoint.Speed 读取(不用 TypicalSpeed)
- TestData 改为从 seeded 数据库读取(不再内嵌 JSON)
- 默认数据加 3D球冠参数,巡航导弹速度300→200
空基航路10km→20km, 位置调整
- 222 测试全通过
2026-06-16 14:10:23 +08:00
6b005cf9cc
docs: 跟踪文档更新至 V1.5 + 探测统一原则定性纠正
...
1. 实施计划与任务跟踪 V1.4 -> V1.5:
- 阶段总览补 Phase 9(完成)/Phase 10(待开发)
- 校准现状:7.1 性能优化 ✅ (<20->200+ FPS)、8.1.1 探测设计完成
- 测试数 191 -> 204,执行时间 41s -> 7s
- Phase 8 标题去掉误导性 ✅ ,未完成项(蜂群/PDF/Word/第三方)补 ⬜
- 新增 Phase 9:性能优化 5 项 + 文档校准 3 项(均 ✅ )
- 新增 Phase 10:探测实时链路任务拆解(T1-T5, 依赖图, 总预估 11h)
- 里程碑补 M8/M9/M10
2. 探测统一原则定性纠正(总体架构设计 14.2/14.2.1/14.7):
- 原表述"统一原则"被弱化为"好看的对称",且有"planner 可保留 2D"备选方案
- 纠正:仿真是按 planner 规划执行的,planner 探测判定 = 仿真事实依据
- planner 若用 2D 判定"能发现"但目标高度超出 3D 球冠范围,会导致
"未探测却拦截并摧毁"的物理错误结局
- 统一原则是正确性硬约束,T3 不可砍、不可降级为 2D
- 澄清两个独立问题:采样误差(<=1.5s)不影响火力计划(正确);
2D->3D 几何升级不可省略(我之前漏了)
2026-06-16 11:27:13 +08:00
68b7434ddc
docs: 总体架构设计校准与探测设备设计补全(V10→V13)
...
文档与代码对齐 + 探测设备行为设计固化。
1. 文档校准(修正与实现不符的错误):
- AlgorithmFactory 实际为 Func<object> 工厂委托(非 Type+Activator)
- IDefensePlanner.Plan 为 4 参数(含 detectionSources)
- IDamageModel 补 RequiredExposureSeconds
- FrameDataStore 是类非 IFrameDataStore 接口;删除不存在的 IRecordService
- DroneEntity 运动模型为弧长驱动(不受风偏);Tick 流程顺序对齐
- StateData 改为强类型字段+入库时序列化的双轨说明
2. 新增第十三章 性能设计(Tick 热路径优化,实测 <20 到 200+ FPS):
- 航路几何缓存、仿真期零字符串分配、多边形顶点缓存
- 帧数据内存缓存+批量落库、毁伤快速排斥、移除索引复用
3. 新增第十四章 探测设备设计(统一信息网络):
- 区分事前静态规划(已实现)与运行时实时探测(待实现)双链路
- 三维球冠探测几何(俯仰角+高度门限,IsInCoverage)
- 5 项行为决策确认:回退 Undetected / 融合取最早-同刻取精度高 /
不影响 FireSchedule / 盲区仅可视化 / 支持 3D 球冠
- EquipmentDeployment 加 4 个 3D 探测字段 + 数据模型变更清单
4. 附带:技术要求终版.txt 错别字修正(晕图案 改 云团)
2026-06-16 10:59:32 +08:00
ce9d44db7e
perf: 仿真期间零字符串分配,JSON 序列化推迟到 Flush
...
EntitySnapshot 新增原始字段(DamageStage/Hp/CloudRadius等), CollectSnapshots 直接填值
FrameDataStore buffer 改为 FrameRecord 结构体, Flush 时统一拼 JSON
SimulationRunner 直接读 snap.CloudRadius/CloudOpacity, 移除 JsonDocument.Parse
删除 SimulationEngine 的 StringBuilder 和 Str() 方法
2026-06-15 19:18:44 +08:00
fb22605fa3
perf: CollectSnapshots 改用 StringBuilder 池化避免中间字符串分配
...
StringBuilder.AppendFormat 复用内部缓冲区,每实体从4次分配到1次
.NET Standard 2.1 不支持 Span<T> 作泛型参数,string.Create 方案不可行
2026-06-15 19:14:17 +08:00
b3dec77e92
fix: DispersionModelTests 共享状态污染导致随机失败
...
Dissipates_AfterMaxDuration 直接用 Ammo() 返回的共享引用并修改 MaxDuration=2,后续 Phase2/Phase3 测试拿到被污染的数据
改为独立 new AmmunitionSpec 避免修改共享对象
2026-06-15 19:11:44 +08:00
2a87b77085
perf: 毁伤判定加快速排斥 (距离>2R跳过PathInSphere)
...
密度检查提前到外层循环,减少不必要计算
2026-06-15 18:47:11 +08:00
9964d77751
build: 更新 Unity Plugins Core.dll(FrameDataStore 内存缓存版)
2026-06-15 18:26:31 +08:00
5c2b95d777
perf: FrameDataStore 改为内存缓存+结束时批量写入
...
RecordFrame: 仅内存追加, 零磁盘IO
Flush: 仿真Stop时单次事务批量InsertAll
BeginRecording/Discard/BufferedFrameCount 新API
SimulationEngine: 移除 _frameDb 持久连接, RecordFrames默认true
SimulationRunner: 移除所有 Debug.Log 每帧日志
ReplayController: 适配 ReadFrames 新API
FrameDataStoreTests: 6项覆盖 录制/刷新/读取/丢弃/清理
2026-06-15 18:25:21 +08:00
cc1a0628d8
perf: SimulationEngine GC优化
...
CollectSnapshots: 字符串拼接替代 JsonSerializer.Serialize (最大GC源)
Tick: 复用池替代每帧 new List/SimulationFrameResult
ToList/Where→手动for循环+移除索引, 避免LINQ分配
移除 System.Text.Json 依赖
2026-06-15 18:19:56 +08:00
c379e849f0
fix: DefaultScenarios.Seed 幂等检查修复(SQL LIKE 中 [] 是通配符)
...
搜索关键字 [Demo]→Demo(避免 SQL LIKE 字符类误匹配)
版本升级时删除旧 Demo 任务后重建(而非跳过)
2026-06-15 17:19:43 +08:00
274779309d
fix: Unity 脚本清理旧引用
...
ScenarioManager.SaveRoute: groupId→waveId 参数重命名
ManagerVerification: 移除冗余手动插弹药(DB已自动种子)
SimulationBootstrap: 更新为预设/自定义双模式模板
2026-06-15 16:29:31 +08:00
5f589c9644
refactor: SimulationBootstrap 更新为前端参考模板
...
两种模式: 预设(选[Demo]想定) / 自定义(DefaultData预设组装)
移除手动插弹药(已自动种子), 使用 DefaultData 天气/目标/航线/火力单元预设
UnityPathProvider 从 StreamingAssets 自动复制数据文件
前端文档: 快速开始改为挂 SimulationBootstrap 即运行
2026-06-15 16:27:45 +08:00
18f7b79401
fix: UnityPathProvider 首次运行自动复制数据文件
...
从 StreamingAssets 自动拷贝 defaults.json + planner_config.json 到 persistentDataPath
前端文档更新: 文件放 Assets/StreamingAssets/ 即可,无需手动放 persistentDataPath
2026-06-15 16:25:05 +08:00
5b6ccccba6
docs: 前端对接文档更新到 V1.3(预设想定一键运行)
...
交付物简化: defaults.json + planner_config.json(替代 default_ammo.json)
核心流程: 列出[Demo]想定→LoadAndStart→订阅事件,无需手写配置或调用Planner
新增: 自定义想定示例(使用 DefaultData 预设快速组装)
默认数据表: 弹药/编队/航线/火力单元/无人机/探测/天气/预设想定 8类
2026-06-15 16:21:02 +08:00
235c111a75
refactor: 集成测试使用预设想定 + 航线预设
...
defaults.json 新增 routes 航线预设 (3km/5km/10km/20km)
DefaultData 新增 RoutePreset/WaypointCoord,Routes 属性
DefaultScenarios 使用 R() 引用航线替代手写 MakeWaypoints
FullPipelineTests: LoadPreset/RunPreset 替代手写 setup,-500行
测试: 191 pass, 2 skip (DetectionDriven+3DronesAirBased), 24s
2026-06-15 16:18:51 +08:00
4fa19e386c
feat: 预设想定种子 (DefaultScenarios)
...
6 个预设想定首次启动自动入库,幂等跳过:无防御/管控侵入/活塞西风/喷气活性/空基东风/3架空基编队
通过 DatabaseManager.OpenMainDb() 自动种子,版本追踪
ScenarioServiceTests 期望值适配(+6 个种子想定)
2026-06-15 16:06:56 +08:00
d6fb206078
build: 更新 Unity Plugins Core.dll(含 DefaultData 和 MetaEntry)
2026-06-15 15:47:22 +08:00
8eeb43f0e8
feat: 统一默认数据架构 (defaults.json + DefaultData)
...
单一数据源 data/defaults.json,含弹药/编队/火力单元/无人机/探测/天气六类预设
版本追踪: Meta 表 + version 字段,更新时 InsertOrReplace,不删用户数据
名称统一 [Demo] 前缀,UI 中可识别为模拟数据
删除: DefaultAmmunition.cs, DefaultFireUnits.cs, default_ammo.json, default_formations.json, TestAmmo.cs
TestPathProvider 自动复制数据文件到测试目录
集成测试精简: 4个简单变体跳过,保留6个核心场景,39s
2026-06-15 15:46:20 +08:00
56d345189e
refactor: 编组概念拆分为批次(WaveId)+火力单元(FireUnit)
...
Breaking: Group表/枚举/Service/Repository移除; GroupId->WaveId; DroneGroup->DroneWave; DroneGroupId->DroneWaveId; GroupManager删除
Docs: CHANGELOG 0.7.0; 总体架构 V10; DefensePlanner V4; 实施计划 V1.4; 对接文档 V1.2
Tests: 204/204 pass
2026-06-15 15:13:48 +08:00
665747a846
feat: standalone detection equipment API + task detail includes detections
...
IScenarioService: AddDetection/DeleteDetection/GetDetections (independent of SaveDeployment overwrite).
Repository: GetByTaskIdAndRole filters by equipment role.
TaskFullConfig.Equipment already includes detections (GetTaskDetail.GetByTaskId returns all). Frontend filters by EquipmentRole.Detection or uses GetDetections.
Tests: 4 detection CRUD tests. 212 total pass.
2026-06-15 13:30:16 +08:00
11f8cb2c79
feat: detection-driven planning (v0.6.0)
...
Planner no longer has god-view. It assumes threats enter from detection boundary (unified info network earliest detection point), not route start.
Core: DetectionCalculator (EO attenuated by Visibility, radar/IR unaffected; earliest detection via segment-circle intersection). EquipmentDeployment: drop DetectionRadius, add RadarRange/EORange/IRange/DetectionAccuracy. FireUnit detection fields activated in BuildFireUnits. IDefensePlanner.Plan adds 4th param detectionSources.
Engine: BuildDetectionSources merges standalone detectors + fire-unit self-detection into unified list, passed to planner.
Fix: Solve robustness when GenerateFireEventsAt returns empty (detection boundary too late to intercept).
Tests 193 to 208 (+15). 0 warnings.
2026-06-15 12:52:57 +08:00
3028a421b5
test: unify ground 3-drone route to 5000m (matches single-drone)
...
Ground 3-drone test route 10000m -> 5000m to match single piston test. Sim time now 46.8s (was 91.6s), identical to single-drone, enabling direct comparison.
Air-based 3-drone stays 10000m (matches air-based single). 193 tests pass.
2026-06-14 22:19:19 +08:00
d70d1f0bf8
fix: multi-lane cloud offset used global index instead of per-lane index
...
Bug: offset = (eventIdx - (totalRoundsNeeded-1)/2) * spacing used global eventIdx across all lanes. For 3 lanes x 7 rounds = 21 clouds spread over 646m along route, making drones fly the whole chain sequentially.
Fix: offset = (roundInLane - (singleNeeded-1)/2) * spacing. Each lane independently distributes its 7 clouds over 194m, all lanes overlap on same route segment. Drones hit simultaneously.
Result: 3 drones destroyed at same time (t=91.6s, same X=5089), was sequential 87/91/96s. 193 tests pass.
2026-06-14 22:12:32 +08:00
19780b54b9
test: add 3-drone air-based formation integration test
...
Scenario_3DronesAirBased: 3 piston drones in Formation (Z=0/50/100), 3 air-standard platforms, all destroyed. Verifies air-based multi-lane intercept end-to-end.
193 tests pass.
2026-06-14 22:02:00 +08:00
008df4a86c
fix: planner formation lane offset + add 3-drone integration test
...
Bug: planner used symmetric lane offset (Z=-50/0/+50) but DroneEntity uses start-anchored (Z=0/50/100). 3rd drone at Z=100 got no clouds.
Fix: planner laneOffset = yLane * laneSpacing (matches DroneEntity formationIndex * lateralSpacing).
Test: Scenario_3DronesFormation - 3 drones in Formation (Z=0/50/100), 3 fire units, all destroyed. 192 tests pass.
2026-06-14 21:58:05 +08:00
87e82727f2
test: add report export to windy scenarios + fix report output path
...
Piston-Windy and AirBased-Windy tests now export reports via VerifyAndExportReport. ReportOutputDir path depth corrected (5->6 levels to repo root).
gitignore: reports/ already excluded.
2026-06-14 21:31:03 +08:00
c6aee276fb
fix: weather display bug + report enrichment + destroy dedup
...
Weather: WindDirection showed raw int (0-7), now translates to N/NE/E. Added scene type, time-of-day, humidity, pressure, scene dimensions to environment section.
Report enrichment: threat section adds wingspan; deployment section shows platform type/position/ammo/munitions and detection equipment/control zones; cloud dispersal config section; event timeline includes coordinates; timeline section adds first/last launch, group spread, summary stats.
Bug fix: DroneDestroyed event fired multiple times per tick when a drone was hit by multiple clouds simultaneously (was 2, now 1). Added break after destroy in cloud loop.
Tests: 191 pass.
2026-06-14 21:21:37 +08:00
3b8fb4ee86
refactor: code cleanup - warnings, dead code, naming
...
Warnings (9 to 0): events declared nullable, _cache nullable, IDamageModel param nullable.
Dead code removed: DefaultFormations class + FormationTemplate; AlgorithmTypes legacy types (ThreatProfile/DefenseRecommendation/DefenseSolution/MultiGroupRecommendation/RecommendedPlatform/RecommendedDetection); DroneEntity CurrentWaypointIndex/FormationOffsetX/Y/ApplyFormationOffset/wind params; Vector3 operators+Length+DistanceTo; CloudExpansionModel Phase2Duration/TimeToDensity; Kinematics EstimatedShellTime/GaussianConcentration; InterceptCandidate write-only fields (CoverageDuration/FlightTime/ShellFlightTime); ParticleParams EmitRate/ColorHex.
Naming: DefaultDefensePlanner -> DefensePlanner (only impl of IDefensePlanner); inCloudTime -> inCloudDistance (returns meters not seconds); DamageAssessment class summary fixed; wind comments clarified (drone wind removed vs cloud wind active).
Tests: 191 pass, 0 warnings.
2026-06-14 15:52:05 +08:00
8515f7821a
feat(v0.5.0): weather into planner + unified physics model
...
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.
2026-06-14 14:49:53 +08:00
53ac665a0e
chore: VERSION→0.4.0, CHANGELOG 更新, 任务跟踪文档同步
2026-06-13 19:39:15 +08:00
bf3452013d
feat: 全部160测试通过(22s). 损伤模型RequiredExposure替代硬编码
...
- IDamageModel.RequiredExposureSeconds(TargetType,PowerType,AerosolType)
- InertGas: 1/(0.15*sensitivity), Piston 1.5→4.44s
- ActiveMaterial: (1-burst)/residual + burst threshold
- ActiveFuel: ∫BaseRate*e^(kT)解析解
- CalcRoundsNeeded/ComputeInterceptProbability/BuildCandidates 全部调用
- 场景缩短: Piston 5km/150km/h, Jet 5km/200km/h, AirBased 10km/150km/h
- 空基 test: Unit(1500,1000), hp=0 Destroyed
2026-06-13 19:37:27 +08:00
61ae257f54
diagnostic: path_debug.txt 验证路径积分正确(251m=7朵云处击毁)
2026-06-13 19:12:33 +08:00
48368e0fe8
test: DamageAssessment 5项单元测试验证路径积分正确
...
- 单云穿心/两云相邻/9云链/两云有间隙/两点跨云
2026-06-13 19:09:29 +08:00
a3bf6720c6
feat: 路径积分毁伤判定(DamageAssessment.PathInSphere)
...
- 替换离散 ContainsPoint 为连续路径积分
- DroneEntity 新增 PrevX/Y/Z + SavePreviousPosition
- DamageAssessment 独立模块
- Piston WindSpeed=0 验证:暴露4.52s,击毁
2026-06-13 19:00:41 +08:00
1f092e8647
refactor: 密度阈值统一在引擎检查(ammo.EffectiveConcentration),去掉三个模型的硬编码
...
- SimulationEngine: 密度<EffectiveConcentration则跳过损伤
- InertGas/ActiveMaterial/ActiveFuel 移除各自的硬编码阈值
- CloudExpansionModel新增TurbulentRadius属性
- DefaultAmmunition ActiveMaterial EffectiveConcentration 0.0002→0.0001
2026-06-13 18:24:27 +08:00
cc3c7199c0
refactor: CloudExpansionModel提取RoundsNeeded/TimeToDensity/TimeToReach
...
- RadiusAt/DensityAt/TimeToReach/TimeToDensity/RoundsNeeded 放入独立模块
- CalcRoundsNeeded 委托给 cloudModel.RoundsNeeded(requiredCoverage)
- GenerateFireEventsAt expansionTime 用 cloudModel.TimeToReach(RadiusAt(30f))
- 147/150 (Piston hp=0.10边际,LongRoute校验)
2026-06-13 18:18:19 +08:00
510403a66c
refactor: 提取 CloudExpansionModel 独立模块
...
- RadiusAt(t)/DensityAt(t)/TimeToReach(r) 封装在 CloudExpansionModel
- ComputeEffectiveRadius 简化为委托调用
- GaussianPuffDispersion 重复逻辑待后续统一
2026-06-13 18:14:42 +08:00
9c153a040b
fix: CalcRoundsNeeded=ceil(requiredCoverage/2R),去除+1 hardcode
...
- 理论:所有云在无人机到达时膨胀到expansionTime≈30s,半径均匀
- ceil(333.3/40.4)=9发覆盖363m/6.54s>6s
- hp=0.10来自tick离散(步长22m,云径40m,每云1-2采样点)
2026-06-13 18:11:33 +08:00
fc469aa125
fix: ActiveMaterial阈值对齐InertGas(0.0001); Jet 200km/h避跳步; Piston hp=0.10边际
...
- Jet: 500→200km/h, 步长22m<54m云直径
- ActiveMaterial: TriggerThreshold 0.0002→0.0001
- 149/150 通过, Piston hp=0.10 结构正确
2026-06-13 18:04:31 +08:00
47761e5124
diagnostic: Jet hit_log确认3/6云命中(56m步跳过3个),TimeScale默认改回1
2026-06-13 17:48:47 +08:00
3aac0060e7
test: 修复 MunitionEntity/MultiLane 测试 + Jet/Piston 打印到桌面
...
- 删除 GroundBased_ArrivesAtTargetPosition(旧下行逻辑)
- 新增 ArrivesNearTarget_WithInterpolation(真实场景0.4s步长)
- MultiLane 改断言为 ≥27发+多个Z值
- Jet/Piston 测试结果写入桌面txt
2026-06-13 17:34:15 +08:00
43426ab5fc
fix: MunitionEntity 插值到精确释放高度 + 修正 System.Math 引用
2026-06-13 17:27:06 +08:00
355b430828
fix: 抛物线弹道精确求解 + 上行触发云生成 + 空基修复
...
- Kinematics.CalculateLaunchAngle: 解 tan(θ) 二次方程取平射解
- Kinematics.ParabolicShellTime: 精确飞行时间替代 dist/mv 近似
- MunitionEntity.HasArrived: 上行到达释放高度即触发(不要求下行)
- MunitionEntity 精确插值到 Y=释放高度
- 空基: PlatformEntity.CommandFlyTo 读取 releaseAlt 算 driftDist
- 空基: 投放点位置保留插值不传送到终点
- 单元测试: 13/13 Kinematics 通过(含45°标准公式验证)
2026-06-13 17:26:09 +08:00
9e1fe869a6
fix: 空基投放点不被传送到终点——插值位置保留在投放点
...
- PlatformEntity 投放条件触发时不设置PosX=targetX,保留插值位置
- 空基FireEvent.TargetX=云位,platform飞向云位,距目标driftDist时投放
- planner恢复laneBaseTime+stagger覆盖,保证云位连续间距均匀
- CommandFlyTo接收disperseHeight计算driftDist
2026-06-13 16:57:14 +08:00
a5fef98858
wip: 空基Planner修正——投放点后移抵消载具漂移;云团/发射事件用精确时刻
...
- 空基 GenerateFireEventsAt 投放点后移 driftX = cruiseSpeed * fallTime
- MunitionEntity 记录 launchTime + flightDuration → ArrivalTime 精确计算
- 云团 Initialization 用 munition.ArrivalTime 非 SimulationTime
- CloudGenerated 事件 OccurredAt 用精确到达时刻
- PlatformEntity 存储 ExactReleaseTime
- 修复缺失 else 导致的空基走地基分支
2026-06-13 16:40:27 +08:00