Files
admin 0593ff7e62
nginx serve /uploads direct (audio speed) / patch-nginx (push) Failing after 1m34s
数字我 Digital Me:全量入库(大文件走 Git LFS)
2026-10-10 16:24:43 +08:00

41 lines
3.0 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ★★★ 【nearest 是哪一级判的】—— ★ 读数【出自引擎自己的 nearestBy】,不是复算。
// ⚠ 本项目铁律:「读数出自引擎自己的 kai(不是复算)」。第三刀先前那张表是【复算】的
// (scripts/census-gap.mjs ④,它自己按 blocked 重建 pool)—— 而复算会【漏】:
// 它在 pool<2 时跳过,于是把「本表真的有理由」那一级少报了。⇒ 这一份取代它。
import { DYNASTIES, computeRank, computeAxes, AXIS_IDS } from '../src/dynasties.js';
import { chushenOf } from '../src/chushen.js';
import { SUB_REGISTRY } from '../src/talents.js';
const SUBS = SUB_REGISTRY.map((s) => s.id);
const WANGS = [0, 29, 30, 54, 55, 74, 75, 100];
const m = new Map();
for (let b = 0; b < (1 << 16); b++) { const s = []; for (let i = 0; i < 16; i++) if (b & (1 << i)) s.push(SUBS[i]);
const a = computeAxes(s); const k = AXIS_IDS.map((x) => a[x]).join(','); m.set(k, (m.get(k) || 0) + 1); }
const T = [...m].map(([k, w]) => ({ axes: Object.fromEntries(k.split(',').map((v, i) => [AXIS_IDS[i], Number(v)])), w }));
const CFG = {}; for (const d of DYNASTIES) { const x = chushenOf(d.id); CFG[d.id] = x ? [null, ...x.values.map((v) => v.id)] : [null]; }
const N = (n) => n.toLocaleString();
const pad = (s, n) => { s = String(s); let w = 0; for (const c of s) w += c.charCodeAt(0) > 0x2000 ? 2 : 1; return s + ' '.repeat(Math.max(1, n - w)); };
console.log('\n══ 【无路者】nearest 是哪一级判的 —— 读数出自引擎自己的 nearestBy ══');
console.log('══ 每朝每配置 524,288 个 profile(2,790 六轴取值 × 8 wang,带权)══\n');
console.log(pad('朝', 8) + pad('出身', 10) + '无路者'.padStart(11) + '差几条(有理由)'.padStart(16) + 'gapOf(⚠不是距离)'.padStart(18) + '编号'.padStart(9) + ' 没有 nearest');
console.log('─'.repeat(80));
const G = { count: 0, gap: 0, idx: 0 };
for (const d of DYNASTIES) for (const cs of CFG[d.id]) {
const S = { noRoad: 0, count: 0, gap: 0, idx: 0, none: 0 };
for (const t of T) for (const wang of WANGS) {
const r = computeRank({ axes: t.axes, wang, chushen: cs }, d.id);
if (r.channel) continue;
S.noRoad += t.w;
if (!r.nearest) { S.none += t.w; continue; }
S[r.nearestBy] += t.w;
}
if (!S.noRoad) continue;
for (const k of ['count', 'gap', 'idx']) G[k] += S[k];
console.log(pad(d.name, 8) + pad(cs || '未答', 10) + N(S.noRoad).padStart(11) + N(S.count).padStart(16) +
N(S.gap).padStart(18) + N(S.idx).padStart(9) + ' ' + (S.none ? N(S.none) : ''));
}
console.log('─'.repeat(80));
console.log(pad('总计', 18) + ''.padStart(11) + N(G.count).padStart(16) + N(G.gap).padStart(18) + N(G.idx).padStart(9));
const tot = G.count + G.gap + G.idx;
console.log(`\n★ 「本表真的有理由」的那一级(差几条):${N(G.count)} / ${N(tot)} = ${(G.count / tot * 100).toFixed(1)}%`);
console.log(`★★ 而其余 ${(100 - G.count / tot * 100).toFixed(1)}% 由【一个代号减出来的数】或【数组编号】决定。`);