perf: Commit批量50帧 + Calc回到+1(11发最优)

- _frameDb.Commit() 从每帧改为每50帧批量提交
- CalcRoundsNeeded 回退到 +1(12发反更差)
- Piston: 10机50m间距8/10击毁
This commit is contained in:
tian 2026-06-13 15:17:25 +08:00
parent 070167f572
commit 197f8b6e5c
2 changed files with 5 additions and 5 deletions

View File

@ -281,7 +281,7 @@ namespace CounterDrone.Core.Simulation
var snapshots = CollectSnapshots();
_frameStore.WriteFrame(_frameDb, _taskId, FrameIndex, SimulationTime, snapshots);
_frameDb.Commit();
if (FrameIndex % 50 == 0) _frameDb.Commit();
return new SimulationFrameResult { EntitySnapshots = snapshots, NewEvents = frameEvents, State = State, FrameIndex = FrameIndex, SimulationTime = SimulationTime };
}

View File

@ -202,14 +202,14 @@ namespace CounterDrone.Core.Tests
{
GroupId = "default", TargetType = (int)TargetType.Piston,
PowerType = (int)PowerType.Piston,
Quantity = 3, // 单批次 3
Quantity = 10, // 10
TypicalSpeed = 200, TypicalAltitude = 500,
});
_scenario.SaveRoute(_taskId, "default", new RoutePlan
{
FormationMode = (int)FormationMode.Formation,
LateralSpacing = 200,
LateralCount = 3,
LateralSpacing = 50,
LateralCount = 10,
LongitudinalCount = 1,
},
new List<Waypoint>
@ -219,7 +219,7 @@ namespace CounterDrone.Core.Tests
});
_scenario.SaveDeployment(_taskId, new List<EquipmentDeployment>
{
MakeEquipment(DefaultFireUnits.GetById("ground-light"), AerosolType.InertGas, 8, 5000, 0, 50),
MakeEquipment(DefaultFireUnits.GetById("ground-light"), AerosolType.InertGas, 10, 5000, 0, 50),
});
_scenario.SaveCloudDispersal(_taskId, new CloudDispersal { AerosolType = (int)AerosolType.InertGas, DisperseHeight = 500 });