perf: Commit批量50帧 + Calc回到+1(11发最优)
- _frameDb.Commit() 从每帧改为每50帧批量提交 - CalcRoundsNeeded 回退到 +1(12发反更差) - Piston: 10机50m间距8/10击毁
This commit is contained in:
parent
070167f572
commit
197f8b6e5c
@ -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 };
|
||||
}
|
||||
|
||||
@ -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 });
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user