Skip to content

Scheduler: prioritize later matches to maximize gap between team activities#2102

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/optimize-scheduler-logic
Draft

Scheduler: prioritize later matches to maximize gap between team activities#2102
Copilot wants to merge 2 commits intomainfrom
copilot/optimize-scheduler-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

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_matches is now iterated in reverse chronological order:

# Before: assigns teams to first available matches (shortest gaps)
available_matches = round["available_matches"]

# After: assigns teams to last available matches (largest gaps)
available_matches = list(reversed(round["available_matches"]))

This is safe because _cross_reference_match_slots already resolves shared-match conflicts between sessions before _use_constraints() runs — each session's available_matches is already exclusive to that session by the time ordering matters.

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshots

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings

@github-project-automation github-project-automation Bot moved this to Backlog in LEMS Apr 22, 2026
Copilot AI linked an issue Apr 22, 2026 that may be closed by this pull request
…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
Copilot AI requested a review from johnmeshulam April 22, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Scheduler optimization

2 participants