diff --git a/ThreatSource/data/jammers/ir_jammers/infrared_top_blocking.json b/ThreatSource/data/jammers/ir_jammers/infrared_top_blocking.json new file mode 100644 index 0000000..5c71e00 --- /dev/null +++ b/ThreatSource/data/jammers/ir_jammers/infrared_top_blocking.json @@ -0,0 +1,14 @@ +{ + "name": { + "zh": "红外阻塞干扰器", + "en": "Infrared Blocking Jammer" + }, + "type": "Infrared", + "InfraredJammerConfig": { + "Power": 2000, + "Wavelength": 5, + "AngleRange": 90, + "Mode": "Blocking", + "Duration": 60 + } +} \ No newline at end of file diff --git a/ThreatSource/data/jammers/laser_jammers/laser_standard.json b/ThreatSource/data/jammers/laser_jammers/laser_top_blocking.json similarity index 73% rename from ThreatSource/data/jammers/laser_jammers/laser_standard.json rename to ThreatSource/data/jammers/laser_jammers/laser_top_blocking.json index fc81913..8e580ab 100644 --- a/ThreatSource/data/jammers/laser_jammers/laser_standard.json +++ b/ThreatSource/data/jammers/laser_jammers/laser_top_blocking.json @@ -5,9 +5,9 @@ }, "type": "Laser", "LaserJammerConfig": { - "Power": 1000, - "Wavelength": 1.06, - "AngleRange": 10, + "Power": 2000, + "wavelength": 1.06, + "angleRange": 90, "Mode": "Blocking", "Duration": 60 } diff --git a/ThreatSource/data/jammers/mmw_jammers/mmw_blocking.json b/ThreatSource/data/jammers/mmw_jammers/mmw_blocking.json index 75dbd16..f40ba05 100644 --- a/ThreatSource/data/jammers/mmw_jammers/mmw_blocking.json +++ b/ThreatSource/data/jammers/mmw_jammers/mmw_blocking.json @@ -7,7 +7,7 @@ "MillimeterWaveJammerConfig": { "Power": 2000, "Wavelength": 3.19, - "AngleRange": 10, + "AngleRange": 15, "Mode": "Blocking", "Duration": 60 } diff --git a/ThreatSource/data/jammers/mmw_jammers/mmw_compensation.json b/ThreatSource/data/jammers/mmw_jammers/mmw_compensation.json new file mode 100644 index 0000000..4ac4a66 --- /dev/null +++ b/ThreatSource/data/jammers/mmw_jammers/mmw_compensation.json @@ -0,0 +1,14 @@ +{ + "name": { + "zh": "毫米波补偿干扰器", + "en": "Millimeter Wave Compensation Jammer" + }, + "type": "MillimeterWaveCompensation", + "MillimeterWaveCompensationJammerConfig": { + "CompensationTemperature": 298.15, + "Power": 1000, + "AngleRange": 90, + "Mode": "Deception", + "Duration": 60 + } +} \ No newline at end of file diff --git a/ThreatSource/data/jammers/mmw_jammers/mmw_deception.json b/ThreatSource/data/jammers/mmw_jammers/mmw_deception.json deleted file mode 100644 index 0a6771c..0000000 --- a/ThreatSource/data/jammers/mmw_jammers/mmw_deception.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": { - "zh": "毫米波欺骗干扰器", - "en": "Millimeter Wave Deception Jammer" - }, - "type": "MillimeterWave", - "MillimeterWaveJammerConfig": { - "Power": 800, - "Wavelength": 3.16, - "AngleRange": 15, - "Mode": "Deception", - "Duration": 60 - } -} \ No newline at end of file diff --git a/ThreatSource/data/jammers/mmw_jammers/mmw_standard.json b/ThreatSource/data/jammers/mmw_jammers/mmw_standard.json deleted file mode 100644 index ddab7ed..0000000 --- a/ThreatSource/data/jammers/mmw_jammers/mmw_standard.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": { - "zh": "毫米波阻塞干扰器", - "en": "Millimeter Wave Blocking Jammer" - }, - "type": "MillimeterWave", - "MillimeterWaveJammerConfig": { - "Power": 1000, - "Wavelength": 3.16, - "AngleRange": 10, - "Mode": "Blocking", - "Duration": 60 - } -} \ No newline at end of file diff --git a/ThreatSource/data/jammers/mmw_jammers/mmw_top_blocking.json b/ThreatSource/data/jammers/mmw_jammers/mmw_top_blocking.json new file mode 100644 index 0000000..51c7429 --- /dev/null +++ b/ThreatSource/data/jammers/mmw_jammers/mmw_top_blocking.json @@ -0,0 +1,14 @@ +{ + "name": { + "zh": "毫米波顶部阻塞干扰器", + "en": "Millimeter Wave Top Blocking Jammer" + }, + "type": "MillimeterWave", + "MillimeterWaveJammerConfig": { + "Power": 2000, + "Wavelength": 3.19, + "AngleRange": 90, + "Mode": "Blocking", + "Duration": 60 + } +} \ No newline at end of file diff --git a/ThreatSource/data/missiles/terminal_sensitive/tsm_001.json b/ThreatSource/data/missiles/terminal_sensitive/tsm_001.json index 0de6168..9f1267c 100644 --- a/ThreatSource/data/missiles/terminal_sensitive/tsm_001.json +++ b/ThreatSource/data/missiles/terminal_sensitive/tsm_001.json @@ -39,13 +39,39 @@ "decelerationAcceleration": 250.0, "decelerationEndSpeed": 50.0, "parachuteDeploymentHeight": 400.0, - "parachuteDeceleration": 140.0, + "parachuteDeceleration": 90.0, "stableScanHeight": 200.0, "verticalDeclineSpeed": 10.0, "spiralRotationSpeed": 25.13, "scanAngle": 30.0, "targetDetectionDistance": 150.0, "selfDestructHeight": 20.0, - "attackSpeed": 200.0 + "attackSpeed": 200.0, + "infraredDetectorConfig": { + "maxDetectionRange": 1000.0, + "band": "Medium", + "fieldOfView": 1.0, + "jammingResistanceThreshold": 1e-4 + }, + "radiometerConfig": { + "maxDetectionRange": 1000.0, + "band": "Band3", + "scanFieldOfView": 1.0, + "jammingResistanceThreshold": 1e-4 + }, + "altimeterConfig": { + "maxAltitude": 1000.0, + "band": "Band3", + "measurementAccuracy": 0.5, + "scanFieldOfView": 25.0, + "jammingResistanceThreshold": 1e-4 + }, + "rangefinderConfig": { + "maxDetectionRange": 1000.0, + "wavelength": 1.06, + "pulseRate": 100.0, + "accuracy": 0.5, + "jammingResistanceThreshold": 1e-4 + } } } \ No newline at end of file diff --git a/ThreatSource/src/Data/DataModels.cs b/ThreatSource/src/Data/DataModels.cs index 1f1ea5c..be2fe43 100644 --- a/ThreatSource/src/Data/DataModels.cs +++ b/ThreatSource/src/Data/DataModels.cs @@ -403,6 +403,14 @@ namespace ThreatSource.Data /// 包含毫米波干扰机的配置信息 /// public MillimeterWaveJammerConfig MillimeterWaveJammerConfig { get; set; } = new(); + + /// + /// 获取或设置毫米波补偿干扰机的配置 + /// + /// + /// 包含毫米波补偿干扰机的配置信息 + /// + public MillimeterWaveCompensationJammerConfig MillimeterWaveCompensationJammerConfig { get; set; } = new(); } } \ No newline at end of file diff --git a/ThreatSource/src/Data/ThreatSourceFactory.cs b/ThreatSource/src/Data/ThreatSourceFactory.cs index 9f247d7..28132c3 100644 --- a/ThreatSource/src/Data/ThreatSourceFactory.cs +++ b/ThreatSource/src/Data/ThreatSourceFactory.cs @@ -263,6 +263,12 @@ namespace ThreatSource.Data motionParameters, _simulationManager ), + JammingType.MillimeterWaveCompensation => new MillimeterWaveCompensationJammer( + jammerId, + data.MillimeterWaveCompensationJammerConfig, + motionParameters, + _simulationManager + ), _ => throw new ArgumentException($"不支持的干扰机类型: {data.Type}"), }; } diff --git a/ThreatSource/src/Guidance/BaseGuidanceSystem.cs b/ThreatSource/src/Guidance/BaseGuidanceSystem.cs index 3d5f9d1..4d3d64d 100644 --- a/ThreatSource/src/Guidance/BaseGuidanceSystem.cs +++ b/ThreatSource/src/Guidance/BaseGuidanceSystem.cs @@ -174,28 +174,6 @@ namespace ThreatSource.Guidance base.Deactivate(); } - /// - /// 更新制导系统的状态和计算结果 - /// - /// 自上次更新以来的时间间隔,单位:秒 - /// 导弹当前位置,单位:米 - /// 导弹当前速度,单位:米/秒 - /// - /// 更新过程: - /// - 更新位置信息 - /// - 更新速度信息 - /// - 更新干扰状态 - /// - 准备制导计算 - /// - // public virtual void Update(double deltaTime, Vector3D missilePosition, Vector3D missileVelocity) - // { - // Position = missilePosition; - // Velocity = missileVelocity; - - // // 更新干扰状态 - // _jammingComponent.UpdateJammingStatus(deltaTime); - // } - /// /// 更新制导系统状态 /// diff --git a/ThreatSource/src/Guidance/IGuidanceSystem.cs b/ThreatSource/src/Guidance/IGuidanceSystem.cs index 4859822..8aedcfe 100644 --- a/ThreatSource/src/Guidance/IGuidanceSystem.cs +++ b/ThreatSource/src/Guidance/IGuidanceSystem.cs @@ -24,21 +24,6 @@ namespace ThreatSource.Guidance /// bool HasGuidance { get; } - /// - /// 更新制导系统的状态和计算结果 - /// - /// 自上次更新以来的时间间隔,单位:秒 - /// 导弹当前位置,单位:米 - /// 导弹当前速度,单位:米/秒 - /// - /// 更新过程: - /// - 获取最新目标信息 - /// - 计算制导参数 - /// - 更新制导状态 - /// - 生成制导指令 - /// - //void Update(double deltaTime, Vector3D missilePosition, Vector3D missileVelocity); - /// /// 获取制导加速度指令 /// diff --git a/ThreatSource/src/Jammer/JammingParameters.cs b/ThreatSource/src/Jammer/JammingParameters.cs index 9dc5fd9..44debc3 100644 --- a/ThreatSource/src/Jammer/JammingParameters.cs +++ b/ThreatSource/src/Jammer/JammingParameters.cs @@ -71,6 +71,11 @@ namespace ThreatSource.Jammer /// public DateTime StartTime { get; set; } + /// + /// 补偿温度,单位:开氏温度 + /// + public double? CompensationTemperature { get; set; } + /// /// 诱偏目标位置 /// @@ -171,6 +176,11 @@ namespace ThreatSource.Jammer /// 毫米波干扰 /// MillimeterWave, + + /// + /// 毫米波补偿干扰 + /// + MillimeterWaveCompensation, /// /// 激光干扰 diff --git a/ThreatSource/src/Jammer/MillimeterWaveCompensationJammer.cs b/ThreatSource/src/Jammer/MillimeterWaveCompensationJammer.cs new file mode 100644 index 0000000..f701ceb --- /dev/null +++ b/ThreatSource/src/Jammer/MillimeterWaveCompensationJammer.cs @@ -0,0 +1,84 @@ +using ThreatSource.Simulation; +using ThreatSource.Utils; +using System; // For DateTime + +namespace ThreatSource.Jammer +{ + /// + /// 毫米波补偿干扰器 + /// + /// + /// 通过发射补偿信号来降低目标在毫米波雷达上的特征, + /// 使其看起来像背景或不重要的物体。 + /// + public class MillimeterWaveCompensationJammer : BaseJammer + { + /// + /// 毫米波补偿干扰器配置 + /// + private readonly MillimeterWaveCompensationJammerConfig _config; + + /// + /// 支持的干扰类型 + /// + protected override JammingType JammingType => JammingType.MillimeterWaveCompensation; + + /// + /// 初始化毫米波补偿干扰器的新实例 + /// + /// 干扰器ID + /// 毫米波补偿干扰器配置 + /// 初始运动参数 + /// 仿真管理器实例 + public MillimeterWaveCompensationJammer( + string id, + MillimeterWaveCompensationJammerConfig config, + MotionParameters motionParameters, + ISimulationManager manager) + : base(id, motionParameters, manager) + { + _config = config; + } + + /// + /// 创建干扰参数 + /// + /// + /// CompensationTemperature 主要用于干扰器内部逻辑, + /// 或通过特定事件/机制传递,不直接包含在通用 JammingParameters 中。 + /// + protected override JammingParameters CreateJammingParameters() + { + return new JammingParameters + { + Type = JammingType.MillimeterWaveCompensation, + JammerId = Id, + Mode = _config.Mode, + CompensationTemperature = _config.CompensationTemperature, + Power = _config.Power, + AngleRange = _config.AngleRange, + Duration = _config.Duration, + Direction = Orientation.ToVector(), + SourcePosition = Position, + StartTime = DateTime.UtcNow + }; + } + + /// + /// 更新干扰效果 + /// + /// 时间步长,单位:秒 + protected override void UpdateJamming(double deltaTime) + { + base.UpdateJamming(deltaTime); + + // 更新位置 (如果干扰器是移动的) + Position += Velocity * deltaTime; + + if (CurrentParameters != null) + { + PublishJammingEvent(CurrentParameters); + } + } + } +} diff --git a/ThreatSource/src/MIssile/BaseMissile.cs b/ThreatSource/src/MIssile/BaseMissile.cs index 18505af..63ccd2c 100644 --- a/ThreatSource/src/MIssile/BaseMissile.cs +++ b/ThreatSource/src/MIssile/BaseMissile.cs @@ -468,21 +468,17 @@ namespace ThreatSource.Missile Explode(); } } - + /// - /// 更新导弹的制导状态 + /// 获取导弹状态信息 /// + /// 导弹状态信息 /// - /// 基类中的默认实现为空 - /// 具体的导弹类型需要重写此方法 - /// 实现各自的制导逻辑 + /// 返回信息包括: + /// - 基本状态信息 + /// - 导弹固有属性 + /// - 导弹运行时状态 /// - protected virtual void UpdateGuidanceStatus() - { - // 基类中的默认实现 - } - - /// public override ElementStatusInfo GetStatusInfo() { // 获取基础状态信息 diff --git a/ThreatSource/src/MIssile/TerminalSensitiveSubmunition.cs b/ThreatSource/src/MIssile/TerminalSensitiveSubmunition.cs index b7686c7..ddce5dd 100644 --- a/ThreatSource/src/MIssile/TerminalSensitiveSubmunition.cs +++ b/ThreatSource/src/MIssile/TerminalSensitiveSubmunition.cs @@ -192,46 +192,16 @@ namespace ThreatSource.Missile : base(missileId, properties, launchParams, manager) { TargetId = targetId; - config = submunitionConfig; + this.config = submunitionConfig; // 初始化扫描方向为正北 scanDirection = new Vector3D(0, 0, 1).Normalize(); // 初始化传感器 - var infraredDetectorConfig = new InfraredDetectorConfig - { - MaxDetectionRange = 1000, - Band = InfraredBand.Short, - FieldOfView = 1, - JammingResistanceThreshold = 1e-4 - }; - infraredDetector = new InfraredDetector(this.Id+"_IR", this, infraredDetectorConfig, manager); - var radiometerConfig = new MillimeterWaveRadiometerConfig - { - MaxDetectionRange = 1000, - Band = MillimeterWaveBand.Band3, - ScanFieldOfView = 1, - JammingResistanceThreshold = 1e-4 - }; - radiometer = new MillimeterWaveRadiometer(this.Id+"_MW", this, radiometerConfig, manager); - var altimeterConfig = new MillimeterWaveAltimeterConfig - { - MaxAltitude = 1000, - Band = MillimeterWaveBand.Band8, - MeasurementAccuracy = 0.5, - ScanFieldOfView = 25, - JammingResistanceThreshold = 1e-4 - }; - altimeter = new MillimeterWaveAltimeter(this.Id+"_MW_ALT", this, altimeterConfig, manager); - var rangefinderConfig = new LaserRangefinderConfig - { - MaxDetectionRange = 1000, - Wavelength = 1.06, - PulseRate = 100, - Accuracy = 0.5, - JammingResistanceThreshold = 1e-4 - }; - rangefinder = new LaserRangefinder(this.Id+"_LASER", this, rangefinderConfig, manager); + infraredDetector = new InfraredDetector(this.Id+"_IR", this, submunitionConfig.InfraredDetectorConfig, manager); + radiometer = new MillimeterWaveRadiometer(this.Id+"_MW", this, submunitionConfig.RadiometerConfig, manager); + altimeter = new MillimeterWaveAltimeter(this.Id+"_MW_ALT", this, submunitionConfig.AltimeterConfig, manager); + rangefinder = new LaserRangefinder(this.Id+"_LASER", this, submunitionConfig.RangefinderConfig, manager); } /// @@ -317,7 +287,7 @@ namespace ThreatSource.Missile /// 时间步长,单位:秒 /// /// 减速阶段处理: - /// - 启用制导控制 + /// - 激活毫米波测高雷达 /// - 计算减速加速度 /// - 更新速度和位置 /// - 检查高度条件 @@ -411,7 +381,7 @@ namespace ThreatSource.Missile /// 时间步长,单位:秒 /// /// 扫描阶段处理: - /// - 激活传感器系统 + /// - 激活激光测距仪 /// - 执行螺旋扫描 /// - 处理目标探测 /// - 检查目标确认条件 @@ -719,6 +689,27 @@ namespace ThreatSource.Missile return statusInfo; } + /// + /// 获取子弹状态 + /// + /// 子弹状态 + /// + /// 返回信息包括: + /// - 基本状态信息 + /// - 激光测距仪状态 + /// - 红外探测器状态 + /// - 毫米波辐射计状态 + /// - 测高仪状态 + /// + public override string GetStatus() + { + return base.GetStatus() + + $"\n激光测距仪状态: {rangefinder.GetStatus()}" + + $"\n红外探测器状态: {infraredDetector.GetStatus()}" + + $"\n毫米波辐射计状态: {radiometer.GetStatus()}" + + $"\n测高仪状态: {altimeter.GetStatus()}"; + } + /// /// 检查传感器是否受到干扰 /// diff --git a/ThreatSource/src/Sensor/BaseSensor.cs b/ThreatSource/src/Sensor/BaseSensor.cs index f801f33..cb94a01 100644 --- a/ThreatSource/src/Sensor/BaseSensor.cs +++ b/ThreatSource/src/Sensor/BaseSensor.cs @@ -291,5 +291,19 @@ namespace ThreatSource.Sensor } base.Deactivate(); } + + /// + /// 获取传感器状态 + /// + /// 传感器状态 + public override ElementStatusInfo GetStatusInfo() + { + // 获取基础状态信息 + var statusInfo = base.GetStatusInfo(); + + // 添加传感器状态 + statusInfo.ExtendedProperties["IsJammed"] = IsJammed.ToString(); + return statusInfo; + } } } diff --git a/ThreatSource/src/Sensor/MillimeterWaveRadiometer.cs b/ThreatSource/src/Sensor/MillimeterWaveRadiometer.cs index a3d7ff5..89a76ca 100644 --- a/ThreatSource/src/Sensor/MillimeterWaveRadiometer.cs +++ b/ThreatSource/src/Sensor/MillimeterWaveRadiometer.cs @@ -31,7 +31,7 @@ namespace ThreatSource.Sensor /// 毫米波辐射计支持的干扰类型: /// - 毫米波干扰 /// - public override IEnumerable SupportedJammingTypes => [JammingType.MillimeterWave]; + public override IEnumerable SupportedJammingTypes => [JammingType.MillimeterWave, JammingType.MillimeterWaveCompensation]; /// /// 定义设备支持的阻塞干扰类型 @@ -55,6 +55,14 @@ namespace ThreatSource.Sensor /// public double DetectionTemperatureDifferenceThreshold { get; set; } = 100; + /// + /// 地面温度,单位:开尔文 + /// + /// + /// 用于计算温度差值 + /// + public double BackgroundTemperature { get; set; } = 300; + /// /// 上次检测的辐射温度,单位:开尔文 /// @@ -64,6 +72,11 @@ namespace ThreatSource.Sensor /// private double lastDetectionTemperature; + /// + /// 是否处于补偿干扰状态 + /// + private bool isCompensationJammed = false; + /// /// 毫米波辐射计传感器数据实例 /// @@ -104,6 +117,7 @@ namespace ThreatSource.Sensor lastDetectionTemperature = 0; sensorData = new RadiometerSensorData(); this.submunition = submunition; + isCompensationJammed = false; // 初始化干扰处理 InitializeJamming(config.JammingResistanceThreshold, SupportedJammingTypes, SupportedBlockingJammingTypes); @@ -169,15 +183,17 @@ namespace ThreatSource.Sensor /// private double GetCurrentDirectionRadiationTemperature() { - // 获取当前方向上的辐射温度,如果检测到目标,则返回目标的辐射温度,否则返回地面温度 - var result = submunition.DetectTarget(config.ScanFieldOfView); - if (result.Angle != null && result.Target != null) + if (!isCompensationJammed) { - sensorData.TargetAngle = result.Angle; - return result.Target.Properties.MillimeterWaveRadiationTemperature; + var result = submunition.DetectTarget(config.ScanFieldOfView); + if (result.Angle != null && result.Target != null) + { + sensorData.TargetAngle = result.Angle; + return result.Target.Properties.MillimeterWaveRadiationTemperature; + } } sensorData.TargetAngle = null; - return 300; // 地面温度 + return BackgroundTemperature; } /// @@ -252,6 +268,11 @@ namespace ThreatSource.Sensor sensorData.IsValid = false; sensorData.IsTargetDetected = false; // 干扰时无法探测目标 } + else if (parameters.Type == JammingType.MillimeterWaveCompensation) + { + Debug.WriteLine($"[MillimeterWaveRadiometer] 毫米波辐射计受到补偿干扰,补偿温度:{parameters.CompensationTemperature}K", "Jamming"); + isCompensationJammed = true; + } } /// diff --git a/ThreatSource/src/Simulation/ElementStatusInfo.cs b/ThreatSource/src/Simulation/ElementStatusInfo.cs index d8fc5a4..18e6e9c 100644 --- a/ThreatSource/src/Simulation/ElementStatusInfo.cs +++ b/ThreatSource/src/Simulation/ElementStatusInfo.cs @@ -71,7 +71,7 @@ namespace ThreatSource.Simulation /// 状态的字符串表示 public override string ToString() { - string baseInfo = $"仿真元素状态:{ElementType} {Id} at {Position}, Orientation: {Orientation}, Active: {IsActive}"; + string baseInfo = $"仿真元素 {ElementType} {Id} at {Position}, Orientation: {Orientation}, Active: {IsActive}"; if (ExtendedProperties.Count > 0) { diff --git a/ThreatSource/src/Simulation/SimulationConfig.cs b/ThreatSource/src/Simulation/SimulationConfig.cs index 2fa3bbf..bde79c3 100644 --- a/ThreatSource/src/Simulation/SimulationConfig.cs +++ b/ThreatSource/src/Simulation/SimulationConfig.cs @@ -923,6 +923,28 @@ namespace ThreatSource.Simulation public double AttackSpeed { get; set; } = 2000.0; #endregion + #region 子弹药传感器配置 + /// + /// 红外探测器配置 + /// + public InfraredDetectorConfig InfraredDetectorConfig { get; set; } = new(); + + /// + /// 毫米波辐射计配置 + /// + public MillimeterWaveRadiometerConfig RadiometerConfig { get; set; } = new(); + + /// + /// 毫米波测高仪配置 + /// + public MillimeterWaveAltimeterConfig AltimeterConfig { get; set; } = new(); + + /// + /// 激光测距仪配置 + /// + public LaserRangefinderConfig RangefinderConfig { get; set; } = new(); + #endregion + /// /// 初始化末敏弹子弹药分离参数配置的新实例 /// @@ -1438,7 +1460,7 @@ namespace ThreatSource.Simulation /// /// 红外波段 /// - public InfraredBand Band { get; set; } = InfraredBand.Short; + public InfraredBand Band { get; set; } = InfraredBand.Medium; /// /// 干扰抗性阈值,单位:瓦特 @@ -1781,6 +1803,37 @@ namespace ThreatSource.Simulation /// public double Duration { get; set; } = 10; } + + /// + /// 毫米波补偿干扰配置类 + /// + public class MillimeterWaveCompensationJammerConfig + { + /// + /// 干扰模式 + /// + public JammingMode Mode { get; set; } = JammingMode.Deception; + + /// + /// 补偿温度,单位:开氏温度 + /// + public double CompensationTemperature { get; set; } = 298.15; + + /// + /// 干扰功率,单位:瓦特 + /// + public double Power { get; set; } = 1000; + + /// + /// 干扰角度范围,单位:度 + /// + public double AngleRange { get; set; } = 90; + + /// + /// 持续时间,单位:秒 + /// + public double Duration { get; set; } = 60; + } /// /// 激光诱偏目标配置类 diff --git a/docs/project/tunning.md b/docs/project/tunning.md index b7128c9..b94fd50 100644 --- a/docs/project/tunning.md +++ b/docs/project/tunning.md @@ -81,6 +81,27 @@ - 精度:1.62米 - 角度误差:+0.36度 +此时,末敏弹的配置为: +"submunitionConfig": { + "separationHeight": 1000.0, + "separationDistance": 1000.0, + "submunitionSeparationAngle": 45.0, + "separationRange": 50.0, + "decelerationAcceleration": 250.0, + "decelerationEndSpeed": 50.0, + "parachuteDeploymentHeight": 400.0, + "parachuteDeceleration": 90.0, + "stableScanHeight": 200.0, + "verticalDeclineSpeed": 10.0, + "spiralRotationSpeed": 25.13, + "scanAngle": 30.0, + "targetDetectionDistance": 150.0, + "selfDestructHeight": 20.0, + "attackSpeed": 200.0 + } +注意"parachuteDeceleration": 90.0和仿真步长决定了末敏弹进入扫描阶段时对目标的水平距离(要小于"targetDetectionDistance": 150.0的一半,要大于"selfDestructHeight": 20.0的大约一半)。 +实测 仿真步长为0.001秒时,末敏弹进入扫描阶段时对目标的水平距离约为64.0米;仿真步长为0.0025秒时,末敏弹进入扫描阶段时对目标的水平距离约为62.0米;仿真步长为0.005秒时,末敏弹进入扫描阶段时对目标的水平距离约57.0米。(当仿真步长为0.01秒时,末敏弹进入扫描阶段时对目标的水平距离约为50.0米,但已经发现不了目标) + ## 激光诱偏实验分析(v0.3.0) 时间:2025-01-15 10:00:00 diff --git a/tools/ComprehensiveMissileSimulator.cs b/tools/ComprehensiveMissileSimulator.cs index 96bebfc..df5419d 100644 --- a/tools/ComprehensiveMissileSimulator.cs +++ b/tools/ComprehensiveMissileSimulator.cs @@ -25,15 +25,15 @@ namespace ThreatSource.Tools.MissileSimulation // 定义仿真结束事件 public event EventHandler? SimulationEnded; - private readonly ISimulationManager simulationManager; + private readonly SimulationManager simulationManager; private readonly ThreatSourceFactory _threatSourceFactory; private readonly ThreatSourceDataManager _dataManager; private readonly Dictionary missiles; private readonly Dictionary targets; private readonly Dictionary indicators; private readonly Dictionary jammers; - private Dictionary missileActiveStatus; - private readonly double timeStep = 0.01; // 时间步长,单位:秒 + private readonly Dictionary missileActiveStatus; + private readonly double timeStep = 0.005; // 时间步长,单位:秒 // 导弹-干扰映射表 private Dictionary> missileJammingMap; @@ -69,11 +69,13 @@ namespace ThreatSource.Tools.MissileSimulation simulationManager = new SimulationManager(); _dataManager = new ThreatSourceDataManager("../ThreatSource/data"); _threatSourceFactory = new ThreatSourceFactory(_dataManager, simulationManager); - missiles = new Dictionary(); - targets = new Dictionary(); - indicators = new Dictionary(); - jammers = new Dictionary(); - missileActiveStatus = new Dictionary(); + missiles = []; + targets = []; + indicators = []; + jammers = []; + missileActiveStatus = []; + missileJammingMap = []; + SelectedMissileId = ""; // 初始化导弹-干扰映射 InitializeMissileJammingMap(); @@ -128,10 +130,10 @@ namespace ThreatSource.Tools.MissileSimulation // 末敏子弹药 missileJammingMap["TSM_1"] = new List<(JammingType, string, string, string, string)> { - (JammingType.Laser, "激光干扰", "LaserJammer_Missile", "阻塞", "子弹药"), - (JammingType.Infrared, "红外干扰", "InfraredJammer_Missile", "阻塞", "子弹药"), + (JammingType.Laser, "激光干扰", "LaserJammer_Submunition", "阻塞", "子弹药"), + (JammingType.Infrared, "红外干扰", "InfraredJammer_Submunition", "阻塞", "子弹药"), (JammingType.MillimeterWave, "毫米波干扰", "MillimeterWaveJammer_Submunition", "阻塞", "子弹药"), - (JammingType.MillimeterWave, "毫米波假信号", "MillimeterWaveJammer_Submunition", "欺骗", "子弹药"), + (JammingType.MillimeterWave, "毫米波假信号", "MillimeterWaveCompensationJammer_Submunition", "欺骗", "子弹药"), (JammingType.SmokeGrenade, "烟幕弹", "SG_3", "遮蔽", "子弹药") }; } @@ -156,7 +158,7 @@ namespace ThreatSource.Tools.MissileSimulation AddMillimeterWaveMissile(); // 添加各种传感器和指示器 - AddSensorsAndDesignators(); + AddDesignators(); // 添加烟幕弹 AddSmokeGrenade(); @@ -234,19 +236,19 @@ namespace ThreatSource.Tools.MissileSimulation }; string smokeGrenadeId = "SG_1"; var smokeGrenade = _threatSourceFactory.CreateJammer(smokeGrenadeId, "surround", motionParameters, "Tank_1"); - if (smokeGrenade != null) + if (smokeGrenade is BaseJammer jammer1) { - simulationManager.RegisterEntity(smokeGrenadeId, smokeGrenade); - jammers[smokeGrenadeId] = smokeGrenade as BaseJammer; + simulationManager.RegisterEntity(smokeGrenadeId, jammer1); + jammers[smokeGrenadeId] = jammer1; Console.WriteLine($"注册烟幕弹 {smokeGrenadeId}"); } smokeGrenadeId = "SG_2"; smokeGrenade = _threatSourceFactory.CreateJammer(smokeGrenadeId, "infrared", motionParameters, "Tank_1"); - if (smokeGrenade != null) + if (smokeGrenade is BaseJammer jammer2) { - simulationManager.RegisterEntity(smokeGrenadeId, smokeGrenade); - jammers[smokeGrenadeId] = smokeGrenade as BaseJammer; + simulationManager.RegisterEntity(smokeGrenadeId, jammer2); + jammers[smokeGrenadeId] = jammer2; Console.WriteLine($"注册烟幕弹 {smokeGrenadeId}"); } @@ -258,10 +260,10 @@ namespace ThreatSource.Tools.MissileSimulation }; smokeGrenadeId = "SG_3"; smokeGrenade = _threatSourceFactory.CreateJammer(smokeGrenadeId, "top", motionParametersTop, "Tank_1"); - if (smokeGrenade != null) + if (smokeGrenade is BaseJammer jammer3) { - simulationManager.RegisterEntity(smokeGrenadeId, smokeGrenade); - jammers[smokeGrenadeId] = smokeGrenade as BaseJammer; + simulationManager.RegisterEntity(smokeGrenadeId, jammer3); + jammers[smokeGrenadeId] = jammer3; Console.WriteLine($"注册烟幕弹 {smokeGrenadeId}"); } } @@ -380,7 +382,7 @@ namespace ThreatSource.Tools.MissileSimulation /// /// 添加传感器和指示器 /// - private void AddSensorsAndDesignators() + private void AddDesignators() { // 添加激光目标指示器 string laserDesignatorId = "LD_1"; @@ -436,10 +438,10 @@ namespace ThreatSource.Tools.MissileSimulation }; string laserJammerId = "LaserJammer_Designator"; var laserJammer = _threatSourceFactory.CreateJammer(laserJammerId, "laser_blocking", laserJammerParams, "Tank_1"); - if (laserJammer != null) + if (laserJammer is BaseJammer jammer4) { simulationManager.RegisterEntity(laserJammerId, laserJammer); - jammers[laserJammerId] = laserJammer as BaseJammer; + jammers[laserJammerId] = jammer4; Console.WriteLine($"注册激光干扰器(指向指示器) {laserJammerId}"); } @@ -452,10 +454,10 @@ namespace ThreatSource.Tools.MissileSimulation }; laserJammerId = "LaserJammer_Missile"; laserJammer = _threatSourceFactory.CreateJammer(laserJammerId, "laser_blocking", laserJammerParams, "Tank_1"); - if (laserJammer != null) + if (laserJammer is BaseJammer jammer5) { simulationManager.RegisterEntity(laserJammerId, laserJammer); - jammers[laserJammerId] = laserJammer as BaseJammer; + jammers[laserJammerId] = jammer5; Console.WriteLine($"注册激光干扰器(指向导弹) {laserJammerId}"); } @@ -468,10 +470,10 @@ namespace ThreatSource.Tools.MissileSimulation }; string irJammerId = "InfraredJammer_Designator"; var irJammer = _threatSourceFactory.CreateJammer(irJammerId, "infrared_blocking", irJammerParams, "Tank_1"); - if (irJammer != null) + if (irJammer is BaseJammer jammer6) { simulationManager.RegisterEntity(irJammerId, irJammer); - jammers[irJammerId] = irJammer as BaseJammer; + jammers[irJammerId] = jammer6; Console.WriteLine($"注册红外干扰器(指向指示器) {irJammerId}"); } @@ -484,10 +486,10 @@ namespace ThreatSource.Tools.MissileSimulation }; irJammerId = "InfraredJammer_Missile"; irJammer = _threatSourceFactory.CreateJammer(irJammerId, "infrared_blocking", irJammerParams, "Tank_1"); - if (irJammer != null) + if (irJammer is BaseJammer jammer7) { simulationManager.RegisterEntity(irJammerId, irJammer); - jammers[irJammerId] = irJammer as BaseJammer; + jammers[irJammerId] = jammer7; Console.WriteLine($"注册红外干扰器(指向导弹) {irJammerId}"); } @@ -500,27 +502,75 @@ namespace ThreatSource.Tools.MissileSimulation }; string mmwJammerId = "MillimeterWaveJammer_Missile"; var mmwJammer = _threatSourceFactory.CreateJammer(mmwJammerId, "mmw_blocking", mmwJammerParams, "Tank_1"); - if (mmwJammer != null) + if (mmwJammer is BaseJammer jammer8) { simulationManager.RegisterEntity(mmwJammerId, mmwJammer); - jammers[mmwJammerId] = mmwJammer as BaseJammer; + jammers[mmwJammerId] = jammer8; Console.WriteLine($"注册毫米波干扰器(指向导弹) {mmwJammerId}"); } + // 添加激光干扰器 - 指向子弹药 + laserJammerParams = new MotionParameters + { + Position = new Vector3D(0, 0, 0), + Orientation = new Orientation(0, Math.PI/2, 0), // 朝向垂直向上 + InitialSpeed = 0.0 + }; + laserJammerId = "LaserJammer_Submunition"; + laserJammer = _threatSourceFactory.CreateJammer(laserJammerId, "laser_top_blocking", laserJammerParams, "Tank_1"); + if (laserJammer is BaseJammer jammer9) + { + simulationManager.RegisterEntity(laserJammerId, laserJammer); + jammers[laserJammerId] = jammer9; + Console.WriteLine($"注册激光干扰器(垂直向上) {laserJammerId}"); + } + + // 添加红外干扰器 - 指向子弹药 + irJammerParams = new MotionParameters + { + Position = new Vector3D(0, 0, 0), + Orientation = new Orientation(0, Math.PI/2, 0), // 朝向垂直向上 + InitialSpeed = 0.0 + }; + irJammerId = "InfraredJammer_Submunition"; + irJammer = _threatSourceFactory.CreateJammer(irJammerId, "infrared_top_blocking", irJammerParams, "Tank_1"); + if (irJammer is BaseJammer jammer10) + { + simulationManager.RegisterEntity(irJammerId, irJammer); + jammers[irJammerId] = jammer10; + Console.WriteLine($"注册红外干扰器(垂直向上) {irJammerId}"); + } + // 添加毫米波干扰器 - 指向子弹药 mmwJammerParams = new MotionParameters { Position = new Vector3D(0, 0, 0), - Orientation = CalculateOrientationToEntity(missiles["TSM_1"]), // 朝向末敏子弹药 + Orientation = new Orientation(0, Math.PI/2, 0), // 朝向垂直向上 InitialSpeed = 0.0 }; mmwJammerId = "MillimeterWaveJammer_Submunition"; - mmwJammer = _threatSourceFactory.CreateJammer(mmwJammerId, "mmw_deception", mmwJammerParams, "Tank_1"); - if (mmwJammer != null) + mmwJammer = _threatSourceFactory.CreateJammer(mmwJammerId, "mmw_top_blocking", mmwJammerParams, "Tank_1"); + if (mmwJammer is BaseJammer jammer11) { simulationManager.RegisterEntity(mmwJammerId, mmwJammer); - jammers[mmwJammerId] = mmwJammer as BaseJammer; - Console.WriteLine($"注册毫米波干扰器(指向子弹药) {mmwJammerId}"); + jammers[mmwJammerId] = jammer11; + Console.WriteLine($"注册毫米波干扰器(垂直向上) {mmwJammerId}"); + } + + // 添加毫米波补偿干扰器 - 指向导弹 + mmwJammerParams = new MotionParameters + { + Position = new Vector3D(0, 0, 0), + Orientation = new Orientation(0, Math.PI/2, 0), // 朝向垂直向上 + InitialSpeed = 0.0 + }; + string mmwCompensationJammerId = "MillimeterWaveCompensationJammer_Submunition"; + var mmwCompensationJammer = _threatSourceFactory.CreateJammer(mmwCompensationJammerId, "mmw_compensation", mmwJammerParams, "Tank_1"); + if (mmwCompensationJammer is BaseJammer jammer12) + { + simulationManager.RegisterEntity(mmwCompensationJammerId, mmwCompensationJammer); + jammers[mmwCompensationJammerId] = jammer12; + Console.WriteLine($"注册毫米波补偿干扰器(垂直向上) {mmwCompensationJammerId}"); } } @@ -576,7 +626,7 @@ namespace ThreatSource.Tools.MissileSimulation } // 激活相关的传感器和指示器 - ActivateRelatedSensors(missileId); + ActivateRelatedIndicators(missileId); // 打印所有注册的组件 PrintSimulationRegisteredComponents(); @@ -585,7 +635,7 @@ namespace ThreatSource.Tools.MissileSimulation /// /// 激活与导弹相关的传感器、指示器、干扰器 /// - private void ActivateRelatedSensors(string missileId) + private void ActivateRelatedIndicators(string missileId) { // 根据导弹类型激活相应的传感器 switch (missileId) @@ -609,11 +659,6 @@ namespace ThreatSource.Tools.MissileSimulation indicators["IT_1"].Activate(); } break; - case "ITGM_1": // 红外成像末制导导弹 - case "TSM_1": // 末敏弹 - case "MMWG_1": // 毫米波末制导导弹 - // 这些导弹使用自身的传感器系统 - break; } } @@ -1002,7 +1047,9 @@ namespace ThreatSource.Tools.MissileSimulation // 导弹状态 Console.WriteLine("\n--- 导弹状态 ---"); - var activeMissiles = missiles.Values.Where(m => m.IsActive).ToList(); + var activeMissiles = simulationManager.GetEntitiesByType() + .Where(m => m.IsActive) + .ToList(); if (activeMissiles.Any()) { foreach (var missile in activeMissiles) @@ -1033,7 +1080,7 @@ namespace ThreatSource.Tools.MissileSimulation } // 传感器状态 - Console.WriteLine("\n--- 传感器和指示器状态 ---"); + Console.WriteLine("\n--- 指示器状态 ---"); var activeIndicators = indicators.Values.Where(i => i.IsActive).ToList(); if (activeIndicators.Any()) { @@ -1045,7 +1092,7 @@ namespace ThreatSource.Tools.MissileSimulation } else { - Console.WriteLine("没有激活的传感器或指示器"); + Console.WriteLine("没有激活的指示器"); } // 干扰器状态 @@ -1148,11 +1195,11 @@ namespace ThreatSource.Tools.MissileSimulation } // 重置所有传感器状态 - var activeSensors = simulationManager.GetEntitiesByType() + var activeIndicators = simulationManager.GetEntitiesByType() .Where(e => indicators.ContainsValue(e)); - foreach (var sensor in activeSensors) + foreach (var indicator in activeIndicators) { - sensor.Deactivate(); + indicator.Deactivate(); } // 重置所有目标状态