The intern and customers' promises counted once per network: ports, caches and PNIs in one pass, shared searches
The game plays exactly as before. * The NOC intern plans every POP in one pass: portsAt() counts router ports for all cities at once (routers, ports and cache orders; the ports job keeps ports in use and reserved by city between two jobs), cachePlan() sorts the boxes by POP once and cityShSum() sums a city's shares once per table, pniFlows() reads every POP's flows from routing's columns (R.flc) in one pass and pniWant() gives the weekly PNI round its sort key from typed columns. pniBatchRun() lets a frame through every few networks; pniQuote() looks existing PNIs and ports up from the batch. * A dark fiber's capacity asks optG() once per run of identical optics (dfLit()); linkDown() and ownGlass() ask dfOn(), whether it carries anything for you, without the sum unless an optic is out or managed waves are sold on it. terrIslands() tests !l.sub first. * Latency: latGraph() lists each city's links once in S.links order (typed arrays), latRun() is the same search with the same sums, latPairs() searches once per city for a boutique's finance routes and the latency offers. * Diverse paths: divGraph()/divOn() number the cities and risks once; promiseCheck() shares a diversity graph, the land islands and one latency search per origin across every customer when the intern weighs taking a fiber out, and spots0() shares the graph for sovereign offers. Tests: day-steps (cache planner, ports at every POP and flows from columns equal the old ways; the PNI round through pniBatchRun), fiber-lit-and-latency (with failed optics and managed waves), shared-promise-checks, intern-personas.
This commit is contained in:
parent
d03dde6fcd
commit
44116103be
16 changed files with 373 additions and 66 deletions
|
|
@ -37,7 +37,7 @@ test('Annie peers every day and orders PNIs twice a week; the others weekly', t
|
|||
ev("S.ops.on.ix=true;S.day=15;opsDay(S.day)");
|
||||
assert.equal(ev('Object.keys(S.rs).length>0'), want, `${id} on a Tuesday`);
|
||||
// How often the PNI order looks for networks to order from, over one week.
|
||||
ev("S.ops.on.ix=false;S.ops.on.pni=true;window.__pb=0;pniBatch=function(){__pb++;return null;};for(let d=21;d<28;d++){S.day=d;opsDay(d);}");
|
||||
ev("S.ops.on.ix=false;S.ops.on.pni=true;window.__pb=0;pniBatch=function(){__pb++;return null;};if(typeof pniBatchRun==='function')pniBatchRun=function*(){__pb++;return null;};for(let d=21;d<28;d++){S.day=d;opsDay(d);}");
|
||||
assert.equal(ev('__pb'), want ? 2 : 1, `${id}: PNI rounds a week`);
|
||||
assert.deepEqual(errors, []);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue