diff --git a/CHANGELOG.md b/CHANGELOG.md index 851ed08..05a3b3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project are documented here. The project follows - Your own IX can now live in either building of a two-site metro, or in both with a second switch, so a dark building no longer takes your exchange down (#36). The LAG buttons that did nothing on your own IX are gone. - Upgrading the only router in a POP that has nothing plugged in yet no longer opens a maintenance window or a NOC warning (#105). - Declining a loan offer clears the bank badge right away, even while the game is paused (#104). +- Parallel waves of different sizes now show each size on the map, like 800G + 400G, instead of a misleading 2 × 1.2T (#56). - Picking a subsea route from a city without a cable landing, like Oslo, now names the nearest landing station instead of saying its cables reach "nowhere" (#50). ## [1.29.0] — 2026-10-26 diff --git a/site/index.html b/site/index.html index 23aade0..f43302c 100644 --- a/site/index.html +++ b/site/index.html @@ -4022,7 +4022,8 @@ const lineIdx=(l,pl)=>{const ks=[];for(const x of pl||pairLinks(l.a,l.b)){const // pairLinks() for every pair at once (same links, same order), for code that asks about all of them. function pairIdx(){const m=new Map();for(const l of S.links){const k=edgeKey(l),a=m.get(k);if(a)a.push(l);else m.set(k,[l]);}return m;} function linkGroups(){const m=new Map();for(const l of S.links){const key=gKey(l);const g=m.get(key);if(g)g.push(l);else m.set(key,[l]);}return [...m.values()];} -function groupLabel(grp,up){const t=grp[0].tier,same=grp.every(x=>x.tier===t),tot=grp.reduce((a,x)=>a+LT[x.tier].g,0);return (same?`${grp.length}×${LT[t].n}`:`${grp.length} × ${fmtCap(tot)}`)+(up.length=0;t--)if(n[t])s+=(s?' + ':'')+(n[t]>1||n[t]===grp.length?n[t]+'×':'')+LT[t].n;return s+(up.lengthp.slice());const same=pairLinks(l.a,l.b).filter(x=>x.cable===l.cable).indexOf(l);if(same>0)for(let j=1;j assert.equal(ev("ixCap('beg')"), 0, 'both dark'); assert.deepEqual(errors, []); }); + +test('#56 parallel waves of different sizes are labelled per size, not as N times the total', () => { + const { ev, errors } = load(); + ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'nyc'});ACT.buildPop({city:'lon'})"); + ev("for(let i=0;i<3;i++){UI.via='grace';UI.route='same';openLinkModal('nyc','lon');ACT.buildLink({tier:1});closeModal();}compute()"); + const lbl = () => ev("(()=>{const g=linkGroups()[0];return groupLabel(g,g)})()"); + assert.equal(ev("linkGroups().length"), 1); + assert.equal(lbl(), '3×100G', 'equal sizes keep the short form'); + ev("S.links[2].tier=2;S.links[0].tier=3;S.links[1].tier=3"); + assert.equal(lbl(), '2×800G + 400G'); + ev("S.links[1].tier=2"); + assert.equal(lbl(), '800G + 2×400G'); + ev("S.links.pop()"); + assert.equal(lbl(), '800G + 400G', 'not "2 × 1.2T"'); + assert.match(ev("(()=>{const g=linkGroups()[0];return groupLabel(g,[g[0]])})()"), /^800G \+ 400G · 1\/2 /); + ev("cam.z=2;draw(0)"); + assert.deepEqual(errors, []); +});