View Source ExTournaments.Utils.PairingHelpers (ExTournaments v0.5.1)
Collection of helpers to use in pairings algorithms
Link to this section Summary
Functions
Calculate exponent and remainder of the players by the power of 2
Takes count of matches and number of the current fill iteration. It will generate fill pattern to build matches flow.
Takes calculated remainder and return list of matches for the preliminary round
Takes list of %ExTournaments.Match{}
structs, round index, first round index, calculated exponents and flag to toggle function.
Takes calculated exponent and return list of prefilled participants seed
Takes list of players IDs and according to the passed flag it will shuffle it.
Takes list of matches, first round index, list of players IDs and calculated exponent and remainder. It will set BYE to the matches in the first round by the remainder.
Takes list of matches, list of seeds, first round index, list of players IDs and calculated remainder. It will assign players to the matches by the list of seeds and shuffling algorithms.
Link to this section Functions
Calculate exponent and remainder of the players by the power of 2
Takes count of matches and number of the current fill iteration. It will generate fill pattern to build matches flow.
Returns list of number for matches flow.
@spec generate_preliminary_matches(number(), integer()) :: [ExTournaments.Match.t()]
Takes calculated remainder and return list of matches for the preliminary round
generate_regular_matches(matches, round, starting_round, exponent, match_exponent, iterated)
View Source@spec generate_regular_matches( [ExTournaments.Match.t()], non_neg_integer(), non_neg_integer(), number(), number(), boolean() ) :: {[ExTournaments.Match.t()], integer()}
Takes list of %ExTournaments.Match{}
structs, round index, first round index, calculated exponents and flag to toggle function.
Returns tuple with a list of generated matches and count of rounds.
Takes calculated exponent and return list of prefilled participants seed
Takes list of players IDs and according to the passed flag it will shuffle it.
set_byes_for_first_round(matches, players_list, starting_round, exponent, arg5)
View Source@spec set_byes_for_first_round( [ExTournaments.Match.t()], [integer()], integer(), number(), number() ) :: [ExTournaments.Match.t()]
Takes list of matches, first round index, list of players IDs and calculated exponent and remainder. It will set BYE to the matches in the first round by the remainder.
Returns list of matches with assigned BYE.
set_players_for_first_round(matches, bracket, starting_round, players_list, remainder)
View Source@spec set_players_for_first_round( [ExTournaments.Match.t()], [integer()], non_neg_integer(), [non_neg_integer()], number() ) :: [ExTournaments.Match.t()]
Takes list of matches, list of seeds, first round index, list of players IDs and calculated remainder. It will assign players to the matches by the list of seeds and shuffling algorithms.
Returns list of matches with assign players to the first round.