diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-06-01 20:54:52 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-06-01 20:54:52 +0200 |
| commit | 92f1a61cdca682e1b3cd126febe9182b795f8453 (patch) | |
| tree | 66c872f38ea2a364f815d7f582cdb560754a02fc /worker.py | |
| parent | be84a193e0c3bd7f47e58706af6550c24669001f (diff) | |
| download | analyzer-92f1a61cdca682e1b3cd126febe9182b795f8453.tar.gz analyzer-92f1a61cdca682e1b3cd126febe9182b795f8453.zip | |
make TS match VST
Diffstat (limited to 'worker.py')
| -rw-r--r-- | worker.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -54,7 +54,7 @@ def connect(): # generate schema from db Base = automap_base() - engine = create_engine(DATABASE_URI) + engine = create_engine(DATABASE_URI, pool_size=1, pool_recycle=3600) while True: try: Base.prepare(engine, reflect=True) @@ -136,7 +136,8 @@ def process(): mu=11.0/30*3000, sigma=3000/3, beta=11.0/30*3000 /2, - tau=3000/3 /100 + tau=3000/3 /100, + draw_probability=0 ) for match in db.query(Match).options(\ load_only("api_id")\ @@ -158,7 +159,7 @@ def process(): sigma = participant.trueskill_sigma or player.trueskill_sigma if mu is None: # no data -> approximate ts by VST - mu = vst_points[participant.skill_tier] + mu = 3/2 * vst_points[participant.skill_tier] sigma = mu / 3 player.trueskill_mu = mu player.trueskill_sigma = sigma @@ -171,6 +172,7 @@ def process(): if len(matchup) != 2: logging.error("got an invalid matchup", match.api_id) + match.trueskill_quality = 0 continue # store the fairness of the match @@ -180,7 +182,7 @@ def process(): # lower rank is better = winner! for rating, participant in zip(team, roster.participants): player = participant.player[0] - participant.trueskill_delta = (rating.mu + rating.sigma) - (float(player.trueskill_mu) + float(player.trueskill_sigma)) + participant.trueskill_delta = (rating.mu - rating.sigma) - (float(player.trueskill_mu) - float(player.trueskill_sigma)) if player.trueskill_mu == participant.trueskill_mu \ and player.trueskill_sigma == participant.trueskill_sigma: # match hasn't been rated before |
