diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 18:25:04 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 18:25:04 -0400 |
commit | c16c1b2928d0156fc00617a6abd81f4714045e5e (patch) | |
tree | 963a38a2b638f0d6ccf4cb0efe6a6e86e5728b60 /lib/scheduling | |
parent | bd1699969017c8c8f056808ba33e906426962754 (diff) |
Updated Seeing and Round Robin scheduling.
Diffstat (limited to 'lib/scheduling')
-rw-r--r-- | lib/scheduling/round_robin.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/scheduling/round_robin.rb b/lib/scheduling/round_robin.rb index 7a9e257..1d9ac0d 100644 --- a/lib/scheduling/round_robin.rb +++ b/lib/scheduling/round_robin.rb @@ -7,11 +7,15 @@ module Scheduling end def create_matches + #number of teams*number of teams per match = number of matches per round num_teams = (tournament.players.count/tournament.min_players_per_team).floor - num_matches = Float(num_teams/2)*(num_teams-1) - for i in 1..num_matches + @matches_per_round = num_teams * tournament.min_teams_per_match + + @matches_per_round.each do |match| tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0) end + + tournament_stage.seeding.seed_matches(tournament_stage) end def finish_match(match) |