From 615c2bea3b3bbe8be28276eeb56c4f8327521b3e Mon Sep 17 00:00:00 2001
From: tian <11429339@qq.com>
Date: Thu, 11 Jun 2026 15:24:25 +0800
Subject: [PATCH] =?UTF-8?q?Phase=204-5:=20DefenseAdvisor=E9=87=8D=E6=9E=84?=
=?UTF-8?q?=20=E2=80=94=20=E5=BC=B9=E8=8D=AF=E8=A7=84=E6=A0=BC=E9=A9=B1?=
=?UTF-8?q?=E5=8A=A8=E3=80=81=E8=BE=93=E5=85=A5=E6=A0=A1=E9=AA=8C=E3=80=81?=
=?UTF-8?q?=E5=A4=9A=E8=BD=AE=E6=AC=A1CloudSalvo=EF=BC=9B=E5=BC=95?=
=?UTF-8?q?=E6=93=8E=E6=94=B9=E4=B8=BA=E7=BA=AF=E6=89=A7=E8=A1=8C=E5=99=A8?=
=?UTF-8?q?=EF=BC=9BKinematics=E5=B7=A5=E5=85=B7=E7=B1=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Algorithms/AlgorithmFactory.cs | 22 +-
.../Algorithms/AlgorithmTypes.cs | 2 +
.../Algorithms/DefaultDefenseAdvisor.cs | 245 +++++++++---------
.../AlgorithmFactoryTests.cs | 8 +-
.../DefenseAdvisorRealityTests.cs | 8 +-
.../DefenseAdvisorTests.cs | 126 +++------
.../FireScheduleDiagnostics.cs | 92 +++++++
.../FullPipelineTests.cs | 49 +++-
.../SimulationEngineTests.cs | 218 +++++++++++++++-
9 files changed, 513 insertions(+), 257 deletions(-)
create mode 100644 test/unit/CounterDrone.Core.Tests/FireScheduleDiagnostics.cs
diff --git a/src/CounterDrone.Core/Algorithms/AlgorithmFactory.cs b/src/CounterDrone.Core/Algorithms/AlgorithmFactory.cs
index 03e7a3c..b4bb48a 100644
--- a/src/CounterDrone.Core/Algorithms/AlgorithmFactory.cs
+++ b/src/CounterDrone.Core/Algorithms/AlgorithmFactory.cs
@@ -6,27 +6,23 @@ namespace CounterDrone.Core.Algorithms
/// 算法工厂 — 统一管理算法组件的创建与替换
public static class AlgorithmFactory
{
- private static readonly Dictionary _registry = new()
+ private static readonly Dictionary> _registry = new()
{
- { typeof(ICloudDispersionModel), typeof(GaussianPuffDispersion) },
- { typeof(IDamageModel), typeof(DamageModelRouter) },
- { typeof(IDefenseAdvisor), typeof(DefaultDefenseAdvisor) },
+ [typeof(ICloudDispersionModel)] = () => new GaussianPuffDispersion(),
+ [typeof(IDamageModel)] = () => new DamageModelRouter(),
+ [typeof(IDefenseAdvisor)] = () => new DefaultDefenseAdvisor(null),
};
- /// 替换某个算法实现(第三方接入点)
- public static void Register() where TImpl : TInterface, new()
+ public static void Register(Func