Kyle-Falconer / Court-Scheduler

3 stars 2 forks source link

Round-robin construction doesn't guarentee 10 games per team #28

Open Kyle-Falconer opened 10 years ago

Kyle-Falconer commented 10 years ago

The current implementation of the Round-Robin function will exit if it is unable to create 10 matches against teams.

It currently checks schedule compatibility when building the matches, and this should not be the case. Schedule matching should be left up to the solver engine. This way, when a match is scheduled when it is "impossible" for the teams to play each other, the warning flag can be inserted into the output file so that it can be resolved manually.

This will also solve the hack/workaround that I put in to avoid the infinite loop case.

stardustspeedway commented 10 years ago

Keep in mind that we need the call to cannotPlay()-- otherwise, it might create a match which is impossible to schedule, and that'd be a regression.

On Tue, Dec 10, 2013 at 4:28 PM, Kyle Falconer notifications@github.comwrote:

The current implementation of the Round-Robin function will exit if it is unable to create 10 matches against teams.

It currently checks schedule compatibility when building the matches, and this should not be the case. Schedule matching should be left up to the solver engine.

This will also solve the hack/workaround that I put in to avoid the infinite loop case.

— Reply to this email directly or view it on GitHubhttps://github.com/netinept/Court-Scheduler/issues/28 .

Kyle-Falconer commented 10 years ago

Yes, we need cannotPlay, but cannotPlay is wrong and should only determine when it is physically impossible for the teams to play (like when it is the same team). cannotPlay should not check the schedules.

The reason for this is that you might have two teams which need to play each other and say that team 1 can only play on saturdays and team 2 cannot play on saturdays. If you check for valid schedule match ups, then the two teams would never play each other.

Instead, we should schedule the teams on a day (violating that date constraint) and then flag the match in the output indicating the failed constraint.