]> git.sesse.net Git - foosball/blobdiff - recalc-single-result.pl
Add a SWIG interface, to be able to run recalc-single-result faster.
[foosball] / recalc-single-result.pl
index efcd4c73891ef5a8af3aec31a168596261180bf0..b6f8b779db39b233eff5e6054326a1c964978778 100755 (executable)
@@ -5,6 +5,7 @@ use DBI;
 use CGI;
 use CGI::Carp qw(fatalsToBrowser);
 require 'foosball.pm';
+use foosrank;
 no warnings 'once';
 
 my $dryrun = 0;
@@ -47,8 +48,8 @@ while (my $ref = $q->fetchrow_hashref) {
        $rd1 = foosball::apply_aging($rd1, $age1 / 86400.0);
        $rd2 = foosball::apply_aging($rd2, $age2 / 86400.0);
 
-       my ($newr1, $newrd1, $likelihood) = foosball::calc_rating($rating1, $rd1, $rating2, $rd2, $score1, $score2);
-       my ($newr2, $newrd2) = foosball::calc_rating($rating2, $rd2, $rating1, $rd1, $score2, $score1);
+       my ($newr1, $newrd1, $likelihood) = foosrank::compute_new_rating($rating1, $rd1, $rating2, $rd2, $score1, $score2);
+       my ($newr2, $newrd2) = foosrank::compute_new_rating($rating2, $rd2, $rating1, $rd1, $score2, $score1);
 
        $cll += log($likelihood);