Merge branch 'main' into own-carrier-egress
This commit is contained in:
commit
296de1d946
232 changed files with 18447 additions and 2047 deletions
|
|
@ -1,5 +1,7 @@
|
|||
// Deliberately scan all exits for every flow, without byRank, local-city
|
||||
// shortcuts or first-group selection. Stable sorting preserves E order on ties.
|
||||
// Without Auto-TE, an exit whose shortest path from this POP is already full fits nothing, so it counts as
|
||||
// unusable, like a full exit (#210).
|
||||
module.exports = `
|
||||
for(const pass of PASSES||[null])for(const rank of RANKS){
|
||||
for(f of flows){
|
||||
|
|
@ -7,8 +9,7 @@ module.exports = `
|
|||
Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++;
|
||||
// A carrier's own port (dr) is also a plain transit exit; one not set to carry only takes its own POP's traffic.
|
||||
const candidates=E.filter(e=>e.used<e.cap&&e.ok(f.n)&&
|
||||
((TR?eff(e,f.n):base(e))===rank||(dr(e,f.n)||-1)===rank)&&
|
||||
(rank!==DIRECT_RANK[1][1]&&rank!==DIRECT_RANK[2][1]||CIDX[e.city]===f.ci)&&Dv[CIDX[e.city]]<Infinity)
|
||||
(TR?eff(e,f.n):base(e,f.n))===rank&&Dv[CIDX[e.city]]<Infinity&&!gone(e))
|
||||
.sort((a,b)=>(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||Dv[CIDX[a.city]]-Dv[CIDX[b.city]]);
|
||||
for(let i=0;i<candidates.length&&f.rem>1e-6;){
|
||||
let j=i+1;while(j<candidates.length&&(candidates[j].pref==='high')===(candidates[i].pref==='high')&&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue