diff options
author | tkimia <tkimia@purdue.edu> | 2014-04-28 01:30:48 -0400 |
---|---|---|
committer | tkimia <tkimia@purdue.edu> | 2014-04-28 01:30:48 -0400 |
commit | 85c74dac1f82dc1869a2875a9354be0b4b3361ac (patch) | |
tree | 4154815d3e5896ee6d68712f08a4dcac2b84872b /lib/scheduling | |
parent | b0b2a235f02b95058aa7bfbf817d5dd1d85b6730 (diff) | |
parent | 9a8d183f6896a92b84a15599323b32e73b5868b9 (diff) |
Merge branch 'master' of https://github.com/LukeShu/leaguer
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 |