From cc7faa1bc3a542e0ea057971d37aa400f711d8c0 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 27 Apr 2014 18:22:19 -0400 Subject: tidy up README.md's --- lib/scheduling/README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib/scheduling') diff --git a/lib/scheduling/README.md b/lib/scheduling/README.md index 173b7be..8b21164 100644 --- a/lib/scheduling/README.md +++ b/lib/scheduling/README.md @@ -1,13 +1,22 @@ -Files in this directory should implement the following interface: +Scheduling interface +==================== + +Files in this directory should be _classes_ implementing the following +interface: - `initialize(tournament_stage)` - construct new Scheduling object from tournament_stage + + Construct new Scheduling object from tournament_stage. - `create_matches` - creates all the matches of the current round + + Creates all the matches of the current round. - `finish_match(match)` - progresses the match through the schedule + + Progresses the match through the schedule. - `graph` - returns a string representation of an svg image of the current stage \ No newline at end of file + + Returns a string representation of an svg image of the current + stage. -- cgit v1.2.3-2-g168b From c16c1b2928d0156fc00617a6abd81f4714045e5e Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sun, 27 Apr 2014 18:25:04 -0400 Subject: Updated Seeing and Round Robin scheduling. --- lib/scheduling/round_robin.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/scheduling') 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) -- cgit v1.2.3-2-g168b