summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-24 18:37:18 -0400
committertkimia <tkimia@purdue.edu>2014-04-24 18:37:18 -0400
commit575c8a552cbcf11934b32f4d24636cdc18094f53 (patch)
tree48aa5e00205d0aa40d82a3b0b68b2d5f4bde83d6 /lib
parentbd1bfe729030312fc678a3705c881744aa650c63 (diff)
number of matches has new formula that works for all teams/match
Diffstat (limited to 'lib')
-rw-r--r--lib/scheduling/elimination.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb
index 4e368b5..cf0d625 100644
--- a/lib/scheduling/elimination.rb
+++ b/lib/scheduling/elimination.rb
@@ -17,7 +17,7 @@ module Scheduling
def create_matches
num_teams = (self.tournament.players.count/self.tournament.min_players_per_team).floor
- num_matches = num_teams - 1
+ num_matches = (Float(num_teams - tournament.min_teams_per_match)/(tournament.min_teams_per_match - 1)).ceil + 1
for i in 1..num_matches
self.tournament_stage.matches.create(status: 0, submitted_peer_evaluations: 0)
end