Module: Tournament::Swiss
- Extended by:
- Swiss
- Included in:
- Swiss
- Defined in:
- lib/tournament/swiss.rb,
lib/tournament/swiss/dutch.rb
Overview
Implements the swiss tournament system
Defined Under Namespace
Modules: Dutch
Instance Method Summary collapse
-
#generate(driver, options = {}) ⇒ nil
Generate matches with the given driver.
-
#minimum_rounds(driver) ⇒ Integer
The minimum number of rounds to determine a number of winners.
Instance Method Details
#generate(driver, options = {}) ⇒ nil
Generate matches with the given driver.
17 18 19 20 21 22 23 24 |
# File 'lib/tournament/swiss.rb', line 17 def generate(driver, = {}) pairer = [:pairer] || Dutch = [:pair_options] || {} pairings = pairer.pair(driver, ) driver.create_matches(pairings) end |
#minimum_rounds(driver) ⇒ Integer
The minimum number of rounds to determine a number of winners.
30 31 32 |
# File 'lib/tournament/swiss.rb', line 30 def minimum_rounds(driver) Algorithm::Swiss.minimum_rounds(driver.seeded_teams.length) end |