From d514058b1d5ac234aa91b05ae232ffc78a1f1dc2 Mon Sep 17 00:00:00 2001 From: biglyderv Date: Thu, 30 Jan 2025 11:00:54 -0500 Subject: [PATCH] stuff --- rank.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rank.js b/rank.js index fbb2982..03b4131 100644 --- a/rank.js +++ b/rank.js @@ -46,13 +46,17 @@ function rankCalc(result, iterations = 10) { console.log(`Completed ${i} iterations with ${intv} threshold and ${discarded * 100}% discard rate`) discarded = 0; + let th = -1; + for (let una in result) { + th++; + let thk = Object.keys(result).length; pr[una] = 0; matrixe[una] = []; - if (frs[una].length == 0) { + if (frs[una].length == 0 || (msum_old - msum) / (thk - th) < Math.pow(intv,2)) { pr[una] = prold[una]; matrixe[una] = matrixf[una]; - discarded += 1 / Object.keys(result).length + discarded += 1 / thk continue; } @@ -62,7 +66,7 @@ function rankCalc(result, iterations = 10) { if (prb < intv || fnc[unb] == 0) { pr[una] = prold[una]; - discarded += Math.pow(Object.keys(result).length,-2) / 2; + discarded += Math.pow(thk,-2) * 0.9; continue; }