Module: Tournament::Swiss::Dutch
Overview
A simplified Dutch pairing system implementation.
Instance Method Summary collapse
-
#pair(driver, options = {}) ⇒ Array<Array(team, team)>
Pair teams using dutch pairing for a swiss system tournament.
Instance Method Details
#pair(driver, options = {}) ⇒ Array<Array(team, team)>
Pair teams using dutch pairing for a swiss system tournament.
Teams are initially grouped by their score and then slide paired (Algorithm::GroupPairing.slide). If that fails to produce unique matches it will match teams by the minimum score difference, aniling duplicate matches (default) and optionally pushing byes to a certain side.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/tournament/swiss/dutch.rb', line 24 def pair(driver, = {}) state = build_state(driver, ) dutch_pairings = generate_dutch_pairings(state) duplicates = driver.count_duplicate_matches(dutch_pairings) if duplicates.zero? dutch_pairings else generate_best_pairings(state) end end |