MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / run_tournament

Method run_tournament

codeclash/analysis/bootstrap/bootstrap.py:84–95  ·  view source on GitHub ↗

Runs tournament with the players and updates their measured elo.

(self, players: list[Player])

Source from the content-addressed store, hash-verified

82 self.update_strategy = update_strategy
83
84 def run_tournament(self, players: list[Player]):
85 """Runs tournament with the players and updates their measured elo."""
86 assert len(players) == 2
87 results = []
88 for _round in range(self.n_rounds):
89 results.append(self.game.play_game(players))
90 if self.update_strategy == "per_round":
91 self._update_elo_per_round(players, results)
92 elif self.update_strategy == "per_tournament":
93 self._update_elo_per_tournament(players, results)
94 else:
95 raise ValueError(f"Invalid update strategy: {self.update_strategy}")
96
97 def _update_elo_per_round(self, players: list[Player], results: list[dict[str, int]]):
98 for result in results:

Callers 1

runMethod · 0.80

Calls 3

_update_elo_per_roundMethod · 0.95
play_gameMethod · 0.80

Tested by

no test coverage detected