Commit Graph

27 Commits

Author SHA1 Message Date
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
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
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
a19dced505 fix: SqliteConnectionTracker — AssemblyReloadEvents.beforeAssemblyReload 安全关闭
- 静态追踪所有 SQLiteConnection,domain reload 前 Dispose 全部
- 替换所有 GC.Collect+WaitForPendingFinalizers 为 Tracker 模式
- DatabaseManager、ScenarioManager、中、SimulationRunner 等全部 Track/Untrack
2026-06-13 12:30:48 +08:00
fe7eb723a1 refactor: 清除 SimEvent alias 遗留——统一使用 using CounterDrone.Core.Simulation 2026-06-13 11:50:49 +08:00
50ec14bb24 refactor: 引擎自治 — 不再需要外部传 SetFireSchedule
- SimulationEngine.Initialize 内建 BuildFireUnits/BuildDroneGroups → 自动调 Planner
- 删除 FullPipelineTests 中的 BuildFireSchedule/_lastFireSchedule/手动 SetFireSchedule
- Unity Managers 删除手动 SetFireSchedule 调用
- 引擎是 Planner 的唯一调用者,测试和 UI 不再碰火控逻辑
2026-06-13 09:58:11 +08:00
7d080bc929 fix: Unity 测试配置 - 火力单元改为 8×3 发(与集成测试一致) 2026-06-13 09:19:30 +08:00
66537d1621 fix: Unity 脚本编译错误 - 缺少 AVector3 别名和 detail 变量 2026-06-13 09:16:47 +08:00
3a2f68b02b refactor: 删除 SimulationRunner.BuildFireSchedule fallback
- Planner 输出直接传给 Engine.SetFireSchedule
- ManagerVerification/SimulationBootstrap 在 LoadAndStart 前设置 fire schedule
- 引擎不再需要从 CloudDispersal 反推发射计划
2026-06-13 09:15:21 +08:00
317f47280b refactor: DefensePlanner 替代 DefenseAdvisor
- 新增 IDefensePlanner 接口 + DefaultDefensePlanner 实现
- FireUnit 重构为统一平台模型(Type/Position/CruiseSpeed/ReleaseAltitude/MuzzleVelocity)
- DroneGroup 加入威胁指数(类型系数×速度系数)和优先级排序
- 五步流水线:威胁排序→弹药匹配→候选生成→贪心分配→时序生成
- 弹药精确匹配,不降级;临界方案基于50%概率阈值
- 删除 IDefenseAdvisor/DefaultDefenseAdvisor/RecommendMultiGroup
- AlgorithmFactory 注册 IDefensePlanner
- 测试更新:DefensePlannerTests 替代旧测试,FullPipelineTests 适配新 API
- Unity Managers 更新调用
- 125 测试全通过
2026-06-12 18:20:25 +08:00
c4d9ccc4fa feat: 空基平台飞行与投弹功能
- PlatformEntity: 新增状态机 Idle→FlyingToTarget→ReadyToRelease
- EquipmentDeployment: 新增 CruiseSpeed 字段(空基平台巡航速度)
- MunitionEntity: 空投弹药继承载机速度矢量,替代自由落体
- Kinematics: 新增 AirDropPosition/AirDropFallTime/DirectionVelocity 工具方法
- SimulationEngine: 空基平台先飞后投,AdjustFireTimesForAirBased 补偿飞行耗时
- SimulationRunner: 空基平台 3D 可视化(蓝色 Capsule)
- 集成测试 Scenario_AirBased_PlatformFliesAndDrops 通过(8x 加速)
- 实施文档同步进度
2026-06-12 17:38:21 +08:00
b7afe23238 fix: ManagerVerification用固定tickDt替代Editor不稳定的Time.deltaTime 2026-06-12 16:36:03 +08:00
845f8dcd1b 所有Manager Awake改成public + ManagerVerification直调Awake 2026-06-12 16:32:31 +08:00
1bbe5d28c5 fix: 报告生成空列表保护 + 仿真后关闭引擎防DB锁 2026-06-12 16:26:10 +08:00
aa6e4d3508 fix: TargetConfig加GroupId=default匹配RoutePlan 2026-06-12 16:21:02 +08:00
6bbad9155a fix: SimulationRunner也补SendMessage(Awake) 2026-06-12 16:18:25 +08:00
fb6c4c7c12 fix: ManagerVerification手动插入默认弹药, 数据库无JSON时表为空 2026-06-12 16:16:48 +08:00
1eba842487 fix: Edit模式下AddComponent不调Awake, 显式SendMessage 2026-06-12 16:11:51 +08:00
59732d2542 ScenarioManager.Awake加try-catch定位根因 2026-06-12 16:08:18 +08:00
b40392c64a fix: ManagerVerification显式调用Awake避免ContextMenu不触发 2026-06-12 16:06:32 +08:00
5851ce2ea8 fix: ManagerVerification + SimulationBootstrap适配多编队 Route/WaypointGroups 2026-06-12 16:04:49 +08:00
12cb6576fe 多批次Phase1: RoutePlan改Id主键+Waypoint加GroupId+ScenarioService/Engine/所有测试适配 2026-06-12 15:33:37 +08:00
2d14c17d9c 默认弹药改为JSON文件导入 + DatabaseManager种子数据 + 测试手动插入, 129测试通过 2026-06-12 11:17:59 +08:00
6a184d9bf8 推荐算法ComputeEffectiveRadius用高斯公式,BuildFireSchedule去掉算法逻辑,129测试通过 2026-06-12 11:03:30 +08:00
1ce560c48a Phase 6: 4个Manager + 全流程验证 + Unity项目结构 2026-06-11 17:41:47 +08:00