diff options
Diffstat (limited to 'lib/scheduling')
-rw-r--r-- | lib/scheduling/README.md | 4 | ||||
-rw-r--r-- | lib/scheduling/round_robin.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/scheduling/README.md b/lib/scheduling/README.md index 8b21164..fe6aba1 100644 --- a/lib/scheduling/README.md +++ b/lib/scheduling/README.md @@ -4,7 +4,7 @@ Scheduling interface Files in this directory should be _classes_ implementing the following interface: - - `initialize(tournament_stage)` + - `initialize(TournamentStage)` Construct new Scheduling object from tournament_stage. @@ -12,7 +12,7 @@ interface: Creates all the matches of the current round. - - `finish_match(match)` + - `finish_match(Match)` Progresses the match through the schedule. diff --git a/lib/scheduling/round_robin.rb b/lib/scheduling/round_robin.rb index 0cbddc1..f2e4144 100644 --- a/lib/scheduling/round_robin.rb +++ b/lib/scheduling/round_robin.rb @@ -9,7 +9,7 @@ module Scheduling def create_matches # => find the number of matches and teams to create @num_teams = (tournament.players.count/tournament.min_players_per_team).floor - @matches_per_round = num_teams * tournament.min_teams_per_match + @matches_per_round = @num_teams * tournament.min_teams_per_match # => initialize data and status members @team_pairs ||= {} @@ -18,13 +18,13 @@ module Scheduling end # => Create new matches - @matches_per_round.each do |match| + @matches_per_round.times do tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0) end # => seed the first time if @team_pairs.empty? - tournament_stage.seeding.seed_matches(tournament_stage) + tournament_stage.seeding.seed(tournament_stage) tournament_stage.matches.each {|match| match.teams.each {|team| @team_pairs += team}} else # => Reorder the list of teams |