Skip to content

Commit 29dd3aa

Browse files
Scheduler: prioritize later matches to maximize gap between team activities (#2102)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: johnmeshulam <55348702+johnmeshulam@users.noreply.github.com>
1 parent 734a3cc commit 29dd3aa

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

apps/scheduler/src/services/scheduler_service.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ def _make_matches(self):
110110
return matches
111111

112112
def _use_constraints(self):
113-
"""Use the constraints from the validator to assign teams to matches."""
113+
"""Use the constraints from the validator to assign teams to matches.
114+
115+
Available matches are processed in reverse chronological order to maximize
116+
the gap between team activities (judging sessions and robot matches).
117+
"""
114118

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

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

131138
for match in available_matches:

0 commit comments

Comments
 (0)