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

Method __init__

codeclash/tournaments/pvp.py:24–46  ·  view source on GitHub ↗
(
        self,
        config: dict,
        *,
        output_dir: Path,
        cleanup: bool = False,
        keep_containers: bool = False,
    )

Source from the content-addressed store, hash-verified

22
23
24class PvpTournament(AbstractTournament):
25 def __init__(
26 self,
27 config: dict,
28 *,
29 output_dir: Path,
30 cleanup: bool = False,
31 keep_containers: bool = False,
32 early_stop: Callable[[list[str]], bool] | None = None,
33 ):
34 metadata_file = output_dir / "metadata.json"
35 if metadata_file.exists():
36 raise FileExistsError(f"Metadata file already exists: {metadata_file}")
37
38 super().__init__(config, name="PvpTournament", output_dir=output_dir)
39 self.cleanup_on_end = cleanup
40 # Given the agent-round winners so far (rounds 1..n), return True to stop before `rounds`.
41 self.early_stop = early_stop
42 self.game: CodeArena = get_arena(
43 self.config,
44 tournament_id=self.tournament_id,
45 local_output_dir=self.local_output_dir,
46 keep_containers=keep_containers,
47 )
48 self.agents: list[Player] = []
49 for agent_conf in self.config["players"]:

Callers

nothing calls this directly

Calls 2

get_agentMethod · 0.95
get_arenaFunction · 0.90

Tested by

no test coverage detected