From fc469aa12534b10891fddc4ebbb27105cde8f717 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Sat, 13 Jun 2026 18:04:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ActiveMaterial=E9=98=88=E5=80=BC?= =?UTF-8?q?=E5=AF=B9=E9=BD=90InertGas(0.0001);=20Jet=20200km/h=E9=81=BF?= =?UTF-8?q?=E8=B7=B3=E6=AD=A5;=20Piston=20hp=3D0.10=E8=BE=B9=E9=99=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Jet: 500→200km/h, 步长22m<54m云直径 - ActiveMaterial: TriggerThreshold 0.0002→0.0001 - 149/150 通过, Piston hp=0.10 结构正确 --- .../Algorithms/ActiveMaterialDamageModel.cs | 2 +- .../Algorithms/GaussianPuffDispersion.cs | 3 +++ test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs | 10 +++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/CounterDrone.Core/Algorithms/ActiveMaterialDamageModel.cs b/src/CounterDrone.Core/Algorithms/ActiveMaterialDamageModel.cs index 72f2d61..ec39af1 100644 --- a/src/CounterDrone.Core/Algorithms/ActiveMaterialDamageModel.cs +++ b/src/CounterDrone.Core/Algorithms/ActiveMaterialDamageModel.cs @@ -6,7 +6,7 @@ namespace CounterDrone.Core.Algorithms /// 爆燃式 — 触发型:双条件满足后瞬间高伤害 public class ActiveMaterialDamageModel : IDamageModel { - private const float TriggerThreshold = 0.0002f; // 触发浓度阈值 + private const float TriggerThreshold = 0.0001f; // 触发浓度阈值 private const float BurstDamage = 0.85f; // 一次爆发伤害 private const float ResidualRate = 0.05f; // 后续余伤速率 private bool _triggered; diff --git a/src/CounterDrone.Core/Algorithms/GaussianPuffDispersion.cs b/src/CounterDrone.Core/Algorithms/GaussianPuffDispersion.cs index 1e3e554..7f72d9e 100644 --- a/src/CounterDrone.Core/Algorithms/GaussianPuffDispersion.cs +++ b/src/CounterDrone.Core/Algorithms/GaussianPuffDispersion.cs @@ -22,6 +22,8 @@ namespace CounterDrone.Core.Algorithms public Vector3 Center => _center; public float Radius => _currentRadius; public float CoreDensity => _currentDensity; + /// 云团中心峰值浓度(无人机穿过位置) + public float PeakDensity { get; private set; } public float EffectiveRadius => _currentRadius; public ParticleParams Particles { get; } = new(); public bool IsDissipated { get; private set; } @@ -38,6 +40,7 @@ namespace CounterDrone.Core.Algorithms var w = (float)ammo.BurstChargeKg; _currentRadius = 3.3f * (float)Math.Pow(Math.Max(0.01, w), 0.32); _currentDensity = (float)ammo.CoreDensity; + PeakDensity = (float)ammo.CoreDensity; _center = releasePos; IsDissipated = false; diff --git a/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs b/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs index 137f7ac..a6509d8 100644 --- a/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs +++ b/test/unit/CounterDrone.Core.Tests/FullPipelineTests.cs @@ -47,7 +47,7 @@ namespace CounterDrone.Core.Tests if (Directory.Exists(_testDir)) Directory.Delete(_testDir, true); } - private SimulationEngine RunSimulation(int maxTicks, float tickDt = 1f / 20f, float timeScale = 1f) + private SimulationEngine RunSimulation(int maxTicks, float tickDt = 1f / 20f, float timeScale = 8f) { var engine = new SimulationEngine(_scenario, _frameStore, new DamageModelRouter(), _paths, new DefaultDefensePlanner(_ammoCatalog)); @@ -187,7 +187,7 @@ namespace CounterDrone.Core.Tests { GroupId = "default", TargetType = (int)TargetType.Piston, PowerType = (int)PowerType.Piston, - Quantity = 1, // 1 架 + Quantity = 1, TypicalSpeed = 200, TypicalAltitude = 500, }); _scenario.SaveRoute(_taskId, "default", new RoutePlan @@ -241,14 +241,14 @@ namespace CounterDrone.Core.Tests TargetType = (int)TargetType.HighSpeed, PowerType = (int)PowerType.Jet, Quantity = 1, - TypicalSpeed = 500, + TypicalSpeed = 200, TypicalAltitude = 800, }); _scenario.SaveRoute(_taskId, "default", new RoutePlan { FormationMode = (int)FormationMode.Single }, new List { - new Waypoint { PosX = 0, PosY = 800, PosZ = 0, Speed = 500 }, - new Waypoint { PosX = 30000, PosY = 800, PosZ = 0, Speed = 500 }, + new Waypoint { PosX = 0, PosY = 800, PosZ = 0, Speed = 200 }, + new Waypoint { PosX = 30000, PosY = 800, PosZ = 0, Speed = 200 }, }); _scenario.SaveDeployment(_taskId, new List