Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of IMP and VP #31

Open
ThorvaldAagaard opened this issue Aug 11, 2023 · 0 comments
Open

Calculation of IMP and VP #31

ThorvaldAagaard opened this issue Aug 11, 2023 · 0 comments

Comments

@ThorvaldAagaard
Copy link
Contributor

As far as I can see there is no implementation of functions to calculate IMPS and VP.

Looking at your types it might be a good idea to add types for Match and Team (and probably also tournament)

I have this script for calculating IMPS (Lorand Dali implementation), but not yet found a python-implementation for VP

import math
import bisect


IMP = [10, 40, 80, 120, 160, 210, 260, 310, 360, 420, 490, 590, 740, 890, 1090, 1290, 1490, 
            1740, 1990, 2240, 2490, 3490, 3990]


def get_imps(score1, score2):
    score_diff = score1 - score2
    imp = bisect.bisect_left(IMP, int(math.fabs(score_diff)))
    if score_diff >= 0:
        return imp
    else:
        return -imp

VP is well-defined here: http://www.worldbridge.org/resources/official-documents/wbf-victory-point-scales/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant