diagnostic: path_debug.txt 验证路径积分正确(251m=7朵云处击毁)
This commit is contained in:
parent
48368e0fe8
commit
61ae257f54
@ -48,6 +48,7 @@ namespace CounterDrone.Core.Simulation
|
||||
private int _nextFireIndex;
|
||||
private readonly List<SimEvent> _allEvents = new();
|
||||
private System.Text.StringBuilder _hitLog = new();
|
||||
private float _totalPathInCloud;
|
||||
private SQLiteConnection _frameDb = null!;
|
||||
private string _taskId = string.Empty;
|
||||
private readonly IDefensePlanner _planner;
|
||||
@ -272,6 +273,8 @@ namespace CounterDrone.Core.Simulation
|
||||
cloud.Dispersion.EffectiveRadius);
|
||||
if (inCloudTime > 0 && cloud.Dispersion.CoreDensity >= (float)_ammoSpec.EffectiveConcentration)
|
||||
{
|
||||
_totalPathInCloud += inCloudTime;
|
||||
System.IO.File.AppendAllText(@"C:\Users\Tellme\Desktop\path_debug.txt", $"t={SimulationTime:F1} drone={drone.PosX:F1} cloud={cloud.Dispersion.Center.X:F1} path={inCloudTime:F1} total={_totalPathInCloud:F1}\n");
|
||||
float exposureIncrement = inCloudTime / (drone.TypicalSpeed / 3.6f);
|
||||
drone.ExposureTime += exposureIncrement;
|
||||
var dmg = _damageModel.CalculateDamage(drone.TargetType, drone.PowerType, cloud.AerosolType, cloud.Dispersion.CoreDensity, drone.ExposureTime, exposureIncrement);
|
||||
@ -306,6 +309,7 @@ namespace CounterDrone.Core.Simulation
|
||||
if (_drones.All(d => d.Status != DroneStatus.Flying))
|
||||
{
|
||||
State = SimulationState.Completed;
|
||||
System.IO.File.WriteAllText(@"C:\Users\Tellme\Desktop\path_in_cloud.txt", $"totalPath={_totalPathInCloud:F1}m");
|
||||
OnSimulationEnded?.Invoke();
|
||||
frameEvents.Add(new SimEvent { Type = SimEventType.SimulationEnd, OccurredAt = SimulationTime });
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user