A game scheduler for sports leagues.
Versizzle takes in a list of matchups and a list of gameslots.
- matchup - a game that must be played between two teams
- gameslot - an available timeslot for a game at some location
It assigns each matchup to a gameslot. These assignments constitute a schedule.
- blackouts - gameslots can be marked as unsuitable ("blacked out") for some teams
- home balancing - if possible, each team is given an equal number of home and away games
- window constraints - to ensure an even distribution of games throughout the season, Versizzle can enforce constraints like "no team plays two games on the same day" or "no team plays more than two games in any five-day window"
- game blocking - Versizzle strongly prefers to schedule games in consecutive blocks at a single location. This is convenient for referees who want to work a series of games in a row
- preassignments - a portion of the schedule can be filled in manually, and the scheduler will handle the rest
- seed searching - Versizzle can run many randomized schedules and output metrics for each, allowing the user to choose the best possible schedule
-
Clone the repository and
cd
into it. -
Install
requirements.txt
into a virtual environment. For example, on Ubuntu:python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Copy all of the
csv
files fromexamples/basketball_2024
into thein
folder. -
Run the scheduler:
python3 -m versizzle
-
Verify that the expected files appeared in
out
:breakout.txt
master.txt
metrics.txt
pasteable.txt
Instead of generating a single schedule, Versizzle can also be configured to run many possible schedules, outputting metrics for each. By examining these metrics, you can look for a schedule with optimal properties. To perform a seed search:
-
Uncomment the
seed_search
block inconfig.yml
. -
Run the scheduler:
python3 -m versizzle
-
Verify that
seeds.txt
appeared inout
.