View Single Post
Old 11-21-2015, 11:11 PM   #59
Fishbreath
Minors (Double A)
 
Fishbreath's Avatar
 
Join Date: Oct 2015
Posts: 145
After some brutal work tonight, I have schedules normalizing. After and home-away balancing, the schedule generation engine looks for stretches of days with a number of games well below average, and moves series from days with above-average numbers of games to cover the gaps.

I also improved the start day selection for sparse schedules, where the number of games per team is much smaller than the number of days in the season. There are fewer busy days, where most of the league is playing at once, fewer empty days, and more average days. This is the first part of the scheduler that works differently based on schedule characteristics. Start days are selected by finding the nearest available start day for two given teams to a given target day. Sparse schedules (those with a fill factor of less than 0.8) select the target based on this formula:

Code:
((seriesScheduledAgainstOpponent - 1) * daysBetweenSeries + random(0,daysBetweenSeries * 2))
That is, pick a random day between the start of the window for the last series before the series in question, and the start of the window for the next series after the series in question. Compact schedules, on the other hand, just use this: ((seriesScheduledAgainstOpponent - 1) * daysBetweenSeries). The undesirable clustering effect for sparse schedules helps fit compact schedules together.

Next on the list is weekday-based scheduling, which is relatively simple in terms of mechanics, but will require some care in terms of implementation. It touches a lot of code throughout the project.
Fishbreath is offline   Reply With Quote