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

@ -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, []);
});