fix: game priority update (#30)

This commit is contained in:
2024-02-19 16:31:49 -05:00
committed by GitHub

View File

@@ -96,7 +96,7 @@ def calculate_game_priority(game):
home_score = game["homeTeam"]["score"] home_score = game["homeTeam"]["score"]
away_score = game["awayTeam"]["score"] away_score = game["awayTeam"]["score"]
score_difference = abs(home_score - away_score) score_difference = abs(home_score - away_score)
score_total = (home_score + away_score) * 20 score_total = (home_score + away_score) * 25
# Calculate the base priority based on period # Calculate the base priority based on period
base_priority = {5: 450, 4: 400, 3: 300, 2: 200}.get(period, 100) base_priority = {5: 450, 4: 400, 3: 300, 2: 200}.get(period, 100)
@@ -114,7 +114,9 @@ def calculate_game_priority(game):
base_priority += 100 base_priority += 100
# Calculate time priority # Calculate time priority
time_priority = (1200 - time_remaining) / 20 time_multiplier = {4: 2, 3: 2, 2: 1.5}.get(period, 0.75)
time_priority = ((1200 - time_remaining) / 20) * time_multiplier
# Calculate the final priority # Calculate the final priority
final_priority = int(base_priority + time_priority - matchup_adjustment + score_total) final_priority = int(base_priority + time_priority - matchup_adjustment + score_total)