def __init__(self, teams, num_turns, back_round=False, log_folder=None): self.teams = teams self.translator = contest.generate_key_names(teams) self.keys = [] self.num_turns = num_turns self.log_folder = log_folder for t in self.translator: self.keys.append(t) self.matchs = pairing.make_pairings(self.keys, back_round) self.rounds = [] for jorn in self.matchs: self.rounds.append( round.Round(jorn, self.translator, self.num_turns)) self.puntuations_by_round = [] self.puntuations = {} for key in self.keys: self.puntuations[key] = 0 self.number_of_rounds = len(self.rounds) self.current_round = 0 self.league_completed = False
def __init__(self, teams, num_turns, back_round=False): self.teams = teams self.translator = contest.generate_key_names(teams) self.keys = [] self.num_turns = num_turns for t in self.translator: self.keys.append(t) self.matchs = pairing.make_pairings(self.keys, back_round) self.rounds = [] base_path = configure.load_configuration()['games_path'] + '/' self.tournament_file_name = base_path + filenames.generate_filename('league') print self.tournament_file_name for jorn in self.matchs: self.rounds.append(round.Round(jorn, self.translator, self.tournament_file_name, self.num_turns)) self.puntuations_by_round = [] self.puntuations = {} for key in self.keys: self.puntuations[key] = 0 self.number_of_rounds = len(self.rounds) self.actual_round = 0 self.league_completed = False
def __init__(self, teams, num_turns, back_round=False, log_folder = None): self.teams = teams self.translator = contest.generate_key_names(teams) self.keys = [] self.num_turns = num_turns self.log_folder = log_folder for t in self.translator: self.keys.append(t) self.matchs = pairing.make_pairings(self.keys, back_round) self.rounds = [] for jorn in self.matchs: self.rounds.append(round.Round(jorn, self.translator, self.num_turns)) self.puntuations_by_round = [] self.puntuations = {} for key in self.keys: self.puntuations[key] = 0 self.number_of_rounds = len(self.rounds) self.current_round = 0 self.league_completed = False