Replace per-switch network simulation with aggregate per-DC statistical model
Eliminates the 22K-object switchRegistry that caused O(n×m) scans 4x per tick. Network health is now tracked as aggregate counts per tier (totalByTier/healthyByTier) with RepairBatch timers, cutting late-game tick cost from ~50ms to ~0.3ms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,10 +8,10 @@ import type { DeepPartial } from './createTestState';
|
||||
|
||||
function emptyDCNetwork(): DCNetworkSummary {
|
||||
return {
|
||||
switchIds: [],
|
||||
networkRackCount: 0,
|
||||
totalByTier: {},
|
||||
healthyByTier: {},
|
||||
repairBatches: [],
|
||||
networkRackCount: 0,
|
||||
racksDisconnected: 0,
|
||||
racksDegraded: 0,
|
||||
averageBandwidth: 1,
|
||||
@@ -20,11 +20,11 @@ function emptyDCNetwork(): DCNetworkSummary {
|
||||
}
|
||||
|
||||
function emptyCampusNetwork(): CampusNetworkSummary {
|
||||
return { switchIds: [], totalT4: 0, healthyT4: 0, crossDCBandwidth: 1 };
|
||||
return { totalT4: 0, healthyT4: 0, crossDCBandwidth: 1 };
|
||||
}
|
||||
|
||||
function emptyClusterNetwork(): ClusterNetworkSummary {
|
||||
return { switchIds: [], totalT5: 0, healthyT5: 0, crossCampusBandwidth: 1 };
|
||||
return { totalT5: 0, healthyT5: 0, crossCampusBandwidth: 1 };
|
||||
}
|
||||
|
||||
export function createTestDataCenter(overrides?: DeepPartial<DataCenter>): DataCenter {
|
||||
|
||||
Reference in New Issue
Block a user