Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions apps/scheduler/src/services/scheduler_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def _make_matches(self):
return matches

def _use_constraints(self):
"""Use the constraints from the validator to assign teams to matches."""
"""Use the constraints from the validator to assign teams to matches.

Available matches are processed in reverse chronological order to maximize
the gap between team activities (judging sessions and robot matches).
"""

for entry in self.validator_data:
overlapping_rounds = entry["overlapping_rounds"]
Expand All @@ -125,7 +129,10 @@ def _use_constraints(self):
)

for round in overlapping_rounds:
available_matches = round["available_matches"]
# Process matches in reverse order (last matches first) so that
# teams are assigned to later matches whenever possible, resulting
# in larger wait times between judging and robot game activities.
available_matches = list(reversed(round["available_matches"]))
round_teams = session_teams.copy()

for match in available_matches:
Expand Down
Loading