Skip saturated paths during candidate exit scan to prevent routing freezes (#210)

This commit is contained in:
Wesley Marques 2026-10-30 16:38:30 -03:00 • committed by Frederic Jung
parent 59757c2256
commit 8c2dd05d0b
No known key found for this signature in database
3 changed files with 18 additions and 5 deletions

View file

@ -1381,3 +1381,15 @@ test('#219 choosing one site again while the augment is on order keeps the LAG i
assert.equal(ev('S.pni[0].site'), 'b');
assert.deepEqual(errors, []);
});
test('#210 candidate exits on saturated shortest paths are skipped to avoid fallback churn', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e8;UI.speed=0;for(const g of GOALS)S.done[g.id]=0;");
ev("ACT.buyTransit({city:'fra',net:'cog',tier:1});");
ev("ACT.buildPop({city:'par'});ACT.launchBB({city:'par'});");
ev("S.links.push({id:'x1',a:'fra',b:'par',kind:'wave',tier:0,km:450,mult:1,mo:1000,ready:0,cut:0});");
ev("compute();");
assert.ok(ev("R.load['x1'] >= 10 - 1e-6"), 'intercity wave is saturated');
ev("compute();");
assert.deepEqual(errors, []);
});