Skip to content

Commit

Permalink
Updated win probability calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
Foulest committed Dec 8, 2024
1 parent a99b636 commit 29860d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/net/foulest/swiss/match/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ public Team simulate(boolean mostLikelyOnly) {
* Calculates the win probability of a team against another team.
* <p>
* If the match is the best of one:
* - 30% of the win probability is based on the team's world ranking.
* - 70% of the win probability is based on the team's average player rating.
* - 35% of the win probability is based on the team's world ranking.
* - 65% of the win probability is based on the team's average player rating.
* <p>
* If the match is the best of three:
* - 70% of the win probability is based on the team's world ranking.
* - 30% of the win probability is based on the team's average player rating.
* - 65% of the win probability is based on the team's world ranking.
* - 35% of the win probability is based on the team's average player rating.
*
* @param t1 The first team.
* @param t2 The second team.
* @return The win probability of the first team.
*/
public static double calculateWinProbability(@NotNull Team t1, @NotNull Team t2, boolean bestOfThree) {
double worldRankingWeight = bestOfThree ? 0.70 / 100.0 : 0.30 / 100.0;
double playerRatingWeight = bestOfThree ? 0.30 : 0.70;
double worldRankingWeight = bestOfThree ? 0.65 / 100.0 : 0.35 / 100.0;
double playerRatingWeight = bestOfThree ? 0.35 : 0.65;
double scale = 5.0;

// Compute scores
Expand Down

0 comments on commit 29860d6

Please sign in to comment.