Let the 3.2T transponder fall back to 1.2T like the 1.6T one (#107)

Its fallback ladder skipped 1.2T, so between 4,000 and 5,500 km on land
(6,000-8,250 km subsea) it carried 800G while the cheaper 1.6T optic
carried 1.2T. A test now checks that a bigger optic on the same line
system never carries less than a smaller one at any distance.
This commit is contained in:
Frederic Jung 2026-10-26 10:28:28 +01:00
parent 92b24fd2ad
commit c88bad3eef
No known key found for this signature in database
3 changed files with 16 additions and 2 deletions

View file

@ -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).
- The 3.2T transponder now falls back to 1.2T between 4,000 and 5,500 km (6,000 to 8,250 km subsea), like the 1.6T one, instead of dropping to 800G (#107). A bigger optic now carries at least as much as a smaller one at every distance.
- 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

View file

@ -697,7 +697,7 @@ const OPT={
zr4:{n:'Ackackia 400ZR+',g:400,cost:12000,reach:1500,modes:[[400,1500],[200,3000]],rg:1,lvl:2,sys:'lite',blurb:tr('Coherent pluggable in the router. No transponder shelf.')},
zr8:{n:'Sizzle 800ZR+',g:800,cost:22000,reach:900,modes:[[800,900],[400,1800],[200,3600]],rg:2,lvl:3,sys:'lite',blurb:tr('Twice the speed, shorter reach.')},
tp16:{n:'Sienna WaveMagic 1.6T',g:1600,cost:70000,reach:4000,modes:[[1600,4000],[1200,5500],[800,7000],[400,12000]],rg:2,lvl:4,sys:'roadm',blurb:tr('Big shelf, big reach, big invoice.')},
tp32:{n:'Sienna WaveMagic 3.2T',g:3200,cost:130000,reach:1500,modes:[[3200,1500],[1600,4000],[800,7000],[400,12000]],rg:4,lvl:8,sys:'roadm',blurb:tr('Twice the WaveMagic. Full speed only on shorter spans, and a cooling fan you can hear from the car park.')},
tp32:{n:'Sienna WaveMagic 3.2T',g:3200,cost:130000,reach:1500,modes:[[3200,1500],[1600,4000],[1200,5500],[800,7000],[400,12000]],rg:4,lvl:8,sys:'roadm',blurb:tr('Twice the WaveMagic. Full speed only on shorter spans, and a cooling fan you can hear from the car park.')},
};
const dfLeaseMo=km=>Math.round(400+km*1.0);
const dfBuildCost=km=>Math.round(25000+km*120);
@ -721,7 +721,7 @@ const MET={prefer:{l:tr('Prefer'),f:0.5},normal:{l:tr('Normal'),f:1},avoid:{l:tr
const PREF={high:tr('Prefer'),normal:tr('Normal'),low:tr('Backup only')};
const edgeKey=l=>l.a<l.b?l.a+'|'+l.b:l.b+'|'+l.a;
/* Reach (#17, #30). Coherent optics trade speed for distance: past full-rate reach they drop to a
slower, more robust modulation. Regeneration sites go further: each one turns the light back into
slower, more robust modulation, and a bigger optic can always fall back to anything a smaller one does (#107). Regeneration sites go further: each one turns the light back into
bits and sends it on fresh, so every optical span is shorter. Each site needs a regen card per channel. */
const REGEN_COST=30000,REGEN_MO=900,REGEN_CH=0.5,REGEN_MAX=8;
const spanKm=l=>Math.ceil(l.km/((l.regen|0)+1));

View file

@ -1126,3 +1126,16 @@ test('#56 parallel waves of different sizes are labelled per size, not as N time
ev("cam.z=2;draw(0)");
assert.deepEqual(errors, []);
});
test('#107 a bigger optic never carries less than a smaller one at the same distance', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
// every optic on the same line system, at every distance, on land and subsea
const bad = ev(`(()=>{const out=[],ks=Object.keys(OPT);for(const sub of [false,true])for(let km=100;km<=19000;km+=50){const l={km,sub,regen:0};
for(const a of ks)for(const b of ks){const A=OPT[a],B=OPT[b];if(A.sys!==B.sys||A.g<=B.g)continue;const ga=optMode(a,l),gb=optMode(b,l);
if(gb&&(!ga||ga.g<gb.g))out.push(a+'<'+b+'@'+km+(sub?'s':''));}}return out.slice(0,5).join()})()`);
assert.equal(bad, '', 'bigger optic falls back to whatever the smaller one manages');
assert.equal(ev("optMode('tp32',{km:4500,sub:false,regen:0}).g"), 1200);
assert.equal(ev("optMode('tp32',{km:7000,sub:true,regen:0}).g"), 1200);
assert.deepEqual(errors, []);
});