Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to add and remove teams on the fly #7

Open
ecridge opened this issue Jun 12, 2015 · 0 comments
Open

Add ability to add and remove teams on the fly #7

ecridge opened this issue Jun 12, 2015 · 0 comments

Comments

@ecridge
Copy link
Owner

ecridge commented Jun 12, 2015

This isn't going to be trivial, and will probably be easier to do once #1 has been accomplished.

Simple fix

A simple solution would be to add buttons which can increment or decrement the number of teams playing one an a time. The decrement button should ask which team to remove and then start a new session (with one less team) from the same game number with the number of the last team replacing that of the team being removed (or, incrementing by one all team numbers greater than or equal to the team being removed – whichever provides the most continuity). The increment button should start a new session with one more team with the new team taking the team number one greater than the last team.

This is a partial solution in that it allows addition and removal of teams without interrupting the session (or causing any confusion with regards to numbering), but does not make any attempt to rectify the inevitable discontinuity at the time of the switch (i.e. if you consider the period either side of the team addition/removal, there will be some teams that play 3 or 4 consecutive games while others play none at all).

Full solution

At present IceTimer works its way through precompiled lists of fixtures generated by Matchgen, which are ordered so that all teams are on and off the ice regularly throughout the session, whilst making sure that each team gets to play every other.

Smooth addition and removal of teams requires that the algorithm that generates the fixtures is aware of the change and can try to make the transition continuous. There are several ways that this functionality could be added to IceTimer:

  • Assimilate Matchgen's code into IceTimer's MatchList class and have it regenerate the fixtures whenever a team is added or removed, specifying initial weightings for each team based on the time since they last played. This is probably the best solution in terms of extensibility, but requires significant refactoring of IceTimer's code.
  • Continue to load precompiled fixtures into MatchList, but add code to help it choose the best point in the list to restart the session. This may be easier to implement but is essentially going further down a dead end.
  • Scrap Matchgen and develop a new dynamic algorithm for MatchList to use. I guess this would be neat but it seems like a huge waste of time.

Assimilating Matchgen's code is probably the most worthwhile, since the second option is only a small improvement over the quick fix.

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

No branches or pull requests

1 participant