fix some things
This commit is contained in:
parent
242e119222
commit
1c4ea64463
2 changed files with 11 additions and 7 deletions
15
rank.js
15
rank.js
|
@ -5,7 +5,6 @@ function rankCalc(result, iterations = 10, main = []) {
|
|||
let fng = {};
|
||||
let fnc = {};
|
||||
let frs = {};
|
||||
let frsEasy = {};
|
||||
let msum_old = 0.001;
|
||||
let pr = {};
|
||||
|
||||
|
@ -51,9 +50,6 @@ function rankCalc(result, iterations = 10, main = []) {
|
|||
for (let una in result) {
|
||||
th++;
|
||||
pr[una] = 0.1 / rl;
|
||||
if (main.indexOf(una) != -1) {
|
||||
pr[una] = 0.5;
|
||||
}
|
||||
matrixe[una] = [];
|
||||
if (frs[una].length == 0) {
|
||||
pr[una] = prold[una];
|
||||
|
@ -98,10 +94,17 @@ function rankCalc(result, iterations = 10, main = []) {
|
|||
}
|
||||
}
|
||||
|
||||
let new_sum = Object.values(pr).filter(x => !isNaN(x)).reduce((a, b) => a + b, 0)
|
||||
let ov = Object.keys(pr);
|
||||
|
||||
let new_sum = ov.filter(i => !isNaN(pr[i]) && main.indexOf(i) != -1).map(n => pr[n]).reduce((a, b) => a + b, 1);
|
||||
let new_sum2 = ov.filter(i => !isNaN(pr[i]) && main.indexOf(i) == -1).map(n => pr[n]).reduce((a, b) => a + b, 1);
|
||||
|
||||
for (let unn in result) {
|
||||
pr[unn] /= new_sum;
|
||||
if (main.indexOf(unn) == -1) {
|
||||
pr[unn] /= new_sum2 * 2;
|
||||
} else {
|
||||
pr[unn] /= new_sum * 2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue