Skip to content

HMTV2-13: new scheduler algorithm and prescreening#20

Open
Essam-Khawaja wants to merge 2 commits into
mainfrom
HMTV2-13-scheduler-algorithm-new
Open

HMTV2-13: new scheduler algorithm and prescreening#20
Essam-Khawaja wants to merge 2 commits into
mainfrom
HMTV2-13-scheduler-algorithm-new

Conversation

@Essam-Khawaja

@Essam-Khawaja Essam-Khawaja commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Here is the update for the scheduler algorithm:

  1. You go into admin and create a new judging round. The test one is about two hours long
image
  1. Set that round to be active judging (don't need to do this for it to work, but I'm showing you how a user might use it)
image
  1. Set the judging rooms to whatever settings, the number of rooms can only go to max the number of judges. Then click auto-assign
image
  1. You can then see all the assignments on the table
image

Its a pretty simple algorithm honestly, so I'll explain it here in detail so you can let me know if we need something different. Firstly, the judging assignments is just a straight division calc, but we also have to consider uneven distributions, hence the extra variable.

baseJudgesPerRoom = Math.floor(judges.length / roomCount)
extraJudgeRooms = judges.length % roomCount  // Checks for remaining extra judges

For example. 7 judges and 3 rooms would be:
baseJudgesPerRoom = Math.floor(7 / 3) = 2
extraJudgeRooms = 7 % 3 = 1

Meaning one extra judge to be placed in one room.

For teams its far easier, we just do a round-robin style assignment:
(For each team at index i):
roomIndex = i % roomCount
slotIndex = Math.floor(i / roomCount)

Of course, there is some base validation too. We check the maximum number of teams that can be assigned in the given timeframe, and if it goes above that, then we return an error.

I also have some very basic prescreening stuff setup. It's just a couple of field updates to the scheme for hackathon_organization table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant