From 179addde1a64543e21f253498f7fdaa483c4e243 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:03:36 +0000 Subject: [PATCH 1/2] Initial plan From 41d5a975dd1c0cbac707bc9b2636bfeedf1ad8af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:07:24 +0000 Subject: [PATCH 2/2] Scheduler: process available matches in reverse order to maximize activity gaps Agent-Logs-Url: https://github.com/FIRSTIsrael/lems/sessions/fdb2b8e7-866e-44f2-b089-5923e9df5c83 Co-authored-by: johnmeshulam <55348702+johnmeshulam@users.noreply.github.com> --- apps/scheduler/src/services/scheduler_service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/scheduler/src/services/scheduler_service.py b/apps/scheduler/src/services/scheduler_service.py index 283b54f5c..730975fb5 100644 --- a/apps/scheduler/src/services/scheduler_service.py +++ b/apps/scheduler/src/services/scheduler_service.py @@ -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"] @@ -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: