Keep puzzles and scenarios on plain shares; per-city share sums; tests follow the new traffic split

Puzzles, Architect runs and scenarios keep the table's split (their references and
pars were made with it). Week 2026-W44's reference now wins on day 185 (offers draw
from the wider campus list). The cache planner sums each city's own split.
This commit is contained in:
Frederic Jung 2026-11-10 08:37:31 +00:00
parent 69cdb3e372
commit a98e34711b
No known key found for this signature in database
6 changed files with 18 additions and 10 deletions

View file

@ -103,7 +103,7 @@ function compute(){RW.gen++;
// traffic you failed to deliver, and it does not cross your links only to be thrown away.
const ru=ruCity(c),thr=n=>n==='ggl'&&ru?0.5:1;let sa=shArr.get(SH),sm=shSum.get(SH);if(!sa){shArr.set(SH,sa=NETS.map(n=>SH[n.id]||0));shSum.set(SH,sm=[]);}
// This city's own split: its traffic to networks that sell to homes goes mostly to the ones whose users are near (#48).
const ls=locSh(SH,c);
const ls=cityShares(SH,c);
const tt=sm[+ru]||(sm[+ru]=[NETS.reduce((t,n,j)=>t+sa[j]*thr(n.id),0),NETS.reduce((t,n,j)=>t+sa[j],0)]),lf=loc?NETS.reduce((t,n,j)=>t+(R2.reachable[n.id]?ls[j]*thr(n.id):0),0)/(tt[0]||1):1,d=d0*tt[0]/(tt[1]||1)*lf;
R2.cityEye[c]=eye;R2.cityDem[c]=d;R2.citySrv[c]=0;R2.demand+=d;
for(let j=0;j<NN;j++)DEMTO[j]=(DEMTO[j]||0)+d0*ls[j]*thr(NETS[j].id);