Scheduler: prioritize later matches to maximize gap between team activities#2102
Draft
Scheduler: prioritize later matches to maximize gap between team activities#2102
Conversation
…ivity 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>
Copilot
AI
changed the title
[WIP] Optimize scheduler for team match selection
Scheduler: prioritize later matches to maximize gap between team activities
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a judging session overlaps with a match round, teams had more available match slots than needed — but the scheduler always picked the earliest ones, minimizing wait time between judging and robot game. This flips that priority: teams are now assigned to the last available matches first, maximizing gaps wherever the schedule allows.
Change
In
_use_constraints(),available_matchesis now iterated in reverse chronological order:This is safe because
_cross_reference_match_slotsalready resolves shared-match conflicts between sessions before_use_constraints()runs — each session'savailable_matchesis already exclusive to that session by the time ordering matters.Type of change
Screenshots
N/A
Checklist