diff options
author | emkael <emkael@tlen.pl> | 2014-11-18 13:39:12 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2014-11-18 13:39:12 +0100 |
commit | 24f2391f59e4b877d26b0df7f08238e5d655a22d (patch) | |
tree | 1a798b2475c27072235cc54afed7015a05e27c3b | |
parent | 4d509a4d84a56a4b598fafa161da891dde3b973f (diff) |
* more verbose information dumped on race rating
-rw-r--r-- | f1elo/interface.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/f1elo/interface.py b/f1elo/interface.py index 79311ba..f51bc9e 100644 --- a/f1elo/interface.py +++ b/f1elo/interface.py @@ -82,13 +82,28 @@ class Interface: driver.rankings.append(ranking) if _debug: + podium_rating = 0 + podium_rating_after = 0 + rating_sum = 0 + rating_change_sum = 0 for entry in race.entries: + old_rating = elo.get_entry_ranking(entry, + race.date - dateutil.relativedelta.relativedelta(days=1)) + new_rating = elo.get_entry_ranking(entry) + rating_sum += old_rating + rating_change_sum += abs(new_rating - old_rating) print( entry, - elo.get_entry_ranking(entry, - race.date - dateutil.relativedelta.relativedelta(days=1)), - elo.get_entry_ranking(entry), + old_rating, + new_rating, file=sys.stderr) + if entry.result in ['1','2','3']: + podium_rating += old_rating + podium_rating_after += new_rating + print('', file=sys.stderr) + print('Podium rating: ', podium_rating, podium_rating_after, file=sys.stderr) + print('Average rating: ', rating_sum / len(race.entries), file=sys.stderr) + print('Average rating change: ', rating_change_sum / len(race.entries), file=sys.stderr) print('', file=sys.stderr) race.ranked = True |