补充GroupManager + 架构文档V8(事件驱动/FireSchedule/三阶段扩散)

This commit is contained in:
tian 2026-06-12 14:52:07 +08:00
parent 19dec8e30b
commit b77c308517
2 changed files with 50 additions and 9 deletions

View File

@ -1,11 +1,11 @@
# 反无人机仿真系统 — 总体架构设计
> **版本**V7
> **日期**2026-06-11
> **状态**设计中
> **版本**V8
> **日期**2026-06-12
> **状态**已实现
> **Unity 版本**22.3.62
> **.NET 版本**.NET Standard 2.1
> **变更**明确 Core 程序集独立于 Unity新增 IPathProvider 隔离点新增测试策略xUnit/确定性测试/CI 兼容)
> **变更**事件驱动替代 EventQueueFireSchedule 统一发射接口;三阶段扩散模型;默认弹药 JSON 配置Phase/Elapsed 属性
---
@ -49,15 +49,15 @@
│ │ GroupService │ │ DefenseAdvisor│ │ ├ DroneEntity │ │
│ └──────────────┘ └──────────────┘ │ ├ PlatformEntity │ │
│ ┌──────────────┐ ┌──────────────┐ │ ├ MunitionEntity │ │
│ │ RecordService│ │ReportService │ │ ├ CloudEntity │ │
│ │FrameDataStore│ │ReportService │ │ ├ CloudEntity │ │
│ │ │ │ ├ ReportGen │ │ │ └ GaussianPuff│ │
│ └──────────────┘ │ └ PDF/Word │ │ ├ ControlZone │ │
│ └──────────────┘ │ └ Markdown │ │ ├ ControlZone │ │
│ └──────────────┘ │ ├ IDamageModel×3 │ │
│ │ └ EventQueue │ │
│ │ └ FireSchedule │ │
│ ┌──────────────────────────────────────────────────────┐│
│ │ Algorithm Layer (自主实现) ││
│ │ DispersionEngine | DamageCalculator ││
│ │ DefenseAdvisor | SpatioTemporalOptimizer ││
│ │ GaussianPuffDispersion | DamageCalculator ││
│ │ DefaultDefenseAdvisor | Kinematics(PG稳定度) ││
│ └──────────────────────────────────────────────────────┘│
├──────────────────────────────────────────────────────────┤
│ Data Layer │

View File

@ -0,0 +1,41 @@
using System.Collections.Generic;
using CounterDrone.Core;
using CounterDrone.Core.Models;
using CounterDrone.Core.Repository;
using CounterDrone.Core.Services;
using UnityEngine;
namespace CounterDrone.Unity
{
/// <summary>编组管理桥接 — 无人机编队和装备编组的 CRUD</summary>
public class GroupManager : MonoBehaviour
{
private IGroupService _service;
public IGroupService Service => _service;
void Awake()
{
var paths = new UnityPathProvider();
var db = new DatabaseManager(paths).OpenMainDb();
_service = new GroupService(new GroupRepository(db));
}
public Group Create(string name, GroupType type, string desc = "")
=> _service.CreateGroup(name, type, desc);
public void Delete(string id) => _service.DeleteGroup(id);
public List<Group> GetByType(GroupType? type = null) => _service.GetGroups(type);
public Group Get(string id) => _service.GetGroup(id);
[ContextMenu("Verify")]
void Verify()
{
Awake();
var g = Create("测试编队", GroupType.DroneFleet, "自动验证");
Debug.Log($"GroupManager OK. Created: {g.Name} ({g.Id})");
}
}
}