コード例 #1
0
def modify_scores(winner_id, loser_id):
    winnerIndividual = Database.get_individual_for_id(winner_id)
    loserIndividual = Database.get_individual_for_id(loser_id)

    (newWinnerScore, newLoserScore) = elo.get_elos_for_result(winnerIndividual["elo"], loserIndividual["elo"], elo.ResultType.WIN)

    Database.update_elo_for_id(winner_id, newWinnerScore)
    Database.update_elo_for_id(loser_id, newLoserScore)
    Database.incr_comparisons()
コード例 #2
0
def save_decision(winner_id, loser_id):
    winner = Database.get_individual_for_id(winner_id)
    loser = Database.get_individual_for_id(loser_id)
    Database.record_decision(winner, loser)