a
This commit is contained in:
parent
faa00ac314
commit
c59ab98ebb
1 changed files with 21 additions and 5 deletions
|
@ -65,22 +65,38 @@
|
|||
$msum_old = $msum;
|
||||
$msum = 1;
|
||||
|
||||
$chh = 0;
|
||||
foreach ($result as $usera) {
|
||||
$una = $usera['username'];
|
||||
if (count($frs[$una]) == 0) continue;
|
||||
foreach ($result as $userb) {
|
||||
$unb = $userb['username'];
|
||||
$prb = $prold[$unb];
|
||||
if ($prb < pow(0.1,1 - ($i / 50))) {
|
||||
continue;
|
||||
}
|
||||
$chh += $ch;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($result as $usera) {
|
||||
$una = $usera['username'];
|
||||
$pr[$una] = 0.1;
|
||||
if (count($frs[$una]) == 0) continue;
|
||||
|
||||
foreach ($result as $userb) {
|
||||
$unb = $userb['username'];
|
||||
$matrixe[$una][$unb] = 0;
|
||||
$prb = $prold[$unb];
|
||||
if ($prb / 100 < pow(0.1,1 - ($i / 10))) {
|
||||
if ($prb < pow(0.1,1 - ($i / 50))) {
|
||||
continue;
|
||||
}
|
||||
$matrixe[$una][$unb] = 0;
|
||||
|
||||
foreach ($result as $userc) {
|
||||
$unc = $userc['username'];
|
||||
$matrixe[$una][$unb] += $matrixf[$una][$unc] * $matrixf[$unc][$unb] / $msum_old * pow($ch,3);
|
||||
$matrixe[$una][$unb] += $matrixf[$una][$unc] * $matrixf[$unc][$unb] / $msum_old * $chh;
|
||||
}
|
||||
|
||||
$msum += $matrixe[$una][$unb];
|
||||
$pr[$una] += $prb * $matrixe[$una][$unb];
|
||||
}
|
||||
|
@ -89,7 +105,7 @@
|
|||
$new_sum = array_sum($pr);
|
||||
foreach ($result as $usern) {
|
||||
$h = $pr[$usern['username']];
|
||||
$pr[$usern['username']] /= $new_sum / 100;
|
||||
$pr[$usern['username']] /= $new_sum;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue